Miam-Player  0.8.0
A nice music player
TagLib::ID3v2::Header Class Reference

An implementation of ID3v2 headers. More...

#include <id3v2header.h>

Inheritance diagram for TagLib::ID3v2::Header:
TagLib::ID3v2::Frame TagLib::ID3v2::AttachedPictureFrame TagLib::ID3v2::ChapterFrame TagLib::ID3v2::CommentsFrame TagLib::ID3v2::EventTimingCodesFrame TagLib::ID3v2::GeneralEncapsulatedObjectFrame TagLib::ID3v2::OwnershipFrame TagLib::ID3v2::PodcastFrame TagLib::ID3v2::PopularimeterFrame TagLib::ID3v2::PrivateFrame TagLib::ID3v2::RelativeVolumeFrame TagLib::ID3v2::SynchronizedLyricsFrame TagLib::ID3v2::TableOfContentsFrame TagLib::ID3v2::TextIdentificationFrame TagLib::ID3v2::UniqueFileIdentifierFrame TagLib::ID3v2::UnknownFrame TagLib::ID3v2::UnsynchronizedLyricsFrame TagLib::ID3v2::UrlLinkFrame

Public Member Functions

 Header ()
 Constructs an empty ID3v2 header. More...
 
 Header (const ByteVector &data)
 Constructs an ID3v2 header based on data. More...
 
virtual ~Header ()
 Destroys the header. More...
 
unsigned int majorVersion () const
 Returns the major version number. More...
 
void setMajorVersion (unsigned int version)
 Set the the major version number to version. More...
 
unsigned int revisionNumber () const
 Returns the revision number. More...
 
bool unsynchronisation () const
 Returns true if unsynchronisation has been applied to all frames. More...
 
bool extendedHeader () const
 Returns true if an extended header is present in the tag. More...
 
bool experimentalIndicator () const
 Returns true if the experimental indicator flag is set. More...
 
bool footerPresent () const
 Returns true if a footer is present in the tag. More...
 
unsigned int tagSize () const
 Returns the tag size in bytes. More...
 
unsigned int completeTagSize () const
 Returns the tag size, including the header and, if present, the footer size. More...
 
void setTagSize (unsigned int s)
 Set the tag size to s. More...
 
void setData (const ByteVector &data)
 Sets the data that will be used as the header. More...
 
ByteVector render () const
 Renders the Header back to binary format. More...
 

Static Public Member Functions

static unsigned int size ()
 Returns the size of the header. More...
 
static ByteVector fileIdentifier ()
 Returns the string used to identify and ID3v2 tag inside of a file. More...
 

Protected Member Functions

void parse (const ByteVector &data)
 Called by setData() to parse the header data. More...
 

Detailed Description

An implementation of ID3v2 headers.

This class implements ID3v2 headers. It attempts to follow, both semantically and programmatically, the structure specified in the ID3v2 standard. The API is based on the properties of ID3v2 headers specified there. If any of the terms used in this documentation are unclear please check the specification in the linked section. (Structure, 3.1)

Constructor & Destructor Documentation

◆ Header() [1/2]

TagLib::ID3v2::Header::Header ( )

Constructs an empty ID3v2 header.

◆ Header() [2/2]

TagLib::ID3v2::Header::Header ( const ByteVector data)

Constructs an ID3v2 header based on data.

parse() is called immediately.

◆ ~Header()

virtual TagLib::ID3v2::Header::~Header ( )
virtual

Destroys the header.

Reimplemented in TagLib::ID3v2::Frame.

Member Function Documentation

◆ completeTagSize()

unsigned int TagLib::ID3v2::Header::completeTagSize ( ) const

Returns the tag size, including the header and, if present, the footer size.

See also
tagSize()

◆ experimentalIndicator()

bool TagLib::ID3v2::Header::experimentalIndicator ( ) const

Returns true if the experimental indicator flag is set.

◆ extendedHeader()

bool TagLib::ID3v2::Header::extendedHeader ( ) const

Returns true if an extended header is present in the tag.

◆ fileIdentifier()

static ByteVector TagLib::ID3v2::Header::fileIdentifier ( )
static

Returns the string used to identify and ID3v2 tag inside of a file.

Presently this is always "ID3".

◆ footerPresent()

bool TagLib::ID3v2::Header::footerPresent ( ) const

Returns true if a footer is present in the tag.

◆ majorVersion()

unsigned int TagLib::ID3v2::Header::majorVersion ( ) const

Returns the major version number.

(Note: This is the 4, not the 2 in ID3v2.4.0. The 2 is implied.)

◆ parse()

void TagLib::ID3v2::Header::parse ( const ByteVector data)
protected

Called by setData() to parse the header data.

It makes this information available through the public API.

◆ render()

ByteVector TagLib::ID3v2::Header::render ( ) const

Renders the Header back to binary format.

◆ revisionNumber()

unsigned int TagLib::ID3v2::Header::revisionNumber ( ) const

Returns the revision number.

(Note: This is the 0, not the 4 in ID3v2.4.0. The 2 is implied.)

◆ setData()

void TagLib::ID3v2::Header::setData ( const ByteVector data)

Sets the data that will be used as the header.

10 bytes, starting from the beginning of data are used.

◆ setMajorVersion()

void TagLib::ID3v2::Header::setMajorVersion ( unsigned int  version)

Set the the major version number to version.

(Note: This is the 4, not the 2 in ID3v2.4.0. The 2 is implied.)

See also
majorVersion()
Note
This is used by the internal parser; this will not change the version which is written and in general should not be called by API users.

◆ setTagSize()

void TagLib::ID3v2::Header::setTagSize ( unsigned int  s)

Set the tag size to s.

See also
tagSize()

◆ size()

static unsigned int TagLib::ID3v2::Header::size ( )
static

Returns the size of the header.

Presently this is always 10 bytes.

◆ tagSize()

unsigned int TagLib::ID3v2::Header::tagSize ( ) const

Returns the tag size in bytes.

This is the size of the frame content. The size of the entire tag will be this plus the header size (10 bytes) and, if present, the footer size (potentially another 10 bytes).

Note
This is the value as read from the header to which TagLib attempts to provide an API to; it was not a design decision on the part of TagLib to not include the mentioned portions of the tag in the size.
See also
completeTagSize()

◆ unsynchronisation()

bool TagLib::ID3v2::Header::unsynchronisation ( ) const

Returns true if unsynchronisation has been applied to all frames.


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