Logo Search packages:      
Sourcecode: taglib-sharp version File versions

override ByteVector TagLib::Id3v2::AttachedPictureFrame::RenderFields ( byte  version  )  [inline, protected]

Renders the values in the current instance into field data for a specified version.

Parameters:
version A byte indicating the ID3v2 version the field data is to be encoded in.
Returns:
A ByteVector object containing the rendered field data.

Definition at line 636 of file AttachedPictureFrame.cs.

            {
                  if (raw_data != null && raw_version == version)
                        return raw_data;
                  
                  StringType encoding = CorrectEncoding (TextEncoding,
                        version);
                  ByteVector data = new ByteVector ();
                  
                  data.Add ((byte) encoding);
                  
                  if (version == 2) {
                        switch (MimeType) {
                        case "image/png":
                              data.Add ("PNG");
                              break;
                        case "image/jpeg":
                              data.Add ("JPG");
                              break;
                        default:
                              data.Add ("XXX");
                              break;
                        }
                  } else {
                        data.Add (ByteVector.FromString (MimeType,
                              StringType.Latin1));
                        data.Add (ByteVector.TextDelimiter (
                              StringType.Latin1));
                  }
                  
                  data.Add ((byte) type);
                  data.Add (ByteVector.FromString (Description, encoding));
                  data.Add (ByteVector.TextDelimiter (encoding));
                  data.Add (this.data);
                  
                  return data;
            }


Generated by  Doxygen 1.6.0   Back to index