コード例 #1
0
        private bool TryGetTitleAndArtistBySource(out string title, out string artist)
        {
            title  = null;
            artist = null;

            string fileName = GetFileName(source);
            int    index    = fileName.IndexOf(flieNameSeperator);

            if (index == -1)
            {
                return(false);
            }

            title  = fileName.Substring(index + flieNameSeperator.Length);
            artist = fileName.Remove(index);
            return(true);
        }
コード例 #2
0
        public void Reload()
        {
            parent = new ID3File(source);

            if (parent.ID3v1Tag == null)
            {
                parent.ID3v1Tag = new ID3v1Tag();
            }
            if (parent.ID3v2Tag == null)
            {
                parent.ID3v2Tag = new ID3v2Tag();
            }

            V1Tag = new EditID3v1Tag(parent.ID3v1Tag);
            V2Tag = new EditID3v2Tag(parent.ID3v2Tag);

            Title       = new PropertySynchronizer(V1Tag, V2Tag, nameof(V1Tag.Title), FrameFactory.TitleFrameId);
            Artist      = new PropertySynchronizer(V1Tag, V2Tag, nameof(V1Tag.Artist), FrameFactory.LeadArtistFrameId, FrameFactory.BandFrameId);
            Album       = new PropertySynchronizer(V1Tag, V2Tag, nameof(V1Tag.Album), FrameFactory.AlbumFrameId);
            TrackNumber = new PropertySynchronizer(V1Tag, V2Tag, nameof(V1Tag.TrackNumber), FrameFactory.TrackNumberFrameId);
            Year        = new PropertySynchronizer(V1Tag, V2Tag, nameof(V1Tag.Year), FrameFactory.YearFrameId);

            FileName = new FileNameSynchronizer(this);
        }