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 #ifndef TAGLIB_RELATIVEVOLUMEFRAME_H
00023 #define TAGLIB_RELATIVEVOLUMEFRAME_H
00024
00025 #include <tlist.h>
00026 #include <id3v2frame.h>
00027
00028 namespace TagLib {
00029
00030 namespace ID3v2 {
00031
00033
00044 class RelativeVolumeFrame : public Frame
00045 {
00046 friend class FrameFactory;
00047
00048 public:
00049
00053 enum ChannelType {
00055 Other = 0x00,
00057 MasterVolume = 0x01,
00059 FrontRight = 0x02,
00061 FrontLeft = 0x03,
00063 BackRight = 0x04,
00065 BackLeft = 0x05,
00067 FrontCentre = 0x06,
00069 BackCentre = 0x07,
00071 Subwoofer = 0x08
00072 };
00073
00075
00080 struct PeakVolume
00081 {
00085 PeakVolume() : bitsRepresentingPeak(0) {}
00090 unsigned char bitsRepresentingPeak;
00095 ByteVector peakVolume;
00096 };
00097
00102 RelativeVolumeFrame();
00103
00107 RelativeVolumeFrame(const ByteVector &data);
00108
00112 virtual ~RelativeVolumeFrame();
00113
00119 virtual String toString() const;
00120
00124 List<ChannelType> channels() const;
00125
00129 ChannelType channelType() const;
00130
00134 void setChannelType(ChannelType t);
00135
00136
00137
00138
00139
00140
00141
00142 #ifdef DOXYGEN
00143
00155 short volumeAdjustmentIndex(ChannelType type = MasterVolume) const;
00156
00167 void setVolumeAdjustmentIndex(short index, ChannelType type = MasterVolume);
00168
00182 float volumeAdjustment(ChannelType type = MasterVolume) const;
00183
00196 void setVolumeAdjustment(float adjustment, ChannelType type = MasterVolume);
00197
00206 PeakVolume peakVolume(ChannelType type = MasterVolume) const;
00207
00215 void setPeakVolume(const PeakVolume &peak, ChannelType type = MasterVolume);
00216
00217 #else
00218
00219
00220
00221
00222 short volumeAdjustmentIndex(ChannelType type) const;
00223 short volumeAdjustmentIndex() const;
00224
00225 void setVolumeAdjustmentIndex(short index, ChannelType type);
00226 void setVolumeAdjustmentIndex(short index);
00227
00228 float volumeAdjustment(ChannelType type) const;
00229 float volumeAdjustment() const;
00230
00231 void setVolumeAdjustment(float adjustment, ChannelType type);
00232 void setVolumeAdjustment(float adjustment);
00233
00234 PeakVolume peakVolume(ChannelType type) const;
00235 PeakVolume peakVolume() const;
00236
00237 void setPeakVolume(const PeakVolume &peak, ChannelType type);
00238 void setPeakVolume(const PeakVolume &peak);
00239
00240 #endif
00241
00242 protected:
00243 virtual void parseFields(const ByteVector &data);
00244 virtual ByteVector renderFields() const;
00245
00246 private:
00247 RelativeVolumeFrame(const ByteVector &data, Header *h);
00248 RelativeVolumeFrame(const RelativeVolumeFrame &);
00249 RelativeVolumeFrame &operator=(const RelativeVolumeFrame &);
00250
00251 class RelativeVolumeFramePrivate;
00252 RelativeVolumeFramePrivate *d;
00253 };
00254
00255 }
00256 }
00257 #endif