relativevolumeframe.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef TAGLIB_RELATIVEVOLUMEFRAME_H
00027 #define TAGLIB_RELATIVEVOLUMEFRAME_H
00028
00029 #include "tlist.h"
00030 #include "id3v2frame.h"
00031 #include "taglib_export.h"
00032
00033 namespace TagLib {
00034
00035 namespace ID3v2 {
00036
00038
00049 class TAGLIB_EXPORT RelativeVolumeFrame : public Frame
00050 {
00051 friend class FrameFactory;
00052
00053 public:
00054
00058 enum ChannelType {
00060 Other = 0x00,
00062 MasterVolume = 0x01,
00064 FrontRight = 0x02,
00066 FrontLeft = 0x03,
00068 BackRight = 0x04,
00070 BackLeft = 0x05,
00072 FrontCentre = 0x06,
00074 BackCentre = 0x07,
00076 Subwoofer = 0x08
00077 };
00078
00080
00085 struct PeakVolume
00086 {
00090 PeakVolume() : bitsRepresentingPeak(0) {}
00095 unsigned char bitsRepresentingPeak;
00100 ByteVector peakVolume;
00101 };
00102
00107 RelativeVolumeFrame();
00108
00112 RelativeVolumeFrame(const ByteVector &data);
00113
00117 virtual ~RelativeVolumeFrame();
00118
00124 virtual String toString() const;
00125
00129 List<ChannelType> channels() const;
00130
00134 ChannelType channelType() const;
00135
00139 void setChannelType(ChannelType t);
00140
00141
00142
00143
00144
00145
00146
00147 #ifdef DOXYGEN
00148
00160 short volumeAdjustmentIndex(ChannelType type = MasterVolume) const;
00161
00172 void setVolumeAdjustmentIndex(short index, ChannelType type = MasterVolume);
00173
00187 float volumeAdjustment(ChannelType type = MasterVolume) const;
00188
00201 void setVolumeAdjustment(float adjustment, ChannelType type = MasterVolume);
00202
00211 PeakVolume peakVolume(ChannelType type = MasterVolume) const;
00212
00220 void setPeakVolume(const PeakVolume &peak, ChannelType type = MasterVolume);
00221
00222 #else
00223
00224
00225
00226
00227 short volumeAdjustmentIndex(ChannelType type) const;
00228 short volumeAdjustmentIndex() const;
00229
00230 void setVolumeAdjustmentIndex(short index, ChannelType type);
00231 void setVolumeAdjustmentIndex(short index);
00232
00233 float volumeAdjustment(ChannelType type) const;
00234 float volumeAdjustment() const;
00235
00236 void setVolumeAdjustment(float adjustment, ChannelType type);
00237 void setVolumeAdjustment(float adjustment);
00238
00239 PeakVolume peakVolume(ChannelType type) const;
00240 PeakVolume peakVolume() const;
00241
00242 void setPeakVolume(const PeakVolume &peak, ChannelType type);
00243 void setPeakVolume(const PeakVolume &peak);
00244
00245 #endif
00246
00250 String identification() const;
00251
00257 void setIdentification(const String &s);
00258
00259 protected:
00260 virtual void parseFields(const ByteVector &data);
00261 virtual ByteVector renderFields() const;
00262
00263 private:
00264 RelativeVolumeFrame(const ByteVector &data, Header *h);
00265 RelativeVolumeFrame(const RelativeVolumeFrame &);
00266 RelativeVolumeFrame &operator=(const RelativeVolumeFrame &);
00267
00268 class RelativeVolumeFramePrivate;
00269 RelativeVolumeFramePrivate *d;
00270 };
00271
00272 }
00273 }
00274 #endif