An implementation of the Xing/VBRI headers. More...

#include <xingheader.h>

Public Types

enum  HeaderType { Invalid = 0, Xing = 1, VBRI = 2 }

Public Member Functions

 XingHeader (const ByteVector &data)
virtual ~XingHeader ()
bool isValid () const
unsigned int totalFrames () const
unsigned int totalSize () const
HeaderType type () const

Static Public Member Functions

static int xingHeaderOffset (TagLib::MPEG::Header::Version v, TagLib::MPEG::Header::ChannelMode c)

Detailed Description

An implementation of the Xing/VBRI headers.

This is a minimalistic implementation of the Xing/VBRI VBR headers. Xing/VBRI headers are often added to VBR (variable bit rate) MP3 streams to make it easy to compute the length and quality of a VBR stream. Our implementation is only concerned with the total size of the stream (so that we can calculate the total playing time and the average bitrate). It uses this text and the XMMS sources as references.

Member Enumeration Documentation

The type of the VBR header.


Invalid header or no VBR header found.


Xing header.


VBRI header.

Constructor & Destructor Documentation

TagLib::MPEG::XingHeader::XingHeader ( const ByteVector data)

Parses an Xing/VBRI header based on data which contains the entire first MPEG frame.

virtual TagLib::MPEG::XingHeader::~XingHeader ( )

Destroy this XingHeader instance.

Member Function Documentation

bool TagLib::MPEG::XingHeader::isValid ( ) const

Returns true if the data was parsed properly and if there is a valid Xing/VBRI header present.

unsigned int TagLib::MPEG::XingHeader::totalFrames ( ) const

Returns the total number of frames.

unsigned int TagLib::MPEG::XingHeader::totalSize ( ) const

Returns the total size of stream in bytes.

HeaderType TagLib::MPEG::XingHeader::type ( ) const

Returns the type of the VBR header.

static int TagLib::MPEG::XingHeader::xingHeaderOffset ( TagLib::MPEG::Header::Version  v,
TagLib::MPEG::Header::ChannelMode  c 

Returns the offset for the start of this Xing header, given the version and channels of the frame

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