Exemple #1
0
        public static void SaveTags(SongFile songFile)
        {
            TagLib.File newFile = GetTagsFromFile(Caching.currentFile.fullPath);

            newFile.SetInterpret(songFile.Interpret);
            newFile.Tag.Title   = songFile.Title;
            newFile.Tag.Album   = songFile.Album;
            newFile.Tag.Comment = songFile.Comment;
            newFile.Tag.Track   = (uint)songFile.Track;
            newFile.Tag.Year    = (uint)songFile.Year;
            newFile.SetGenre(songFile.Genre);
            newFile.SetImage(Caching.currentFile.Cover.ConvertToPicture());

            newFile.Refresh(Caching.currentFile.fullPath);

            if (Caching.currentFile.Cover != null)
            {
                TagLib.File newFileTEMP = TagLib.File.Create(Caching.currentFile.fullPath);

                newFileTEMP.SetImage(Caching.currentFile.Cover.ConvertToPicture());

                newFileTEMP.Save();

                newFileTEMP.Dispose();
            }
        }