TagLib  1.13.1
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
33namespace TagLib {
34
35 namespace ID3v2 {
36
38
50 {
51 friend class FrameFactory;
52
53 public:
54
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
86 {
90 PeakVolume() : bitsRepresentingPeak(0) {}
95 unsigned char bitsRepresentingPeak;
101 };
102
108
113
118
124 virtual String toString() const;
125
130
135
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
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);
266 RelativeVolumeFrame &operator=(const RelativeVolumeFrame &);
267
268 class RelativeVolumeFramePrivate;
269 RelativeVolumeFramePrivate *d;
270 };
271
272 } // namespace ID3v2
273} // namespace TagLib
274#endif
A byte vector.
Definition tbytevector.h:46
A factory for creating ID3v2 frames during parsing.
Definition id3v2framefactory.h:66
ID3v2 frame header implementation.
Definition id3v2frame.h:330
ID3v2 frame implementation.
Definition id3v2frame.h:55
An ID3v2 relative volume adjustment frame implementation.
Definition relativevolumeframe.h:50
virtual String toString() const
ChannelType
Definition relativevolumeframe.h:58
short volumeAdjustmentIndex(ChannelType type=MasterVolume) const
void setVolumeAdjustment(float adjustment, ChannelType type=MasterVolume)
float volumeAdjustment(ChannelType type=MasterVolume) const
void setIdentification(const String &s)
PeakVolume peakVolume(ChannelType type=MasterVolume) const
void setPeakVolume(const PeakVolume &peak, ChannelType type=MasterVolume)
void setVolumeAdjustmentIndex(short index, ChannelType type=MasterVolume)
TAGLIB_DEPRECATED ChannelType channelType() const
RelativeVolumeFrame(const ByteVector &data)
TAGLIB_DEPRECATED void setChannelType(ChannelType t)
virtual void parseFields(const ByteVector &data)
virtual ByteVector renderFields() const
List< ChannelType > channels() const
A generic, implicitly shared list.
Definition tlist.h:54
A wide string class suitable for unicode.
Definition tstring.h:85
A namespace for all TagLib related classes and functions.
Definition apefile.h:41
Struct that stores the relevant values for ID3v2 peak volume.
Definition relativevolumeframe.h:86
PeakVolume()
Definition relativevolumeframe.h:90
ByteVector peakVolume
Definition relativevolumeframe.h:100
unsigned char bitsRepresentingPeak
Definition relativevolumeframe.h:95
#define TAGLIB_DEPRECATED
Definition taglib.h:54
#define TAGLIB_EXPORT
Definition taglib_export.h:40