id3lib 3.8.3

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

mp3_header.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 // $Id: mp3_header.h,v 1.4 2002/11/02 17:48:51 t1mpy Exp $
3
4 // id3lib: a C++ library for creating and manipulating id3v1/v2 tags
5 // Copyright 2002 Thijmen Klok (thijmen@id3lib.org)
6
7 // This library is free software; you can redistribute it and/or modify it
8 // under the terms of the GNU Library General Public License as published by
9 // the Free Software Foundation; either version 2 of the License, or (at your
10 // option) any later version.
11 //
12 // This library is distributed in the hope that it will be useful, but WITHOUT
13 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
15 // License for more details.
16 //
17 // You should have received a copy of the GNU Library General Public License
18 // along with this library; if not, write to the Free Software Foundation,
19 // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20
21 // The id3lib authors encourage improvements and optimisations to be sent to
22 // the id3lib coordinator. Please see the README file for details on where to
23 // send such submissions. See the AUTHORS file for a list of people who have
24 // contributed to id3lib. See the ChangeLog file for a list of changes to
25 // id3lib. These files are distributed with id3lib at
26 // http://download.sourceforge.net/id3lib/
27
28 #ifndef _MP3_HEADER_H_
29 #define _MP3_HEADER_H_
30
31 #include "io_decorators.h" //has "readers.h" "io_helpers.h" "utils.h"
32
33 class Mp3Info
34 {
35 public:
36 Mp3Info() { _mp3_header_output = new Mp3_Headerinfo; };
37 ~Mp3Info() { this->Clean(); };
38 void Clean();
39
40 const Mp3_Headerinfo* GetMp3HeaderInfo() const { return _mp3_header_output; };
41 bool Parse(ID3_Reader&, size_t mp3size);
42
43 Mpeg_Layers Layer() const { return _mp3_header_output->layer; };
44 Mpeg_Version Version() const { return _mp3_header_output->version; };
45 MP3_BitRates Bitrate() const { return _mp3_header_output->bitrate; };
46 Mp3_ChannelMode ChannelMode() const { return _mp3_header_output->channelmode; };
47 Mp3_ModeExt ModeExt() const { return _mp3_header_output->modeext; };
48 Mp3_Emphasis Emphasis() const { return _mp3_header_output->emphasis; };
49 Mp3_Crc Crc() const { return _mp3_header_output->crc; };
50 uint32 VbrBitrate() const { return _mp3_header_output->vbr_bitrate; };
51 uint32 Frequency() const { return _mp3_header_output->frequency; };
52 uint32 Framesize() const { return _mp3_header_output->framesize; };
53 uint32 Frames() const { return _mp3_header_output->frames; };
54 bool Private() const { return _mp3_header_output->privatebit; };
55 bool Copyrighted() const { return _mp3_header_output->copyrighted; };
56 bool Original() const { return _mp3_header_output->original; };
57 uint32 Seconds() const { return _mp3_header_output->time; };
58
59 private:
60
61 struct _mp3_header_internal //http://www.mp3-tech.org/programmer/frame_header.html
62 {
63 //byte 1
64 unsigned char frame_sync_a : 8; /* all bits should be set */
65 //byte 2
66 unsigned char protection_bit : 1;
67 unsigned char layer : 2;
68 unsigned char id : 2;
69 unsigned char frame_sync_b : 3; /* all bits should be set */
70 //byte 3
71 unsigned char private_bit : 1;
72 unsigned char padding_bit : 1;
73 unsigned char frequency : 2;
74 unsigned char bitrate_index : 4;
75 //byte 4
76 unsigned char emphasis : 2;
77 unsigned char original : 1;
78 unsigned char copyright : 1;
79 unsigned char mode_ext : 2;//only used in joint stereo
80 unsigned char mode : 2;
81 };
82
83 Mp3_Headerinfo* _mp3_header_output;
84 }; //Info
85
86 #endif /* _MP3_HEADER_H_ */
87
Mp3Info::Bitrate
MP3_BitRates Bitrate() const
Definition: mp3_header.h:45
Mp3Info::Version
Mpeg_Version Version() const
Definition: mp3_header.h:44
Mp3_ModeExt
Mp3_ModeExt
Definition: globals.h:495
Mp3_Headerinfo::copyrighted
bool copyrighted
Definition: globals.h:536
MP3_BitRates
MP3_BitRates
Definition: globals.h:423
Mp3Info::~Mp3Info
~Mp3Info()
Definition: mp3_header.h:37
Mp3Info::Original
bool Original() const
Definition: mp3_header.h:56
Mp3_Headerinfo::crc
Mp3_Crc crc
Definition: globals.h:529
Mp3Info::ChannelMode
Mp3_ChannelMode ChannelMode() const
Definition: mp3_header.h:46
Mp3_Headerinfo::vbr_bitrate
uint32 vbr_bitrate
Definition: globals.h:530
Mp3_Headerinfo::frames
uint32 frames
Definition: globals.h:533
Mp3Info::ModeExt
Mp3_ModeExt ModeExt() const
Definition: mp3_header.h:47
Mp3Info::Crc
Mp3_Crc Crc() const
Definition: mp3_header.h:49
Mp3_Headerinfo::layer
Mpeg_Layers layer
Definition: globals.h:523
Mp3Info::Copyrighted
bool Copyrighted() const
Definition: mp3_header.h:55
Mp3Info::Frequency
uint32 Frequency() const
Definition: mp3_header.h:51
Mp3_Emphasis
Mp3_Emphasis
Definition: globals.h:504
Mp3Info::Frames
uint32 Frames() const
Definition: mp3_header.h:53
Mp3Info::Framesize
uint32 Framesize() const
Definition: mp3_header.h:52
Mp3_Headerinfo::framesize
uint32 framesize
Definition: globals.h:532
Mp3Info::Mp3Info
Mp3Info()
Definition: mp3_header.h:36
ID3_Reader
Definition: reader.h:33
Mp3_Headerinfo::bitrate
MP3_BitRates bitrate
Definition: globals.h:525
Mp3_Headerinfo
Definition: globals.h:521
Mp3Info::Seconds
uint32 Seconds() const
Definition: mp3_header.h:57
Mp3Info::Emphasis
Mp3_Emphasis Emphasis() const
Definition: mp3_header.h:48
Mp3_Headerinfo::channelmode
Mp3_ChannelMode channelmode
Definition: globals.h:526
Mp3_Crc
Mp3_Crc
Definition: globals.h:513
Mp3_ChannelMode
Mp3_ChannelMode
Definition: globals.h:486
Mp3_Headerinfo::original
bool original
Definition: globals.h:537
Mp3_Headerinfo::modeext
Mp3_ModeExt modeext
Definition: globals.h:527
Mp3Info::Layer
Mpeg_Layers Layer() const
Definition: mp3_header.h:43
Mp3Info::Parse
bool Parse(ID3_Reader &, size_t mp3size)
Definition: mp3_parse.cpp:102
Mp3_Headerinfo::emphasis
Mp3_Emphasis emphasis
Definition: globals.h:528
Mp3_Headerinfo::time
uint32 time
Definition: globals.h:534
Mp3Info::Clean
void Clean()
Definition: mp3_parse.cpp:93
Mp3_Headerinfo::frequency
uint32 frequency
Definition: globals.h:531
Mp3Info::GetMp3HeaderInfo
const Mp3_Headerinfo * GetMp3HeaderInfo() const
Definition: mp3_header.h:40
Mpeg_Version
Mpeg_Version
Definition: globals.h:462
Mp3Info::VbrBitrate
uint32 VbrBitrate() const
Definition: mp3_header.h:50
Mp3Info
Definition: mp3_header.h:33
Mp3_Headerinfo::version
Mpeg_Version version
Definition: globals.h:524
Mpeg_Layers
Mpeg_Layers
Definition: globals.h:453
Mp3Info::Private
bool Private() const
Definition: mp3_header.h:54
Mp3_Headerinfo::privatebit
bool privatebit
Definition: globals.h:535