/// <summary> /// Import the raw frame data. /// </summary> /// <param name="rawFrame">the raw frame.</param> /// <param name="codePage">Not used</param> public override void Import(RawFrame rawFrame, int codePage) { ImportRawFrameHeader(rawFrame); using (var reader = new FrameDataReader(rawFrame.Payload)) { Url = reader.ReadVariableString(Encoding.ASCII); } }
/// <summary> /// Converts a raw frame to PlayCounter frame. /// </summary> /// <param name="rawFrame">the raw frame.</param> /// <param name="codePage">Default code page for Ansi encoding. Pass 0 to use default system encoding code page.</param> /// s public override void Import(RawFrame rawFrame, int codePage) { /* ID = "PCNT" Counter $xx xx xx xx (xx ...) */ ImportRawFrameHeader(rawFrame); using (var reader = new FrameDataReader(rawFrame.Payload)) { Counter = reader.ReadUInt64(); } }
/// <summary> /// Import the header flags from a raw frame. /// </summary> /// <param name="rawFrame">The raw frame.</param> protected void ImportRawFrameHeader(RawFrame rawFrame) { Descriptor.Id = rawFrame.Id; Descriptor.TagAlterPreservation = rawFrame.Options.TagAlterPreservation; Descriptor.FileAlterPreservation = rawFrame.Options.FileAlterPreservation; Descriptor.ReadOnly = rawFrame.Options.ReadOnly; Descriptor.Compression = rawFrame.Options.Compression; Descriptor.Encryption = rawFrame.Options.Encryption; Descriptor.GroupingIdentify = rawFrame.Options.GroupingIdentify; // // ID3v2.4 only // Descriptor.Unsynchronisation = rawFrame.Options.Unsynchronisation; Descriptor.DataLengthIndicator = rawFrame.Options.DataLengthIndicator; }
/// <summary> /// Import the raw frame. /// </summary> /// <param name="rawFrame">the raw frame.</param> /// <param name="codePage">Default code page for Ansi encoding. Pass 0 to use default system encoding code page.</param> public override void Import(RawFrame rawFrame, int codePage) { ImportRawFrameHeader(rawFrame); // // XX - Encoding Byte // Y1 Y2 ... Yn - Text // using (var reader = new FrameDataReader(rawFrame.Payload)) { byte encodingByte = reader.ReadByte(); TextEncoding = reader.ReadEncoding(encodingByte, codePage); Content = reader.ReadVariableString(TextEncoding).TrimEnd(Char.MinValue); } }
/// <summary> /// Import the raw frame. /// </summary> /// <param name="rawFrame">the raw frame.</param> /// <param name="codePage">Default code page for Ansi encoding. Pass 0 to use default system encoding code page.</param> public override void Import(RawFrame rawFrame, int codePage) { ImportRawFrameHeader(rawFrame); /* <Header for 'User defined text information frame', ID: "TXXX"> Text encoding : $xx Description : <text string according to encoding> $00 (00) Value : <text string according to encoding> */ using (var reader = new FrameDataReader(rawFrame.Payload)) { byte encodingByte = reader.ReadByte(); TextEncoding = reader.ReadEncoding(encodingByte, codePage); Description = reader.ReadVariableString(TextEncoding); Value = reader.ReadVariableString(TextEncoding); } }
private static IFrame AnalyseFrameId(RawFrame rawFrame, IFrameCreationService frameService) { string id = rawFrame.Id; IFrame frame = null; if (frameService.Search(id)) { // // Get the specific frame instance // frame = frameService.GetFrameInstance(id); } else { if (id[0] == 'T' && id[1] != 'X') { // // Handle Textfames // frame = frameService.GetTextFrame(); } if (id[0] == 'W' && id[1] != 'X') { // // Handle Web Frames // frame = frameService.GetUrlLinkFrame(); } } if (frame == null) { // // If all is failed then create an Unknown frame instance // frame = new UnknownFrame(); } return frame; }
/// <summary> /// Import the raw frame. /// </summary> /// <param name="rawFrame">the raw frame.</param> /// <param name="codePage">Default code page for Ansi encoding. Pass 0 to use default system encoding code page.</param> public override void Import(RawFrame rawFrame, int codePage) { ImportRawFrameHeader(rawFrame); // // <text> 00 <data> // using (var reader = new FrameDataReader(rawFrame.Payload)) { Owner = reader.ReadVariableString(Encoding.GetEncoding(28591)); SetData(reader.ReadBytes()); } }
/// <summary> /// Import the raw content to a high level frame. /// </summary> /// <param name="rawFrame">the raw frame.</param> /// <param name="codePage">Default code page for Ansi encoding. Pass 0 to use default system encoding code page.</param> public abstract void Import(RawFrame rawFrame, int codePage);
/// <summary> /// Import the raw frame. /// </summary> /// <param name="rawFrame">the raw frame.</param> /// <param name="codePage">Default code page for Ansi encoding. Pass 0 to use default system encoding code page.</param> public override void Import(RawFrame rawFrame, int codePage) { ImportRawFrameHeader(rawFrame); /* ID = "COMM" TextEncoding xx Language xx xx xx Short Content (xx xx ... xx) (00 / 00 00) Text (xx xx ... xx) */ using (var reader = new FrameDataReader(rawFrame.Payload)) { byte encodingByte = reader.ReadByte(); Language = reader.ReadFixedString(Encoding.ASCII, 3); TextEncoding = reader.ReadEncoding(encodingByte, codePage); ContentDescriptor = reader.ReadVariableString(TextEncoding); Text = reader.ReadVariableString(TextEncoding); } }
/// <summary> /// Import the raw frame. /// </summary> /// <param name="rawFrame">the raw frame.</param> /// <param name="codePage">Default code page for Ansi encoding. Pass 0 to use default system encoding code page.</param> public override void Import(RawFrame rawFrame, int codePage) { ImportRawFrameHeader(rawFrame); /* * Text Encoding xx * Description (xx xx .. xx) (00 / 00 00) * URL (xx xx ... xx) als ISO8859-1 ! */ using (var reader = new FrameDataReader(rawFrame.Payload)) { byte encodingByte = reader.ReadByte(); TextEncoding = reader.ReadEncoding(encodingByte, codePage); Description = reader.ReadVariableString(TextEncoding); Url = reader.ReadVariableString(Encoding.GetEncoding(28591)); } }
/// <summary> /// Import the raw content to a high level frame. /// </summary> /// <param name="rawFrame">the raw frame.</param> /// <param name="codePage">Default code page for Ansi encoding. Pass 0 to use default system encoding code page.</param> public override void Import(RawFrame rawFrame, int codePage) { /* * ID = "POPM" * Email to user <text string> $00 * Rating $xx * Counter $xx xx xx xx (xx ...) */ ImportRawFrameHeader(rawFrame); using (var reader = new FrameDataReader(rawFrame.Payload)) { Email = reader.ReadVariableString(Encoding.ASCII); Rating = reader.ReadByte(); PlayCounter = reader.ReadUInt64(); } }
/// <summary> /// Imports values from the <see cref="RawFrame"/>. /// </summary> /// <param name="rawFrame">the raw frame.</param> /// <param name="codePage">Default code page for Ansi encoding. Pass 0 to use default system encoding code page.</param> public override void Import(RawFrame rawFrame, int codePage) { ImportRawFrameHeader(rawFrame); using (var reader = new FrameDataReader(rawFrame.Payload)) { byte encodingByte = reader.ReadByte(); Language = reader.ReadFixedString(Encoding.ASCII, 3); TextEncoding = reader.ReadEncoding(encodingByte, codePage); ContentDescriptor = reader.ReadVariableString(TextEncoding); Lyrics = reader.ReadVariableString(TextEncoding); } }
/// <summary> /// Import the raw frame. /// </summary> /// <param name="rawFrame">the raw frame.</param> /// <param name="codePage">Default code page for Ansi encoding. Pass 0 to use default system encoding code page.</param> public override void Import(RawFrame rawFrame, int codePage) { ImportRawFrameHeader(rawFrame); Toc = rawFrame.Payload; }
/// <summary> /// Import the raw frame. /// </summary> /// <param name="rawFrame">the raw frame.</param> /// <param name="codePage">Default code page for Ansi encoding. Pass 0 to use default system encoding code page.</param> public override void Import(RawFrame rawFrame, int codePage) { ImportRawFrameHeader(rawFrame); using (var reader = new FrameDataReader(rawFrame.Payload)) { Owner = reader.ReadVariableString(Encoding.GetEncoding(28591)); PreviewStart = reader.ReadUInt16(); PreviewLength = reader.ReadUInt16(); SetEncryption(reader.ReadBytes()); } }
/* <Header for 'Attached picture', ID: "APIC"> Text encoding $xx MIME type <text string> $00 Picture type $xx Description <text string according to encoding> $00 (00) Picture data <binary data> */ /// <summary> /// Import a raw frame /// </summary> /// <param name="rawFrame">the raw frame</param> /// <param name="codePage">Default code page for Ansi encoding. Pass 0 to use default system encoding code page.</param> public override void Import(RawFrame rawFrame, int codePage) { ImportRawFrameHeader(rawFrame); if (rawFrame.Payload.Count == 0) { throw new Id3TagException("Frame has no payload."); } using (var reader = new FrameDataReader(rawFrame.Payload)) { byte encodingByte = reader.ReadByte(); MimeType = reader.ReadVariableString(Encoding.ASCII); PictureCoding = (PictureType) reader.ReadByte(); TextEncoding = reader.ReadEncoding(encodingByte, codePage); Description = reader.ReadVariableString(TextEncoding); SetPictureData(reader.ReadBytes()); } }