mpegheader.h
Go to the documentation of this file.
/***************************************************************************
copyright : (C) 2002 - 2008 by Scott Wheeler
email : wheeler@kde.org
***************************************************************************/
/***************************************************************************
* This library is free software; you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License version *
* 2.1 as published by the Free Software Foundation. *
* *
* This library is distributed in the hope that it will be useful, but *
* WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA *
* 02110-1301 USA *
* *
* Alternatively, this file is available under the Mozilla Public *
* License Version 1.1. You may obtain a copy of the License at *
* http://www.mozilla.org/MPL/ *
***************************************************************************/
#ifndef TAGLIB_MPEGHEADER_H
#define TAGLIB_MPEGHEADER_H
#include <memory>
#include "taglib.h"
#include "taglib_export.h"
namespace TagLib {
class ByteVector;
class File;
namespace MPEG {
class TAGLIB_EXPORT Header
{
public:
Header(File *file, offset_t offset, bool checkLength = true);
Header(const Header &h);
~Header();
bool isValid() const;
enum Version {
Version1 = 0,
Version2 = 1,
Version2_5 = 2,
Version4 = 3
};
Version version() const;
int layer() const;
bool protectionEnabled() const;
int bitrate() const;
int sampleRate() const;
bool isPadded() const;
enum ChannelMode {
Stereo = 0,
JointStereo = 1,
DualChannel = 2,
SingleChannel = 3
};
ChannelMode channelMode() const;
enum ChannelConfiguration {
Custom = 0,
FrontCenter = 1,
FrontLeftRight = 2,
FrontCenterLeftRight = 3,
FrontCenterLeftRightBackCenter = 4,
FrontCenterLeftRightBackLeftRight = 5,
FrontCenterLeftRightBackLeftRightLFE = 6,
FrontCenterLeftRightSideLeftRightBackLeftRightLFE = 7
};
ChannelConfiguration channelConfiguration() const;
bool isADTS() const;
bool isCopyrighted() const;
bool isOriginal() const;
int frameLength() const;
int samplesPerFrame() const;
Header &operator=(const Header &h);
private:
void parse(File *file, offset_t offset, bool checkLength);
class HeaderPrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::shared_ptr<HeaderPrivate> d;
};
} // namespace MPEG
} // namespace TagLib
#endif
TagLib::ByteVector
A byte vector.
Definition tbytevector.h:46
TagLib::File
A file class with some useful methods for tag manipulation.
Definition tfile.h:51
TagLib::MPEG::File
An MPEG file class with some useful methods specific to MPEG.
Definition mpegfile.h:54
TagLib::MPEG::Header::Version
Version
Definition mpegheader.h:84
TagLib::MPEG::Header::Version1
@ Version1
MPEG Version 1.
Definition mpegheader.h:86
TagLib::MPEG::Header::Version2_5
@ Version2_5
MPEG Version 2.5.
Definition mpegheader.h:90
TagLib::MPEG::Header::Version4
@ Version4
MPEG Version 4.
Definition mpegheader.h:92
TagLib::MPEG::Header::Version2
@ Version2
MPEG Version 2.
Definition mpegheader.h:88
TagLib::MPEG::Header::isOriginal
bool isOriginal() const
TagLib::MPEG::Header::version
Version version() const
TagLib::MPEG::Header::isValid
bool isValid() const
TagLib::MPEG::Header::isCopyrighted
bool isCopyrighted() const
TagLib::MPEG::Header::bitrate
int bitrate() const
TagLib::MPEG::Header::Header
Header(const Header &h)
TagLib::MPEG::Header::protectionEnabled
bool protectionEnabled() const
TagLib::MPEG::Header::layer
int layer() const
TagLib::MPEG::Header::operator=
Header & operator=(const Header &h)
TagLib::MPEG::Header::channelMode
ChannelMode channelMode() const
TagLib::MPEG::Header::Header
Header(File *file, offset_t offset, bool checkLength=true)
TagLib::MPEG::Header::isPadded
bool isPadded() const
TagLib::MPEG::Header::channelConfiguration
ChannelConfiguration channelConfiguration() const
TagLib::MPEG::Header::frameLength
int frameLength() const
TagLib::MPEG::Header::samplesPerFrame
int samplesPerFrame() const
TagLib::MPEG::Header::ChannelMode
ChannelMode
Definition mpegheader.h:129
TagLib::MPEG::Header::Stereo
@ Stereo
Stereo.
Definition mpegheader.h:131
TagLib::MPEG::Header::SingleChannel
@ SingleChannel
Mono.
Definition mpegheader.h:137
TagLib::MPEG::Header::DualChannel
@ DualChannel
Dual Mono.
Definition mpegheader.h:135
TagLib::MPEG::Header::JointStereo
@ JointStereo
Stereo.
Definition mpegheader.h:133
TagLib::MPEG::Header::isADTS
bool isADTS() const
TagLib::MPEG::Header::sampleRate
int sampleRate() const
TagLib::MPEG::Header::~Header
~Header()
TagLib::MPEG::Header::ChannelConfiguration
ChannelConfiguration
Definition mpegheader.h:148
TagLib::MPEG::Header::FrontCenterLeftRightSideLeftRightBackLeftRightLFE
@ FrontCenterLeftRightSideLeftRightBackLeftRightLFE
Definition mpegheader.h:167
TagLib::MPEG::Header::FrontCenter
@ FrontCenter
1 channel: front-center
Definition mpegheader.h:152
TagLib::MPEG::Header::Custom
@ Custom
Defined in audio object type (AOT) specific configuration.
Definition mpegheader.h:150
TagLib::MPEG::Header::FrontCenterLeftRightBackLeftRightLFE
@ FrontCenterLeftRightBackLeftRightLFE
Definition mpegheader.h:164
TagLib::MPEG::Header::FrontCenterLeftRightBackLeftRight
@ FrontCenterLeftRightBackLeftRight
Definition mpegheader.h:161
TagLib::MPEG::Header::FrontCenterLeftRightBackCenter
@ FrontCenterLeftRightBackCenter
4 channels: front-center, front-left, front-right, back-center
Definition mpegheader.h:158
TagLib::MPEG::Header::FrontLeftRight
@ FrontLeftRight
2 channels: front-left, front-right
Definition mpegheader.h:154
TagLib::MPEG::Header::FrontCenterLeftRight
@ FrontCenterLeftRight
3 channels: front-center, front-left, front-right
Definition mpegheader.h:156
TagLib::MPEG
An implementation of TagLib::File with MPEG (MP3) specific methods.
Definition mpegfile.h:43
TagLib
A namespace for all TagLib related classes and functions.
Definition apefile.h:41
TagLib::offset_t
off_t offset_t
Definition taglib.h:64
taglib.h
taglib_export.h
TAGLIB_EXPORT
#define TAGLIB_EXPORT
Definition taglib_export.h:40
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
#define TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
Definition taglib_export.h:55