/// <summary> /// Convert the URLLinkFrame. /// </summary> /// <param name="version">The version.</param> /// <returns>the RawFrame.</returns> public override RawFrame Convert(TagVersion version) { FrameOptions flag = Descriptor.Options; byte[] payload; using (var writer = new FrameDataWriter()) { writer.WriteString(Url, Encoding.ASCII); payload = writer.ToArray(); } return RawFrame.CreateFrame(Descriptor.Id, flag, payload, version); }
/// <summary> /// Convert the URLLinkFrame. /// </summary> /// <param name="version">The version.</param> /// <returns>the RawFrame.</returns> public override RawFrame Convert(TagVersion version) { var flag = Descriptor.GetFlags(); byte[] payload; using (var writer = new FrameDataWriter()) { writer.WriteString(URL, Encoding.ASCII); payload = writer.ToArray(); } return RawFrame.CreateFrame(Descriptor.ID, flag, payload, version); }
/// <summary> /// Convert the values to a raw frame. /// </summary> /// <returns>the raw frame.</returns> public override RawFrame Convert(TagVersion version) { FrameOptions options = Descriptor.Options; byte[] payload; using (var writer = new FrameDataWriter()) { writer.WriteString(Owner, Encoding.GetEncoding(28591), true); writer.WriteBytes(Data); payload = writer.ToArray(); } return RawFrame.CreateFrame(Descriptor.Id, options, payload, version); }
/// <summary> /// Converts a play counter frame to raw frame. /// </summary> /// <returns>the raw frame.</returns> public override RawFrame Convert(TagVersion version) { FrameOptions flag = Descriptor.Options; byte[] payload; using (var writer = new FrameDataWriter(8)) { writer.WriteUInt64(Counter); payload = writer.ToArray(); } RawFrame rawFrame = RawFrame.CreateFrame(Descriptor.Id, flag, payload, version); return rawFrame; }
/// <summary> /// Convert the values to a raw frame. /// </summary> /// <returns>the raw frame.</returns> public override RawFrame Convert(TagVersion version) { FrameOptions options = Descriptor.Options; byte[] payload; using (var writer = new FrameDataWriter()) { writer.WriteEncodingByte(TextEncoding); writer.WritePreamble(TextEncoding); writer.WriteString(Content, TextEncoding); payload = writer.ToArray(); } return RawFrame.CreateFrame(Descriptor.Id, options, payload, version); }
/// <summary> /// Convert the values to a raw frame. /// </summary> /// <returns>the raw frame.</returns> public override RawFrame Convert(TagVersion version) { FrameFlags flag = Descriptor.GetFlags(); byte[] payload; using (var writer = new FrameDataWriter()) { writer.WriteEncodingByte(TextEncoding); writer.WritePreamble(TextEncoding); writer.WriteString(Description, TextEncoding, true); writer.WriteString(URL, Encoding.GetEncoding(28591)); payload = writer.ToArray(); } return RawFrame.CreateFrame(Descriptor.ID, flag, payload, version); }
/// <summary> /// Convert the Popularimeterframe. /// </summary> /// <returns>a RawFrame.</returns> public override RawFrame Convert(TagVersion version) { FrameOptions options = Descriptor.Options; byte[] payload; using (var writer = new FrameDataWriter()) { writer.WriteString(Email, Encoding.ASCII, true); writer.WriteByte(Rating); writer.WriteUInt64(PlayCounter); payload = writer.ToArray(); } RawFrame frame = RawFrame.CreateFrame(Descriptor.Id, options, payload, version); return frame; }
/// <summary> /// Convert the values to a raw frame. /// </summary> /// <returns>the raw frame.</returns> public override RawFrame Convert(TagVersion version) { FrameFlags flags = Descriptor.GetFlags(); byte[] payload; using (var writer = new FrameDataWriter()) { writer.WriteEncodingByte(TextEncoding); writer.WriteString(Language, Encoding.ASCII, 3); writer.WritePreamble(TextEncoding); writer.WriteString(ContentDescriptor, TextEncoding, true); writer.WriteString(Text, TextEncoding); payload = writer.ToArray(); } return RawFrame.CreateFrame(Descriptor.ID, flags, payload, version); }
/// <summary> /// Converts the picture frame to a raw frame. /// </summary> /// <returns>the raw frame.</returns> public override RawFrame Convert(TagVersion version) { FrameFlags flag = Descriptor.GetFlags(); byte[] payload; using (var writer = new FrameDataWriter()) { writer.WriteEncodingByte(TextEncoding); writer.WriteString(MimeType, Encoding.ASCII, true); writer.WriteByte((byte)PictureCoding); writer.WritePreamble(TextEncoding); writer.WriteString(Description, TextEncoding, true); writer.WriteBytes(PictureData); payload = writer.ToArray(); } return RawFrame.CreateFrame("APIC", flag, payload, version); }
/// <summary> /// Convert the frame to raw frame. /// </summary> /// <returns>the raw frame</returns> public override RawFrame Convert(TagVersion version) { /* <Header for 'Unique file identifier', ID: "UFID"> Owner identifier: <text string> $00 Identifier: <up to 64 bytes binary data> */ FrameOptions options = Descriptor.Options; byte[] payload; using (var writer = new FrameDataWriter()) { writer.WriteString(Owner, Encoding.GetEncoding(28591), true); writer.WriteBytes(Identifier); payload = writer.ToArray(); } return RawFrame.CreateFrame(Descriptor.Id, options, payload, version); }
/* * <Header for 'Audio encryption', ID: "AENC"> Owner identifier <text string> $00 Preview start $xx xx Preview length $xx xx Encryption info <binary data> */ /// <summary> /// Convert the values to a raw frame. /// </summary> /// <returns>the raw frame.</returns> public override RawFrame Convert(TagVersion version) { var flag = Descriptor.GetFlags(); byte[] payload; using (var writer = new FrameDataWriter()) { writer.WriteString(Owner, Encoding.GetEncoding(28591), true); writer.WriteUInt16(PreviewStart); writer.WriteUInt16(PreviewLength); writer.WriteBytes(Encryption); payload = writer.ToArray(); } return RawFrame.CreateFrame("AENC", flag, payload, version); }