![]() |
Miam-Player
0.8.0
A nice music player
|
An implementation of MP3 frame headers. More...
#include <mpegheader.h>
Public Types | |
enum | Version { Version1 = 0, Version2 = 1, Version2_5 = 2 } |
The MPEG Version. More... | |
enum | ChannelMode { Stereo = 0, JointStereo = 1, DualChannel = 2, SingleChannel = 3 } |
There are a few combinations or one or two channel audio that are possible: More... | |
Public Member Functions | |
Header (const ByteVector &data) | |
Parses an MPEG header based on data. More... | |
Header (File *file, long offset, bool checkLength=true) | |
Parses an MPEG header based on file and offset. More... | |
Header (const Header &h) | |
Does a shallow copy of h. More... | |
virtual | ~Header () |
Destroys this Header instance. More... | |
bool | isValid () const |
Returns true if the frame is at least an appropriate size and has legal values. More... | |
Version | version () const |
Returns the MPEG Version of the header. More... | |
int | layer () const |
Returns the layer version. More... | |
bool | protectionEnabled () const |
Returns true if the MPEG protection bit is enabled. More... | |
int | bitrate () const |
Returns the bitrate encoded in the header. More... | |
int | sampleRate () const |
Returns the sample rate in Hz. More... | |
bool | isPadded () const |
Returns true if the frame is padded. More... | |
ChannelMode | channelMode () const |
Returns the channel mode for this frame. More... | |
bool | isCopyrighted () const |
Returns true if the copyrighted bit is set. More... | |
bool | isOriginal () const |
Returns true if the "original" bit is set. More... | |
int | frameLength () const |
Returns the frame length in bytes. More... | |
int | samplesPerFrame () const |
Returns the number of frames per sample. More... | |
Header & | operator= (const Header &h) |
Makes a shallow copy of the header. More... | |
An implementation of MP3 frame headers.
This is an implementation of MPEG Layer III headers. The API follows more or less the binary format of these headers. I've used this document as a reference.
TagLib::MPEG::Header::Header | ( | const ByteVector & | data | ) |
Parses an MPEG header based on data.
TagLib::MPEG::Header::Header | ( | File * | file, |
long | offset, | ||
bool | checkLength = true |
||
) |
TagLib::MPEG::Header::Header | ( | const Header & | h | ) |
Does a shallow copy of h.
|
virtual |
Destroys this Header instance.
int TagLib::MPEG::Header::bitrate | ( | ) | const |
Returns the bitrate encoded in the header.
ChannelMode TagLib::MPEG::Header::channelMode | ( | ) | const |
Returns the channel mode for this frame.
int TagLib::MPEG::Header::frameLength | ( | ) | const |
Returns the frame length in bytes.
bool TagLib::MPEG::Header::isCopyrighted | ( | ) | const |
Returns true if the copyrighted bit is set.
bool TagLib::MPEG::Header::isOriginal | ( | ) | const |
Returns true if the "original" bit is set.
bool TagLib::MPEG::Header::isPadded | ( | ) | const |
Returns true if the frame is padded.
bool TagLib::MPEG::Header::isValid | ( | ) | const |
Returns true if the frame is at least an appropriate size and has legal values.
int TagLib::MPEG::Header::layer | ( | ) | const |
Returns the layer version.
This will be between the values 1-3.
bool TagLib::MPEG::Header::protectionEnabled | ( | ) | const |
Returns true if the MPEG protection bit is enabled.
int TagLib::MPEG::Header::sampleRate | ( | ) | const |
Returns the sample rate in Hz.
int TagLib::MPEG::Header::samplesPerFrame | ( | ) | const |
Returns the number of frames per sample.