00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef _MP3_HEADER_H_
00029 #define _MP3_HEADER_H_
00030
00031 #include "io_decorators.h"
00032
00033 class Mp3Info
00034 {
00035 public:
00036 Mp3Info() { _mp3_header_output = new Mp3_Headerinfo; };
00037 ~Mp3Info() { this->Clean(); };
00038 void Clean();
00039
00040 const Mp3_Headerinfo* GetMp3HeaderInfo() const { return _mp3_header_output; };
00041 bool Parse(ID3_Reader&, size_t mp3size);
00042
00043 Mpeg_Layers Layer() const { return _mp3_header_output->layer; };
00044 Mpeg_Version Version() const { return _mp3_header_output->version; };
00045 MP3_BitRates Bitrate() const { return _mp3_header_output->bitrate; };
00046 Mp3_ChannelMode ChannelMode() const { return _mp3_header_output->channelmode; };
00047 Mp3_ModeExt ModeExt() const { return _mp3_header_output->modeext; };
00048 Mp3_Emphasis Emphasis() const { return _mp3_header_output->emphasis; };
00049 Mp3_Crc Crc() const { return _mp3_header_output->crc; };
00050 uint32 VbrBitrate() const { return _mp3_header_output->vbr_bitrate; };
00051 uint32 Frequency() const { return _mp3_header_output->frequency; };
00052 uint32 Framesize() const { return _mp3_header_output->framesize; };
00053 uint32 Frames() const { return _mp3_header_output->frames; };
00054 bool Private() const { return _mp3_header_output->privatebit; };
00055 bool Copyrighted() const { return _mp3_header_output->copyrighted; };
00056 bool Original() const { return _mp3_header_output->original; };
00057 uint32 Seconds() const { return _mp3_header_output->time; };
00058
00059 private:
00060
00061 struct _mp3_header_internal
00062 {
00063
00064 unsigned char frame_sync_a : 8;
00065
00066 unsigned char protection_bit : 1;
00067 unsigned char layer : 2;
00068 unsigned char id : 2;
00069 unsigned char frame_sync_b : 3;
00070
00071 unsigned char private_bit : 1;
00072 unsigned char padding_bit : 1;
00073 unsigned char frequency : 2;
00074 unsigned char bitrate_index : 4;
00075
00076 unsigned char emphasis : 2;
00077 unsigned char original : 1;
00078 unsigned char copyright : 1;
00079 unsigned char mode_ext : 2;
00080 unsigned char mode : 2;
00081 };
00082
00083 Mp3_Headerinfo* _mp3_header_output;
00084 };
00085
00086 #endif
00087