relativevolumeframe.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_RELATIVEVOLUMEFRAME_H
#define TAGLIB_RELATIVEVOLUMEFRAME_H
#include "tlist.h"
#include "taglib_export.h"
#include "id3v2frame.h"
namespace TagLib {
namespace ID3v2 {
class TAGLIB_EXPORT RelativeVolumeFrame : public Frame
{
friend class FrameFactory;
public:
enum ChannelType {
Other = 0x00,
MasterVolume = 0x01,
FrontRight = 0x02,
FrontLeft = 0x03,
BackRight = 0x04,
BackLeft = 0x05,
FrontCentre = 0x06,
BackCentre = 0x07,
Subwoofer = 0x08
};
struct PeakVolume {
unsigned char bitsRepresentingPeak { 0 };
ByteVector peakVolume;
};
RelativeVolumeFrame();
RelativeVolumeFrame(const ByteVector &data);
~RelativeVolumeFrame() override;
RelativeVolumeFrame(const RelativeVolumeFrame &) = delete;
RelativeVolumeFrame &operator=(const RelativeVolumeFrame &) = delete;
String toString() const override;
List<ChannelType> channels() const;
short volumeAdjustmentIndex(ChannelType type = MasterVolume) const;
void setVolumeAdjustmentIndex(short index, ChannelType type = MasterVolume);
float volumeAdjustment(ChannelType type = MasterVolume) const;
void setVolumeAdjustment(float adjustment, ChannelType type = MasterVolume);
PeakVolume peakVolume(ChannelType type = MasterVolume) const;
void setPeakVolume(const PeakVolume &peak, ChannelType type = MasterVolume);
String identification() const;
void setIdentification(const String &s);
protected:
void parseFields(const ByteVector &data) override;
ByteVector renderFields() const override;
private:
RelativeVolumeFrame(const ByteVector &data, Header *h);
class RelativeVolumeFramePrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<RelativeVolumeFramePrivate> d;
};
} // namespace ID3v2
} // namespace TagLib
#endif
TagLib::ByteVector
A byte vector.
Definition tbytevector.h:46
TagLib::ID3v2::Frame::Header
ID3v2 frame header implementation.
Definition id3v2frame.h:293
TagLib::ID3v2::Frame::Frame
Frame(const Frame &)=delete
TagLib::ID3v2::RelativeVolumeFrame::ChannelType
ChannelType
Definition relativevolumeframe.h:58
TagLib::ID3v2::RelativeVolumeFrame::BackLeft
@ BackLeft
The back left audio channel.
Definition relativevolumeframe.h:70
TagLib::ID3v2::RelativeVolumeFrame::FrontRight
@ FrontRight
The front right audio channel.
Definition relativevolumeframe.h:64
TagLib::ID3v2::RelativeVolumeFrame::FrontLeft
@ FrontLeft
The front left audio channel.
Definition relativevolumeframe.h:66
TagLib::ID3v2::RelativeVolumeFrame::BackCentre
@ BackCentre
The back center audio channel.
Definition relativevolumeframe.h:74
TagLib::ID3v2::RelativeVolumeFrame::FrontCentre
@ FrontCentre
The front center audio channel.
Definition relativevolumeframe.h:72
TagLib::ID3v2::RelativeVolumeFrame::BackRight
@ BackRight
The back right audio channel.
Definition relativevolumeframe.h:68
TagLib::ID3v2::RelativeVolumeFrame::Other
@ Other
A type not enumerated below.
Definition relativevolumeframe.h:60
TagLib::ID3v2::RelativeVolumeFrame::MasterVolume
@ MasterVolume
The master volume for the track.
Definition relativevolumeframe.h:62
TagLib::ID3v2::RelativeVolumeFrame::Subwoofer
@ Subwoofer
The subwoofer audio channel.
Definition relativevolumeframe.h:76
TagLib::ID3v2::RelativeVolumeFrame::RelativeVolumeFrame
RelativeVolumeFrame()
TagLib::ID3v2::RelativeVolumeFrame::identification
String identification() const
TagLib::ID3v2::RelativeVolumeFrame::RelativeVolumeFrame
RelativeVolumeFrame(const RelativeVolumeFrame &)=delete
TagLib::ID3v2::RelativeVolumeFrame::volumeAdjustmentIndex
short volumeAdjustmentIndex(ChannelType type=MasterVolume) const
TagLib::ID3v2::RelativeVolumeFrame::setVolumeAdjustment
void setVolumeAdjustment(float adjustment, ChannelType type=MasterVolume)
TagLib::ID3v2::RelativeVolumeFrame::renderFields
ByteVector renderFields() const override
TagLib::ID3v2::RelativeVolumeFrame::volumeAdjustment
float volumeAdjustment(ChannelType type=MasterVolume) const
TagLib::ID3v2::RelativeVolumeFrame::setIdentification
void setIdentification(const String &s)
TagLib::ID3v2::RelativeVolumeFrame::peakVolume
PeakVolume peakVolume(ChannelType type=MasterVolume) const
TagLib::ID3v2::RelativeVolumeFrame::setPeakVolume
void setPeakVolume(const PeakVolume &peak, ChannelType type=MasterVolume)
TagLib::ID3v2::RelativeVolumeFrame::FrameFactory
friend class FrameFactory
Definition relativevolumeframe.h:51
TagLib::ID3v2::RelativeVolumeFrame::setVolumeAdjustmentIndex
void setVolumeAdjustmentIndex(short index, ChannelType type=MasterVolume)
TagLib::ID3v2::RelativeVolumeFrame::parseFields
void parseFields(const ByteVector &data) override
TagLib::ID3v2::RelativeVolumeFrame::RelativeVolumeFrame
RelativeVolumeFrame(const ByteVector &data)
TagLib::ID3v2::RelativeVolumeFrame::~RelativeVolumeFrame
~RelativeVolumeFrame() override
TagLib::ID3v2::RelativeVolumeFrame::toString
String toString() const override
TagLib::ID3v2::RelativeVolumeFrame::operator=
RelativeVolumeFrame & operator=(const RelativeVolumeFrame &)=delete
TagLib::ID3v2::RelativeVolumeFrame::channels
List< ChannelType > channels() const
TagLib::List
A generic, implicitly shared list.
Definition tlist.h:54
TagLib::String
A wide string class suitable for unicode.
Definition tstring.h:83
id3v2frame.h
TagLib::ID3v2
An ID3v2 implementation.
Definition flacfile.h:39
TagLib
A namespace for all TagLib related classes and functions.
Definition apefile.h:41
TagLib::ID3v2::RelativeVolumeFrame::PeakVolume
Struct that stores the relevant values for ID3v2 peak volume.
Definition relativevolumeframe.h:85
TagLib::ID3v2::RelativeVolumeFrame::PeakVolume::peakVolume
ByteVector peakVolume
Definition relativevolumeframe.h:95
TagLib::ID3v2::RelativeVolumeFrame::PeakVolume::bitsRepresentingPeak
unsigned char bitsRepresentingPeak
Definition relativevolumeframe.h:90
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
tlist.h