예제 #1
0
        /// <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);
        }
예제 #2
0
		/// <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);
        }
예제 #3
0
        /// <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);
        }
예제 #4
0
        /// <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;
        }
예제 #5
0
        /// <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);
		}
예제 #7
0
        /// <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;
        }
예제 #8
0
		/// <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);
		}
예제 #9
0
		/// <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);
        }
예제 #11
0
        /*
         * <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);
        }