TagLib  1.13.1
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
31namespace TagLib {
32
33 class ByteVector;
34 class File;
35
36 namespace MPEG {
37
39
48 {
49 public:
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
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
130 Stereo = 0,
132 JointStereo = 1,
134 DualChannel = 2,
136 SingleChannel = 3
137 };
138
143
147 bool isCopyrighted() const;
148
152 bool isOriginal() const;
153
157 int frameLength() const;
158
162 int samplesPerFrame() const;
163
168
169 private:
170 void parse(File *file, long offset, bool checkLength);
171
172 class HeaderPrivate;
173 HeaderPrivate *d;
174 };
175 } // namespace MPEG
176} // namespace TagLib
177
178#endif
A byte vector.
Definition: tbytevector.h:46
An MPEG file class with some useful methods specific to MPEG.
Definition: mpegfile.h:56
An implementation of MP3 frame headers.
Definition: mpegheader.h:48
Version
Definition: mpegheader.h:85
bool isOriginal() const
Version version() const
bool isValid() const
bool isCopyrighted() const
TAGLIB_DEPRECATED Header(const ByteVector &data)
Header(const Header &h)
bool protectionEnabled() const
Header(File *file, long offset, bool checkLength=true)
Header & operator=(const Header &h)
ChannelMode channelMode() const
bool isPadded() const
int frameLength() const
int samplesPerFrame() const
ChannelMode
Definition: mpegheader.h:128
int sampleRate() const
A namespace for all TagLib related classes and functions.
Definition: apefile.h:41
#define TAGLIB_DEPRECATED
Definition: taglib.h:54
#define TAGLIB_EXPORT
Definition: taglib_export.h:40