Miam-Player  0.8.0
A nice music player
TagLib::Ogg::PageHeader Class Reference

An implementation of the page headers associated with each Ogg::Page. More...

#include <oggpageheader.h>

Public Member Functions

 PageHeader (File *file=0, long pageOffset=-1)
 Reads a PageHeader from file starting at pageOffset. More...
 
virtual ~PageHeader ()
 Deletes this instance of the PageHeader. More...
 
bool isValid () const
 Returns true if the header parsed properly and is valid. More...
 
List< int > packetSizes () const
 Ogg pages contain a list of packets (which are used by the contained codecs). More...
 
void setPacketSizes (const List< int > &sizes)
 Sets the sizes of the packets in this page to sizes. More...
 
bool firstPacketContinued () const
 Some packets can be continued across multiple pages. More...
 
void setFirstPacketContinued (bool continued)
 Sets the internal flag indicating if the first packet in this page is continued to continued. More...
 
bool lastPacketCompleted () const
 Returns true if the last packet of this page is completely contained in this page. More...
 
void setLastPacketCompleted (bool completed)
 Sets the internal flag indicating if the last packet in this page is complete to completed. More...
 
bool firstPageOfStream () const
 This returns true if this is the first page of the Ogg (logical) stream. More...
 
void setFirstPageOfStream (bool first)
 Marks this page as the first page of the Ogg stream. More...
 
bool lastPageOfStream () const
 This returns true if this is the last page of the Ogg (logical) stream. More...
 
void setLastPageOfStream (bool last)
 Marks this page as the last page of the Ogg stream. More...
 
long long absoluteGranularPosition () const
 A special value of containing the position of the packet to be interpreted by the codec. More...
 
void setAbsoluteGranularPosition (long long agp)
 A special value of containing the position of the packet to be interpreted by the codec. More...
 
unsigned int streamSerialNumber () const
 Every Ogg logical stream is given a random serial number which is common to every page in that logical stream. More...
 
void setStreamSerialNumber (unsigned int n)
 Every Ogg logical stream is given a random serial number which is common to every page in that logical stream. More...
 
int pageSequenceNumber () const
 Returns the index of the page within the Ogg stream. More...
 
void setPageSequenceNumber (int sequenceNumber)
 Sets the page's position in the stream to sequenceNumber. More...
 
int size () const
 Returns the complete header size. More...
 
int dataSize () const
 Returns the size of the data portion of the page – i.e. More...
 
ByteVector render () const
 Render the page header to binary data. More...
 

Detailed Description

An implementation of the page headers associated with each Ogg::Page.

This class implements Ogg page headers which contain the information about Ogg pages needed to break them into packets which can be passed on to the codecs.

Constructor & Destructor Documentation

TagLib::Ogg::PageHeader::PageHeader ( File file = 0,
long  pageOffset = -1 
)

Reads a PageHeader from file starting at pageOffset.

The defaults create a page with no (and as such, invalid) data that must be set later.

virtual TagLib::Ogg::PageHeader::~PageHeader ( )
virtual

Deletes this instance of the PageHeader.

Member Function Documentation

long long TagLib::Ogg::PageHeader::absoluteGranularPosition ( ) const

A special value of containing the position of the packet to be interpreted by the codec.

In the case of Vorbis this contains the PCM value and is used to calculate the length of the stream.

See also
setAbsoluteGranularPosition()
int TagLib::Ogg::PageHeader::dataSize ( ) const

Returns the size of the data portion of the page – i.e.

the size of the page less the header size.

bool TagLib::Ogg::PageHeader::firstPacketContinued ( ) const

Some packets can be continued across multiple pages.

If the first packet in the current page is a continuation this will return true. If this is page starts with a new packet this will return false.

See also
lastPacketCompleted()
setFirstPacketContinued()
bool TagLib::Ogg::PageHeader::firstPageOfStream ( ) const

This returns true if this is the first page of the Ogg (logical) stream.

See also
setFirstPageOfStream()
bool TagLib::Ogg::PageHeader::isValid ( ) const

Returns true if the header parsed properly and is valid.

bool TagLib::Ogg::PageHeader::lastPacketCompleted ( ) const

Returns true if the last packet of this page is completely contained in this page.

See also
firstPacketContinued()
setLastPacketCompleted()
bool TagLib::Ogg::PageHeader::lastPageOfStream ( ) const

This returns true if this is the last page of the Ogg (logical) stream.

See also
setLastPageOfStream()
List<int> TagLib::Ogg::PageHeader::packetSizes ( ) const

Ogg pages contain a list of packets (which are used by the contained codecs).

The sizes of these pages is encoded in the page header. This returns a list of the packet sizes in bytes.

See also
setPacketSizes()
int TagLib::Ogg::PageHeader::pageSequenceNumber ( ) const

Returns the index of the page within the Ogg stream.

This helps make it possible to determine if pages have been lost.

See also
setPageSequenceNumber()
ByteVector TagLib::Ogg::PageHeader::render ( ) const

Render the page header to binary data.

Note
The checksum – bytes 22 - 25 – will be left empty and must be filled in when rendering the entire page.
void TagLib::Ogg::PageHeader::setAbsoluteGranularPosition ( long long  agp)

A special value of containing the position of the packet to be interpreted by the codec.

It is only supported here so that it may be coppied from one page to another.

See also
absoluteGranularPosition()
void TagLib::Ogg::PageHeader::setFirstPacketContinued ( bool  continued)

Sets the internal flag indicating if the first packet in this page is continued to continued.

See also
firstPacketContinued()
void TagLib::Ogg::PageHeader::setFirstPageOfStream ( bool  first)

Marks this page as the first page of the Ogg stream.

See also
firstPageOfStream()
void TagLib::Ogg::PageHeader::setLastPacketCompleted ( bool  completed)

Sets the internal flag indicating if the last packet in this page is complete to completed.

See also
lastPacketCompleted()
void TagLib::Ogg::PageHeader::setLastPageOfStream ( bool  last)

Marks this page as the last page of the Ogg stream.

See also
lastPageOfStream()
void TagLib::Ogg::PageHeader::setPacketSizes ( const List< int > &  sizes)

Sets the sizes of the packets in this page to sizes.

Internally this updates the lacing values in the header.

See also
packetSizes()
void TagLib::Ogg::PageHeader::setPageSequenceNumber ( int  sequenceNumber)

Sets the page's position in the stream to sequenceNumber.

See also
pageSequenceNumber()
void TagLib::Ogg::PageHeader::setStreamSerialNumber ( unsigned int  n)

Every Ogg logical stream is given a random serial number which is common to every page in that logical stream.

This sets this pages serial number. This method should be used when adding new pages to a logical stream.

See also
streamSerialNumber()
int TagLib::Ogg::PageHeader::size ( ) const

Returns the complete header size.

unsigned int TagLib::Ogg::PageHeader::streamSerialNumber ( ) const

Every Ogg logical stream is given a random serial number which is common to every page in that logical stream.

This returns the serial number of the stream associated with this packet.

See also
setStreamSerialNumber()

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