// Event for Saving an MP3 protected void eventSaveMP3(object pSender, EventArgs pArgs) { if (workingMP3.id3Title == null) { return; } workingMP3.id3Title = tbTitle.Text; workingMP3.id3Artist = tbArtist.Text; workingMP3.id3Album = tbAlbum.Text; workingMP3.id3Year = tbYear.Text; workingMP3.id3Comment = tbComment.Text; FileCommands.updateMP3Tag(ref workingMP3); }
// Event for Loading an MP3 protected void eventLoadMP3(object pSender, EventArgs pArgs) { OpenFileDialog fileDialog = new OpenFileDialog(); fileDialog.Filter = "MP3 files files (*.mp3)|*.mp3"; fileDialog.ShowDialog(); string fileName = fileDialog.FileName; // If a file was selected get its ID3 Tag if (fileName.Length > 0) { FileInfo fFileInfo = new FileInfo(fileName); // Creating this FileInfo so I don't have to change my generic class workingMP3 = new MP3(fFileInfo.DirectoryName, fFileInfo.Name); //fFile.DirectoryName, fFile.Name); FileCommands.readMP3Tag(ref workingMP3); tbTitle.Text = workingMP3.id3Title; tbArtist.Text = workingMP3.id3Artist; tbAlbum.Text = workingMP3.id3Album; tbYear.Text = workingMP3.id3Year; tbComment.Text = workingMP3.id3Comment; } }