TagLib API Documentation
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 "taglib_export.h"
31#include "id3v2frame.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
85 struct PeakVolume {
90 unsigned char bitsRepresentingPeak { 0 };
96 };
97
103
108
113
116
122 String toString() const override;
123
128
140 short volumeAdjustmentIndex(ChannelType type = MasterVolume) const;
141
152 void setVolumeAdjustmentIndex(short index, ChannelType type = MasterVolume);
153
167 float volumeAdjustment(ChannelType type = MasterVolume) const;
168
181 void setVolumeAdjustment(float adjustment, ChannelType type = MasterVolume);
182
191 PeakVolume peakVolume(ChannelType type = MasterVolume) const;
192
200 void setPeakVolume(const PeakVolume &peak, ChannelType type = MasterVolume);
201
206
212 void setIdentification(const String &s);
213
214 protected:
215 void parseFields(const ByteVector &data) override;
216 ByteVector renderFields() const override;
217
218 private:
219 RelativeVolumeFrame(const ByteVector &data, Header *h);
220
221 class RelativeVolumeFramePrivate;
223 std::unique_ptr<RelativeVolumeFramePrivate> d;
224 };
225
226 } // namespace ID3v2
227} // namespace TagLib
228#endif
A byte vector.
Definition: tbytevector.h:46
A factory for creating ID3v2 frames during parsing.
Definition: id3v2framefactory.h:68
ID3v2 frame implementation.
Definition: id3v2frame.h:57
An implementation of ID3v2 headers.
Definition: id3v2header.h:49
An ID3v2 relative volume adjustment frame implementation.
Definition: relativevolumeframe.h:50
ChannelType
Definition: relativevolumeframe.h:58
RelativeVolumeFrame(const RelativeVolumeFrame &)=delete
short volumeAdjustmentIndex(ChannelType type=MasterVolume) const
void setVolumeAdjustment(float adjustment, ChannelType type=MasterVolume)
ByteVector renderFields() const override
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)
void parseFields(const ByteVector &data) override
RelativeVolumeFrame(const ByteVector &data)
String toString() const override
RelativeVolumeFrame & operator=(const RelativeVolumeFrame &)=delete
List< ChannelType > channels() const
A generic, implicitly shared list.
Definition: tlist.h:54
A wide string class suitable for unicode.
Definition: tstring.h:83
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:85
ByteVector peakVolume
Definition: relativevolumeframe.h:95
#define TAGLIB_EXPORT
Definition: taglib_export.h:40
#define TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
Definition: taglib_export.h:55