| TagLib 1.13 |  |

relativevolumeframe.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_RELATIVEVOLUMEFRAME_H
27#define TAGLIB_RELATIVEVOLUMEFRAME_H
28
29#include "tlist.h"
30#include "id3v2frame.h"
31#include "taglib_export.h"
32
33 namespace TagLib {
34
35 namespace ID3v2 {
36
38
49 class TAGLIB_EXPORT RelativeVolumeFrame : public Frame
50 {
51 friend class FrameFactory;
52
53 public:
54
58 enum ChannelType {
60 Other = 0x00,
62 MasterVolume = 0x01,
64 FrontRight = 0x02,
66 FrontLeft = 0x03,
68 BackRight = 0x04,
70 BackLeft = 0x05,
72 FrontCentre = 0x06,
74 BackCentre = 0x07,
76 Subwoofer = 0x08
77 };
78
80
85 struct PeakVolume
86 {
90 PeakVolume() : bitsRepresentingPeak(0) {}
95 unsigned char bitsRepresentingPeak;
100 ByteVector peakVolume;
101 };
102
107 RelativeVolumeFrame();
108
112 RelativeVolumeFrame(const ByteVector &data);
113
117 virtual ~RelativeVolumeFrame();
118
124 virtual String toString() const;
125
129 List<ChannelType> channels() const;
130
134 TAGLIB_DEPRECATED ChannelType channelType() const;
135
139 TAGLIB_DEPRECATED void setChannelType(ChannelType t);
140
141 /*
142 * There was a terrible API goof here, and while this can't be changed to
143 * the way it appears below for binary compatibility reasons, let's at
144 * least pretend that it looks clean.
145 */
146
147#ifdef DOXYGEN
148
160 short volumeAdjustmentIndex(ChannelType type = MasterVolume) const;
161
172 void setVolumeAdjustmentIndex(short index, ChannelType type = MasterVolume);
173
187 float volumeAdjustment(ChannelType type = MasterVolume) const;
188
201 void setVolumeAdjustment(float adjustment, ChannelType type = MasterVolume);
202
211 PeakVolume peakVolume(ChannelType type = MasterVolume) const;
212
220 void setPeakVolume(const PeakVolume &peak, ChannelType type = MasterVolume);
221
222#else
223
224 // BIC: Combine each of the following pairs of functions (or maybe just
225 // rework this junk altogether).
226
227 short volumeAdjustmentIndex(ChannelType type) const;
228 short volumeAdjustmentIndex() const;
229
230 void setVolumeAdjustmentIndex(short index, ChannelType type);
231 void setVolumeAdjustmentIndex(short index);
232
233 float volumeAdjustment(ChannelType type) const;
234 float volumeAdjustment() const;
235
236 void setVolumeAdjustment(float adjustment, ChannelType type);
237 void setVolumeAdjustment(float adjustment);
238
239 PeakVolume peakVolume(ChannelType type) const;
240 PeakVolume peakVolume() const;
241
242 void setPeakVolume(const PeakVolume &peak, ChannelType type);
243 void setPeakVolume(const PeakVolume &peak);
244
245#endif
246
250 String identification() const;
251
257 void setIdentification(const String &s);
258
259 protected:
260 virtual void parseFields(const ByteVector &data);
261 virtual ByteVector renderFields() const;
262
263 private:
264 RelativeVolumeFrame(const ByteVector &data, Header *h);
265 RelativeVolumeFrame(const RelativeVolumeFrame &);
266 RelativeVolumeFrame &operator=(const RelativeVolumeFrame &);
267
268 class RelativeVolumeFramePrivate;
269 RelativeVolumeFramePrivate *d;
270 };
271
272 }
273}
274#endif
TagLib::ByteVector
A byte vector.
Definition: tbytevector.h:46
TagLib::ID3v2::FrameFactory
A factory for creating ID3v2 frames during parsing.
Definition: id3v2framefactory.h:66
TagLib::ID3v2::Frame
ID3v2 frame implementation.
Definition: id3v2frame.h:55
TagLib::ID3v2::Header
An implementation of ID3v2 headers.
Definition: id3v2header.h:49
TagLib::ID3v2::RelativeVolumeFrame
An ID3v2 relative volume adjustment frame implementation.
Definition: relativevolumeframe.h:50
TagLib::ID3v2::RelativeVolumeFrame::toString
virtual String toString() const
TagLib::ID3v2::RelativeVolumeFrame::ChannelType
ChannelType
Definition: relativevolumeframe.h:58
TagLib::ID3v2::RelativeVolumeFrame::RelativeVolumeFrame
RelativeVolumeFrame()
TagLib::ID3v2::RelativeVolumeFrame::identification
String identification() const
TagLib::ID3v2::RelativeVolumeFrame::~RelativeVolumeFrame
virtual ~RelativeVolumeFrame()
TagLib::ID3v2::RelativeVolumeFrame::volumeAdjustmentIndex
short volumeAdjustmentIndex(ChannelType type=MasterVolume) const
TagLib::ID3v2::RelativeVolumeFrame::setVolumeAdjustment
void setVolumeAdjustment(float adjustment, ChannelType type=MasterVolume)
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::setVolumeAdjustmentIndex
void setVolumeAdjustmentIndex(short index, ChannelType type=MasterVolume)
TagLib::ID3v2::RelativeVolumeFrame::channelType
TAGLIB_DEPRECATED ChannelType channelType() const
TagLib::ID3v2::RelativeVolumeFrame::RelativeVolumeFrame
RelativeVolumeFrame(const ByteVector &data)
TagLib::ID3v2::RelativeVolumeFrame::setChannelType
TAGLIB_DEPRECATED void setChannelType(ChannelType t)
TagLib::ID3v2::RelativeVolumeFrame::parseFields
virtual void parseFields(const ByteVector &data)
TagLib::ID3v2::RelativeVolumeFrame::renderFields
virtual ByteVector renderFields() const
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:85
id3v2frame.h
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:86
TagLib::ID3v2::RelativeVolumeFrame::PeakVolume::PeakVolume
PeakVolume()
Definition: relativevolumeframe.h:90
TagLib::ID3v2::RelativeVolumeFrame::PeakVolume::peakVolume
ByteVector peakVolume
Definition: relativevolumeframe.h:100
TagLib::ID3v2::RelativeVolumeFrame::PeakVolume::bitsRepresentingPeak
unsigned char bitsRepresentingPeak
Definition: relativevolumeframe.h:95
TAGLIB_DEPRECATED
#define TAGLIB_DEPRECATED
Definition: taglib.h:54
taglib_export.h
TAGLIB_EXPORT
#define TAGLIB_EXPORT
Definition: taglib_export.h:40
tlist.h