Hi ,
I'm trying to change the music properties but it doesn't change them. It doenst update title but all several properties os audio MP3 file but sometime it dienst change any of property.
FOllowing is the code set properties gets and set the values in text box btn save updates the properties which causes problem.
private async void SetProperties(){
property = await selectedFile.Properties.GetMusicPropertiesAsync();
txtAlbum.Text = property.Album;
txtAlbumArtist.Text = property.AlbumArtist;
txtArtist.Text = property.Artist;
txtPublisher.Text = property.Publisher;
txtRating.Text = property.Rating.ToString();
txtSubtitle.Text = property.Subtitle;
txtTitle.Text = property.Title;
txtTrackNumber.Text = property.TrackNumber.ToString();
txtYears.Text = property.Year.ToString();
lblBitRate.Text = property.Bitrate.ToString();
lblComposer.Text = string.Join(" , ", property.Composers.ToArray());
lblConductors.Text = string.Join(" , ", property.Conductors.ToArray());
lblDuration.Text = property.Duration.Minutes.ToString() + ":" + property.Duration.Seconds.ToString();
lblGenre.Text = string.Join(" , ", property.Genre.ToArray());
lblMediaTitle.Text = selectedFile.Name;
txtFileName.Text = selectedFile.Name;
lblFileType.Text = selectedFile.FileType;
lblProducers.Text = string.Join(" , ", property.Producers.ToArray());
lblWriters.Text = string.Join(" , ", property.Writers.ToArray());
}
private void btnSave_Click(object sender, RoutedEventArgs e)
{
//property = await selectedFile.Properties.GetMusicPropertiesAsync();
property.Album = txtAlbum.Text;
property.AlbumArtist = txtAlbumArtist.Text;
property.Artist = txtArtist.Text;
property.Publisher = txtPublisher.Text;
property.Rating = uint.Parse(txtRating.Text);
property.Subtitle = txtSubtitle.Text;
property.Title = txtTitle.Text;
property.TrackNumber = uint.Parse(txtTrackNumber.Text);
property.Year = uint.Parse(txtYears.Text);
SaveProperties(property,txtFileName.Text);
}
private async void SaveProperties(Windows.Storage.FileProperties.MusicProperties prop , string Name) {
await property.SavePropertiesAsync();
}
Thank You , Shan Ali Khan
No comments:
Post a Comment