Example #1
0
 public PictureFrame(FrameHeader header, ID3Version version)
     : base(header)
 {
     if (version == ID3Version.ID3v1)
         throw new InvalidEnumArgumentException("version", (int)version, typeof(ID3Version));
     _version = version;
 }
Example #2
0
        public static Frame FromStream(Stream stream, ID3v2 tag)
        {
            bool result = false;
            FrameHeader header = new FrameHeader(stream, tag.Header.Version);
            long streamPosition = stream.Position + header.FrameSize;
            var frame = FrameFactory.Instance.TryGetFrame(header, tag.Header.Version, stream, out result);
            stream.Position = streamPosition;

            return frame;
        }
Example #3
0
 public Frame TryGetFrame(FrameHeader header, ID3Version version, Stream stream, out bool result)
 {
     try
     {
         result = true;
         var frame = GetFrame(header, version, stream);
         return frame;
     }
     catch (Exception)
     {
         result = false;
         return null;
     }
 }
Example #4
0
 public CommercialFrame(FrameHeader header)
     : base(header)
 {
 }
Example #5
0
 public DataFrame(FrameHeader header)
     : base(header)
 {
 }
Example #6
0
 public BinaryFrame(FrameHeader header)
     : base(header)
 {
 }
Example #7
0
 protected Frame(FrameHeader header)
 {
     Header = header;
 }
 public CommentAndLyricsFrame(FrameHeader header)
     : base(header)
 {
 }
 public TimestampTextFrame(FrameHeader header)
     : base(header)
 {
 }
Example #10
0
 public TimestampTextFrame(FrameHeader header)
     : base(header)
 {
 }
Example #11
0
 public NumericTextFrame(FrameHeader header)
     : base(header)
 {
 }
 public UserDefiniedTextFrame(FrameHeader header)
     : base(header)
 {
 }
Example #13
0
        private Frame GetFrame(string id, ID3Version version, FrameHeader header)
        {
            FrameID frameID = FrameIDFactory2.GetFrameEntry(id, version).ID;

            switch (frameID)
            {
            case FrameID.Length:
            case FrameID.EncodedBy:    //---
            case FrameID.Album:
            case FrameID.Composer:
            case FrameID.ContentType:
            case FrameID.CopyrightMessage:
            case FrameID.TextWriter:
            case FrameID.FileType:
            case FrameID.ContentGroupDescription:
            case FrameID.Title:
            case FrameID.Subtitle:
            case FrameID.InitialKey:
            case FrameID.Languages:
            case FrameID.MediaType:
            case FrameID.OriginalAlbum:
            case FrameID.OriginalFileName:
            case FrameID.OriginalTextWriter:
            case FrameID.OriginalArtist:
            case FrameID.FileOwner:
            case FrameID.LeadPerformers:     //--
            case FrameID.Band:
            case FrameID.Conductor:
            case FrameID.Interpreted:     //remixed
            case FrameID.PartOfASet:
            case FrameID.Publisher:
            case FrameID.TrackNumber:
            case FrameID.RecordingDates:
            case FrameID.InternetRadioStationName:
            case FrameID.InternetRadioStationOwner:
            case FrameID.ISRC:
            case FrameID.EncodingSettings:
            case FrameID.MusicicanCreditsList:
            case FrameID.InvolvedPeopleList:
            case FrameID.Mood:
            case FrameID.ProducedNotice:
            case FrameID.AlbumSortOrder:
            case FrameID.PerformerSortOrder:
            case FrameID.TitleSortOrder:
            case FrameID.SetSubtitle:
                return(new MultiStringTextFrame(header)); //multistringtextframe

            case FrameID.Size:                            //---
            case FrameID.BeatsPerMinute:
            case FrameID.Date:
            case FrameID.PlaylistDelay:
            case FrameID.Time:
            case FrameID.OriginalReleaseYear:
            case FrameID.Year:
                return(new NumericTextFrame(header));    //numerictextframe

            case FrameID.RecordingTime:
            case FrameID.OriginalReleaseTime:
            case FrameID.EncodingTime:
            case FrameID.ReleaseTime:
            case FrameID.TaggingTime:
                return(new TimestampTextFrame(header));    //Timestamptextframe

            case FrameID.CommercialInformationURL:
            case FrameID.CopyrightURL:
            case FrameID.OfficialAudioFileWebpage:
            case FrameID.OfficialArtistWebpage:
            case FrameID.OfficialAudioSourceWebpage:
            case FrameID.InternetRadioStationWebpage:
            case FrameID.PaymentURL:
            case FrameID.PublishersOfficialWebpage:
                return(new TextFrame(header));    //textframe

            case FrameID.PrivateFrame:
            case FrameID.UniqueFileIdentifier:
                return(new DataFrame(header));

            case FrameID.MusicCDIdentifier:
            case FrameID.RecommendedBufferSize:     //---
            case FrameID.EncryptedMetaData:
            case FrameID.AudioSeekPointIndex:
            case FrameID.MPEGLocationLookupTable:
            case FrameID.SynchronizedTempoCodes:
            case FrameID.RelativeVolumeAdjustment:
            case FrameID.RelativeVolumeAdjustmentOld:
            case FrameID.Equalization:
            case FrameID.EqualizationOld:
                return(new BinaryFrame(header));

            case FrameID.UserTextInformation:
            case FrameID.UserURLLinkFrame:
                return(new UserDefiniedTextFrame(header));

            case FrameID.AttachedPicutre:
                return(new PictureFrame(header, version));

            case FrameID.UnsynchronizedLyris:
            case FrameID.Comments:
                return(new CommentAndLyricsFrame(header));

            case FrameID.TermsOfUse:
                return(new TermsOfUseFrame(header));

            case FrameID.OwnershipFrame:
                return(new OwnershipFrame(header));

            case FrameID.CommercialFrame:
                return(new CommercialFrame(header));

            case FrameID.Popularimeter:
                return(new Popularimeter(header));
            }
            return(null);
        }
Example #14
0
        private Frame GetFrame(string id, ID3Version version, FrameHeader header)
        {
            FrameID frameID = FrameIDFactory2.GetFrameEntry(id, version).ID;
            switch (frameID)
            {
                case FrameID.Length:
                case FrameID.EncodedBy://---
                case FrameID.Album:
                case FrameID.Composer:
                case FrameID.ContentType:
                case FrameID.CopyrightMessage:
                case FrameID.TextWriter:
                case FrameID.FileType:
                case FrameID.ContentGroupDescription:
                case FrameID.Title:
                case FrameID.Subtitle:
                case FrameID.InitialKey:
                case FrameID.Languages:
                case FrameID.MediaType:
                case FrameID.OriginalAlbum:
                case FrameID.OriginalFileName:
                case FrameID.OriginalTextWriter:
                case FrameID.OriginalArtist:
                case FrameID.FileOwner:
                case FrameID.LeadPerformers: //--
                case FrameID.Band:
                case FrameID.Conductor:
                case FrameID.Interpreted: //remixed
                case FrameID.PartOfASet:
                case FrameID.Publisher:
                case FrameID.TrackNumber:
                case FrameID.RecordingDates:
                case FrameID.InternetRadioStationName:
                case FrameID.InternetRadioStationOwner:
                case FrameID.ISRC:
                case FrameID.EncodingSettings:
                case FrameID.MusicicanCreditsList:
                case FrameID.InvolvedPeopleList:
                case FrameID.Mood:
                case FrameID.ProducedNotice:
                case FrameID.AlbumSortOrder:
                case FrameID.PerformerSortOrder:
                case FrameID.TitleSortOrder:
                case FrameID.SetSubtitle:
                    return new MultiStringTextFrame(header); //multistringtextframe
                case FrameID.Size://---
                case FrameID.BeatsPerMinute:
                case FrameID.Date:
                case FrameID.PlaylistDelay:
                case FrameID.Time:
                case FrameID.OriginalReleaseYear:
                case FrameID.Year:
                    return new NumericTextFrame(header); //numerictextframe
                case FrameID.RecordingTime:
                case FrameID.OriginalReleaseTime:
                case FrameID.EncodingTime:
                case FrameID.ReleaseTime:
                case FrameID.TaggingTime:
                    return new TimestampTextFrame(header); //Timestamptextframe
                case FrameID.CommercialInformationURL:
                case FrameID.CopyrightURL:
                case FrameID.OfficialAudioFileWebpage:
                case FrameID.OfficialArtistWebpage:
                case FrameID.OfficialAudioSourceWebpage:
                case FrameID.InternetRadioStationWebpage:
                case FrameID.PaymentURL:
                case FrameID.PublishersOfficialWebpage:
                    return new TextFrame(header); //textframe
                case FrameID.PrivateFrame:
                case FrameID.UniqueFileIdentifier:
                    return new DataFrame(header);

                case FrameID.MusicCDIdentifier:
                case FrameID.RecommendedBufferSize: //---
                case FrameID.EncryptedMetaData:
                case FrameID.AudioSeekPointIndex:
                case FrameID.MPEGLocationLookupTable:
                case FrameID.SynchronizedTempoCodes:
                case FrameID.RelativeVolumeAdjustment:
                case FrameID.RelativeVolumeAdjustmentOld:
                case FrameID.Equalization:
                case FrameID.EqualizationOld:
                    return new BinaryFrame(header);

                case FrameID.UserTextInformation:
                case FrameID.UserURLLinkFrame:
                    return new UserDefiniedTextFrame(header);

                case FrameID.AttachedPicutre:
                    return new PictureFrame(header, version);

                case FrameID.UnsynchronizedLyris:
                case FrameID.Comments:
                    return new CommentAndLyricsFrame(header);

                case FrameID.TermsOfUse:
                    return new TermsOfUseFrame(header);

                case FrameID.OwnershipFrame:
                    return new OwnershipFrame(header);

                case FrameID.CommercialFrame:
                    return new CommercialFrame(header);

                case FrameID.Popularimeter:
                    return new Popularimeter(header);
            }
            return null;
        }
Example #15
0
 public Frame GetFrame(FrameHeader header, ID3Version version, Stream stream)
 {
     var frame = GetFrame(header.FrameID, version, header);
     frame.DecodeContent(ID3Utils.Read(stream, header.FrameSize));
     return frame;
 }
 public MultiStringTextFrame(FrameHeader header)
     : base(header)
 {
 }
 public CommentAndLyricsFrame(FrameHeader header)
     : base(header)
 {
 }
 public UserDefiniedTextFrame(FrameHeader header)
     : base(header)
 {
 }
Example #19
0
 public DataFrame(FrameHeader header)
     : base(header)
 {
 }
Example #20
0
 public CommercialFrame(FrameHeader header)
     : base(header)
 {
 }
 public MultiStringTextFrame(FrameHeader header)
     : base(header)
 {
 }
Example #22
0
 public BinaryFrame(FrameHeader header)
     : base(header)
 {
 }
Example #23
0
 public NumericTextFrame(FrameHeader header)
     : base(header)
 {
 }
Example #24
0
 protected Frame(FrameHeader header)
 {
     Header = header;
 }