mpegheader.h
Go to the documentation of this file.
1 /***************************************************************************
2  copyright : (C) 2002 - 2008 by Scott Wheeler
3  email : wheeler@kde.org
4  ***************************************************************************/
5 
6 /***************************************************************************
7  * This library is free software; you can redistribute it and/or modify *
8  * it under the terms of the GNU Lesser General Public License version *
9  * 2.1 as published by the Free Software Foundation. *
10  * *
11  * This library is distributed in the hope that it will be useful, but *
12  * WITHOUT ANY WARRANTY; without even the implied warranty of *
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
14  * Lesser General Public License for more details. *
15  * *
16  * You should have received a copy of the GNU Lesser General Public *
17  * License along with this library; if not, write to the Free Software *
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA *
19  * 02110-1301 USA *
20  * *
21  * Alternatively, this file is available under the Mozilla Public *
22  * License Version 1.1. You may obtain a copy of the License at *
23  * http://www.mozilla.org/MPL/ *
24  ***************************************************************************/
25 
26 #ifndef TAGLIB_MPEGHEADER_H
27 #define TAGLIB_MPEGHEADER_H
28 
29 #include "taglib_export.h"
30 
31 namespace TagLib {
32 
33  class ByteVector;
34  class File;
35 
36  namespace MPEG {
37 
39 
48  {
49  public:
55  Header(const ByteVector &data);
56 
64  Header(File *file, long offset, bool checkLength = true);
65 
69  Header(const Header &h);
70 
74  virtual ~Header();
75 
80  bool isValid() const;
81 
85  enum Version {
87  Version1 = 0,
89  Version2 = 1,
91  Version2_5 = 2
92  };
93 
97  Version version() const;
98 
102  int layer() const;
103 
107  bool protectionEnabled() const;
108 
112  int bitrate() const;
113 
117  int sampleRate() const;
118 
122  bool isPadded() const;
123 
128  enum ChannelMode {
130  Stereo = 0,
132  JointStereo = 1,
134  DualChannel = 2,
136  SingleChannel = 3
137  };
138 
142  ChannelMode channelMode() const;
143 
147  bool isCopyrighted() const;
148 
152  bool isOriginal() const;
153 
157  int frameLength() const;
158 
162  int samplesPerFrame() const;
163 
167  Header &operator=(const Header &h);
168 
169  private:
170  void parse(File *file, long offset, bool checkLength);
171 
172  class HeaderPrivate;
173  HeaderPrivate *d;
174  };
175  }
176 }
177 
178 #endif
A byte vector.
Definition: tbytevector.h:45
An MPEG file class with some useful methods specific to MPEG.
Definition: mpegfile.h:53
#define TAGLIB_EXPORT
Definition: taglib_export.h:40
An implementation of MP3 frame headers.
Definition: mpegheader.h:47
ChannelMode
Definition: mpegheader.h:128
Version
Definition: mpegheader.h:85
A namespace for all TagLib related classes and functions.
Definition: apefile.h:41