예제 #1
0
        private void ImportSong_Click(object sender, RoutedEventArgs e)
        {
            //select file
            string currentPath = OpenStuff.Files.GetPathFromDialog(null, Paths.Defaults.Music, OpenStuff.Files.Kinds.Music);

            TagLib.File newFile = TagProcessing.GetTagsFromFile(currentPath);

            //Cache Info
            Caching.currentFile = new Caching.CachedFile
            {
                fullPath = currentPath,
                Cover    = newFile.GetCoverImage(),
                active   = true
            };

            TB_Interpret.Text = newFile.Tag.FirstPerformer;
            TB_Title.Text     = newFile.Tag.Title;
            TB_Album.Text     = newFile.Tag.Album;
            TB_Track.Text     = newFile.Tag.Track.ToString();
            TB_Year.Text      = newFile.Tag.Year.ToString();
            TB_Comment.Text   = newFile.Tag.Comment;

            CB_Genre.SelectNewItem(newFile.Tag.FirstGenre);

            IMG_Cover.Source = Images.GetCoverForUI(Caching.currentFile.Cover);
        }
예제 #2
0
        private void SaveTags_Click(object sender, RoutedEventArgs e)
        {
            if (saveable)
            {
                TagProcessing.SaveTags(
                    new TagProcessing.SongFile
                {
                    Interpret = TB_Interpret.Text,
                    Title     = TB_Title.Text,
                    Album     = TB_Album.Text,
                    Comment   = TB_Comment.Text,
                    Track     = int.Parse(TB_Track.Text),
                    Year      = int.Parse(TB_Year.Text),
                    Genre     = CB_Genre.GetSelectedContent()
                });
            }

            else
            {
                //TODO
                return;
            }
        }