/// <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> /// 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> */ FrameFlags flag = Descriptor.GetFlags(); 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, flag, 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); }
/* * <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); }