예제 #1
0
		/*
           <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.Length == 0)
			{
				throw new ID3TagException("Frame has no payload.");
			}

			using (var reader = new FrameDataReader(rawFrame.Payload))
			{
				var encodingByte = reader.ReadByte();
				MimeType = reader.ReadVariableString(Encoding.ASCII);
				PictureCoding = (PictureType)reader.ReadByte();
				TextEncoding = reader.ReadEncoding(encodingByte, codePage);
				Description = reader.ReadVariableString(TextEncoding);
				PictureData = reader.ReadBytes();
			}
		}
예제 #2
0
		/// <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();
				Encryption = reader.ReadBytes();
			}
        }
예제 #3
0
        /// <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 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);

			using (var reader = new FrameDataReader(rawFrame.Payload))
			{
				Owner = reader.ReadVariableString(Encoding.GetEncoding(28591));
				Identifier = reader.ReadBytes();
			}
		}