Esempio n. 1
0
        /// <summary>
        /// Fills songs tags.
        /// </summary>
        /// <param name="path">Full path to mp3 file.</param>
        /// <param name="performer">Performer.</param>
        /// <param name="songName">Songs name.</param>
        /// <param name="ACTION">Action with image - none, set random or upload.</param>
        /// <param name="imagePath">Full path to image file(if set upload action).</param>
        public void EditTags(string path, string performer, string songName, PICTURE_ACTIONS ACTION, string imagePath = null)
        {
            TagLib.File file = TagLib.File.Create(path);
            file.Tag.Performers = new string[1] {
                performer
            };
            file.Tag.Title = songName;

            switch (ACTION)
            {
            case PICTURE_ACTIONS.NONE: break;

            case PICTURE_ACTIONS.RANDOM: file.Tag.Pictures = new Picture[] { new Picture(GetRandomImage()) }; break;

            case PICTURE_ACTIONS.UPLOAD: file.Tag.Pictures = new Picture[] { new Picture(imagePath) }; break;
            }
            file.Save();
        }
Esempio n. 2
0
        private PICTURE_ACTIONS GetPICTURE_ACTIONS()
        {
            PICTURE_ACTIONS STATUS = PICTURE_ACTIONS.NONE;

            this.Dispatcher.Invoke(() =>
            {
                if (rb_pic_rng.IsChecked.Value)
                {
                    STATUS = PICTURE_ACTIONS.RANDOM;
                }

                if (rb_pic_upload.IsChecked.Value)
                {
                    STATUS = PICTURE_ACTIONS.UPLOAD;
                }
            });

            return(STATUS);
        }