Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

mp3info Class Reference

#include <mp3info.h>

Inheritance diagram for mp3info:

Inheritance graph
Collaboration diagram for mp3info:

Collaboration graph
List of all members.

Detailed Description

MP3info class.


Public Member Functions

 mp3info (const string &FileName)
 MP3Info constructor.

virtual ~mp3info (void)
 MP3Info destructor.

virtual void Show (void) const
 Show debug information for fileinfo.


Protected Member Functions

virtual void FirstStep (void)
 First step of the mp3info construction.

virtual streamoff Step (char *pContent, streamsize ContentSize, streamoff FileOffset)
 Loop step of the mp3info construction.

virtual void LastStep (void)
 Last step of the mp3info construction.


Private Member Functions

streamsize GetID3v2Size (void)
 Gets the id3v2 tag size.

streamoff FindFrameSync (char *pContent, streamsize ContentSize)
 Finds first valid frame synchronized.

bool IsValidFrameSync (char *pContent, streamsize ContentSize)
 Check if there is a good frame sync at Offset.

streamoff ReadFrames (char *pContent, streamsize ContentSize, streamoff FileOffset)
 Count all MP3 frames in a block of memory (and get VBR data).

int GetDuration (void)
 Gets the length of the MP3 in seconds.


Private Attributes

streamoff m_FirstFrameOffset
 Offset of the first frame.

mp3_frame_headerm_pMP3FrameHeader
 Pointer to the MP3 frame header object.

int m_Frames
 Number of frames of the MP3.

long long m_BitrateAcum
 Bit rate accumulator to get the AVG.

bool m_GotMoreFrames
 Flag to indicate that there are more frames to read.


Constructor & Destructor Documentation

mp3info::mp3info const string &  FileName  ) 
 

MP3Info constructor.

Parameters:
FileName: File to construct the file information.
Note:
A valid MP3 file is a file that gots at least 2 synchronized frames in the first "MAX_OFFSET_WITHOUT_FRAMESYNC" bytes after de id3v2 data.

Here is the call graph for this function:

mp3info::~mp3info void   )  [virtual]
 

MP3Info destructor.


Member Function Documentation

void mp3info::Show void   )  const [virtual]
 

Show debug information for fileinfo.

Reimplemented from fileinfo.

Here is the call graph for this function:

void mp3info::FirstStep void   )  [protected, virtual]
 

First step of the mp3info construction.

Reimplemented from fileinfo.

Here is the call graph for this function:

streamoff mp3info::Step char *  pContent,
streamsize  ContentSize,
streamoff  FileOffset
[protected, virtual]
 

Loop step of the mp3info construction.

Parameters:
pContent: Buffer with file data.
ContentSize: Size of the buffer.
FileOffset: Offset of the file where the buffer starts.
Returns:
Last offset.

Reimplemented from fileinfo.

Here is the call graph for this function:

void mp3info::LastStep void   )  [protected, virtual]
 

Last step of the mp3info construction.

Reimplemented from fileinfo.

Here is the call graph for this function:

streamsize mp3info::GetID3v2Size void   )  [private]
 

Gets the id3v2 tag size.

Returns:
Size of the id3v2 tag or 0 if not detected.
Note:
An ID3v2 tag can be detected with the following pattern:

$49 44 33 yy yy xx zz zz zz zz

Where yy is less than $FF, xx is the 'flags' byte and zz is less than $80.

If one of the undefined flags (00011111b = 0x1f) are set that might mean that the tag is not readable.

Here is the call graph for this function:

streamoff mp3info::FindFrameSync char *  pContent,
streamsize  ContentSize
[private]
 

Finds first valid frame synchronized.

Parameters:
pContent: Pointer to the block of memory.
ContentSize: Size of the block.
Returns:
Offset of the first valid frame sync found.

Here is the call graph for this function:

bool mp3info::IsValidFrameSync char *  pContent,
streamsize  ContentSize
[private]
 

Check if there is a good frame sync at Offset.

Parameters:
pContent: Pointer to the block of memory.
ContentSize: Size of the block.
Returns:
True if the frames are synchronized, false if not or out of content.

Here is the call graph for this function:

streamoff mp3info::ReadFrames char *  pContent,
streamsize  ContentSize,
streamoff  FileOffset
[private]
 

Count all MP3 frames in a block of memory (and get VBR data).

Parameters:
pContent: Pointer to the block of memory.
ContentSize: Size of the block.
FileOffset: Offset of the file where the buffer starts.

Here is the call graph for this function:

int mp3info::GetDuration void   )  [private]
 

Gets the length of the MP3 in seconds.

Returns:
Number of seconds.

Here is the call graph for this function:


Member Data Documentation

streamoff mp3info::m_FirstFrameOffset [private]
 

Offset of the first frame.

mp3_frame_header* mp3info::m_pMP3FrameHeader [private]
 

Pointer to the MP3 frame header object.

int mp3info::m_Frames [private]
 

Number of frames of the MP3.

long long mp3info::m_BitrateAcum [private]
 

Bit rate accumulator to get the AVG.

bool mp3info::m_GotMoreFrames [private]
 

Flag to indicate that there are more frames to read.


The documentation for this class was generated from the following files:
doxygen sourceforge id3lib