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

TagLib::Id3v2::MusicCdIdentifierFrame Class Reference

Inheritance diagram for TagLib::Id3v2::MusicCdIdentifierFrame:

List of all members.


Detailed Description

This class extends Frame, implementing support for ID3v2 Music CD Identifier (MCDI) Frames.

Music CD Identifier Frames should contain the table of contents data as stored on the physical CD. It is primarily used for track information lookup by through web sources like CDDB.

Reading the music CD identifier from a tag.

          using TagLib;
          using TagLib.Id3v2;

          public static class LookupUtil
          {
            public static ByteVector GetCdIdentifier (string filename)
            {
                  File file = File.Create (filename, ReadStyle.None);
                  Id3v2.Tag tag = file.GetTag (TagTypes.Id3v2, false) as Id3v2.Tag;
                  if (tag == null)
                        return new ByteVector ();

                  MusicCdIdentifierFrame frame = MusicCdIdentifierFrame.Get (tag, false);
                  if (frame == null)
                        return new ByteVector ();

                  return frame.Data;
            }
          }
          #using <System.dll>
          #using <taglib-sharp.dll>

          using System;
          using TagLib;
          using TagLib::Id3v2;

          public ref class LookupUtil abstract sealed
          {
          public:
            static ByteVector^ GetCdIdentifier (String^ filename)
            {
                  File^ file = File::Create (filename, ReadStyle::None);
                  Id3v2::Tag^ tag = dynamic_cast<Id3v2::Tag^> (file.GetTag (TagTypes::Id3v2, false));
                  if (tag == null)
                        return gcnew ByteVector;

                  MusicCdIdentifierFrame^ frame = MusicCdIdentifierFrame::Get (tag, false);
                  if (frame == null)
                        return gcnew ByteVector;

                  return frame->Data;
            }
          }
          Imports TagLib
          Imports TagLib.Id3v2

          Public Shared Class LookupUtil
            Public Shared Sub GetCdIdentifier (filename As String) As TagLib.ByteVector
                  Dim file As File = File.Create (filename, ReadStyle.None)
                  Dim tag As Id3v2.Tag = file.GetTag (TagTypes.Id3v2, False)
                  If tag Is Nothing Return New ByteVector ()

                  Dim frame As MusicCdIdentifierFrame = MusicCdIdentifierFrame.Get (tag, False)
                  If frame Is Nothing Return New ByteVector ()

                  Return frame.Data
            End Sub
          End Class
          import TagLib
          import TagLib.Id3v2

          public static class LookupUtil:
            static def GetCdIdentifier (filename as string) as TagLib.ByteVector:
                  file as File = File.Create (filename, ReadStyle.None)
                  tag as Id3v2.Tag = file.GetTag (TagTypes.Id3v2, false)
                  if tag == null:
                        return ByteVector ()

                  frame as MusicCdIdentifierFrame = MusicCdIdentifierFrame.Get (tag, false)
                  if frame == null:
                        return ByteVector ()

                  return frame.Data

Definition at line 126 of file MusicCdIdentifierFrame.cs.


Public Member Functions

 MusicCdIdentifierFrame (ByteVector data, byte version)
 Constructs and initializes a new instance of MusicCdIdentifierFrame by reading its raw data in a specified ID3v2 version.
 MusicCdIdentifierFrame ()
 Constructs and initializes a new instance of MusicCdIdentifierFrame with empty identifier data.
virtual ByteVector Render (byte version)

Static Public Member Functions

static MusicCdIdentifierFrame Get (Tag tag, bool create)
 Gets a music CD identifier frame from a specified tag, optionally creating it if it does not exist.
static ByteVector TextDelimiter (StringType type)

Protected Member Functions

ByteVector FieldData (ByteVector frameData, int offset, byte version)
internal MusicCdIdentifierFrame (ByteVector data, int offset, FrameHeader header, byte version)
 Constructs and initializes a new instance of MusicCdIdentifierFrame by reading its raw data in a specified ID3v2 version.
override void ParseFields (ByteVector data, byte version)
 Populates the values in the current instance by parsing its field data in a specified version.
override ByteVector RenderFields (byte version)
 Renders the values in the current instance into field data for a specified version.
void SetData (ByteVector data, int offset, byte version, bool readHeader)

Static Protected Member Functions

static StringType CorrectEncoding (StringType type, byte version)

Properties

ByteVector Data [get, set]
 Gets and sets the identifier data stored in the current instance.
short EncryptionId [get, set]
FrameFlags Flags [get, set]
ReadOnlyByteVector FrameId [get]
short GroupId [get, set]
uint Size [get]

Private Attributes

ByteVector field_data = null
 Contains the identifer data for the current instance.

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index