| TagLib 1.13 |  |

Classes | Public Types | Public Member Functions | Protected Member Functions | Friends | List of all members
TagLib::ID3v2::RelativeVolumeFrame Class Reference

An ID3v2 relative volume adjustment frame implementation. More...

`#include <relativevolumeframe.h>`

Inheritance diagram for TagLib::ID3v2::RelativeVolumeFrame:
[legend]
Collaboration diagram for TagLib::ID3v2::RelativeVolumeFrame:
[legend]

## Classes
struct | PeakVolume
| Struct that stores the relevant values for ID3v2 peak volume. More...

## Public Types
enum | ChannelType { Other = 0x00 , MasterVolume = 0x01 , FrontRight = 0x02 , FrontLeft = 0x03 , BackRight = 0x04 , BackLeft = 0x05 , FrontCentre = 0x06 , BackCentre = 0x07 , Subwoofer = 0x08 }

## Public Member Functions
| RelativeVolumeFrame ()
| RelativeVolumeFrame (const ByteVector &data)
virtual | ~RelativeVolumeFrame ()
virtual String | toString () const
List< ChannelType > | channels () const
TAGLIB_DEPRECATED ChannelType | channelType () const
TAGLIB_DEPRECATED void | setChannelType (ChannelType t)
short | volumeAdjustmentIndex (ChannelType type=MasterVolume) const
void | setVolumeAdjustmentIndex (short index, ChannelType type=MasterVolume)
float | volumeAdjustment (ChannelType type=MasterVolume) const
void | setVolumeAdjustment (float adjustment, ChannelType type=MasterVolume)
PeakVolume | peakVolume (ChannelType type=MasterVolume) const
void | setPeakVolume (const PeakVolume &peak, ChannelType type=MasterVolume)
String | identification () const
void | setIdentification (const String &s)
Public Member Functions inherited from TagLib::ID3v2::Frame
virtual | ~Frame ()
ByteVector | frameID () const
unsigned int | size () const
void | setData (const ByteVector &data)
virtual void | setText (const String &text)
virtual String | toString () const =0
ByteVector | render () const
TAGLIB_DEPRECATED | Header (const ByteVector &data, bool synchSafeInts)
| Header (const ByteVector &data, unsigned int version=4)
virtual | ~Header ()
TAGLIB_DEPRECATED void | setData (const ByteVector &data, bool synchSafeInts)
void | setData (const ByteVector &data, unsigned int version=4)
ByteVector | frameID () const
void | setFrameID (const ByteVector &id)
unsigned int | frameSize () const
void | setFrameSize (unsigned int size)
unsigned int | version () const
void | setVersion (unsigned int version)
bool | tagAlterPreservation () const
void | setTagAlterPreservation (bool discard)
bool | fileAlterPreservation () const
bool | readOnly () const
bool | groupingIdentity () const
bool | compression () const
bool | encryption () const
bool | unsynchronisation () const
bool | dataLengthIndicator () const
ByteVector | render () const
TAGLIB_DEPRECATED bool | frameAlterPreservation () const

## Protected Member Functions
virtual void | parseFields (const ByteVector &data)
virtual ByteVector | renderFields () const
Protected Member Functions inherited from TagLib::ID3v2::Frame
| Frame (const ByteVector &data)
| Frame (Header *h)
Header * | header () const
void | setHeader (Header *h, bool deleteCurrent=true)
void | parse (const ByteVector &data)
virtual void | parseFields (const ByteVector &data)=0
virtual ByteVector | renderFields () const =0
ByteVector | fieldData (const ByteVector &frameData) const
String | readStringField (const ByteVector &data, String::Type encoding, int *position=0)
String::Type | checkTextEncoding (const StringList &fields, String::Type encoding) const
PropertyMap | asProperties () const

## Friends
class | FrameFactory

## Additional Inherited Members
Static Public Member Functions inherited from TagLib::ID3v2::Frame
static Frame * | createTextualFrame (const String &key, const StringList &values)
static unsigned int | headerSize ()
static unsigned int | headerSize (unsigned int version)
static ByteVector | textDelimiter (String::Type t)
static unsigned int | size ()
static unsigned int | size (unsigned int version)
Static Public Attributes inherited from TagLib::ID3v2::Frame
static const String | instrumentPrefix
static const String | commentPrefix
static const String | lyricsPrefix
static const String | urlPrefix
Static Protected Member Functions inherited from TagLib::ID3v2::Frame
static String::Type | checkEncoding (const StringList &fields, String::Type encoding)
static String::Type | checkEncoding (const StringList &fields, String::Type encoding, unsigned int version)
static ByteVector | keyToFrameID (const String &)
static String | frameIDToKey (const ByteVector &)
static String | keyToTXXX (const String &)
static String | txxxToKey (const String &)
static void | splitProperties (const PropertyMap &original, PropertyMap &singleFrameProperties, PropertyMap &tiplProperties, PropertyMap &tmclProperties)

## Detailed Description

An ID3v2 relative volume adjustment frame implementation.

This is an implementation of ID3v2 relative volume adjustment. The presence of this frame makes it possible to specify an increase in volume for an audio file or specific audio tracks in that file.

Multiple relative volume adjustment frames may be present in the tag each with a unique identification and describing volume adjustment for different channel types.

## Member Enumeration Documentation

## ◆ ChannelType

enum TagLib::ID3v2::RelativeVolumeFrame::ChannelType

This indicates the type of volume adjustment that should be applied.

Enumerator
Other | A type not enumerated below.
MasterVolume | The master volume for the track.
FrontRight | The front right audio channel.
FrontLeft | The front left audio channel.
BackRight | The back right audio channel.
BackLeft | The back left audio channel.
FrontCentre | The front center audio channel.
BackCentre | The back center audio channel.
Subwoofer | The subwoofer audio channel.

## Constructor & Destructor Documentation

## ◆ RelativeVolumeFrame() [1/2]

TagLib::ID3v2::RelativeVolumeFrame::RelativeVolumeFrame | ( |  | ) |

Constructs a RelativeVolumeFrame. The relevant data should be set manually.

## ◆ RelativeVolumeFrame() [2/2]

TagLib::ID3v2::RelativeVolumeFrame::RelativeVolumeFrame | ( | const ByteVector & | data | ) |

Constructs a RelativeVolumeFrame based on the contents of data.

## ◆ ~RelativeVolumeFrame()

virtual TagLib::ID3v2::RelativeVolumeFrame::~RelativeVolumeFrame | ( |  | ) |
| virtual

Destroys the RelativeVolumeFrame instance.

## Member Function Documentation

## ◆ channels()

List< ChannelType > TagLib::ID3v2::RelativeVolumeFrame::channels | ( |  | ) | const

Returns a list of channels with information currently in the frame.

## ◆ channelType()

TAGLIB_DEPRECATED ChannelType TagLib::ID3v2::RelativeVolumeFrame::channelType | ( |  | ) | const

Deprecated:
  Always returns master volume.

## ◆ identification()

String TagLib::ID3v2::RelativeVolumeFrame::identification | ( |  | ) | const

Returns the identification for this frame.

## ◆ parseFields()

virtual void TagLib::ID3v2::RelativeVolumeFrame::parseFields | ( | const ByteVector & | data | ) |
| protected virtual

Called by parse() to parse the field data. It makes this information available through the public API. This must be overridden by the subclasses.

Implements TagLib::ID3v2::Frame.

## ◆ peakVolume()

PeakVolume TagLib::ID3v2::RelativeVolumeFrame::peakVolume | ( | ChannelType | type = `MasterVolume` | ) | const

Returns the peak volume (represented as a length and a string of bits).

This defaults to returning the value for the master volume channel if available and returns 0 if the specified channel does not exist.

See also
  setPeakVolume()

## ◆ renderFields()

virtual ByteVector TagLib::ID3v2::RelativeVolumeFrame::renderFields | ( |  | ) | const
| protected virtual

Render the field data back to a binary format in a ByteVector. This must be overridden by subclasses.

Implements TagLib::ID3v2::Frame.

## ◆ setChannelType()

TAGLIB_DEPRECATED void TagLib::ID3v2::RelativeVolumeFrame::setChannelType | ( | ChannelType | t | ) |

Deprecated:
  This method no longer has any effect.

## ◆ setIdentification()

void TagLib::ID3v2::RelativeVolumeFrame::setIdentification | ( | const String & | s | ) |

Sets the identification of the frame to s. The string is used to identify the situation and/or device where this adjustment should apply.

## ◆ setPeakVolume()

void TagLib::ID3v2::RelativeVolumeFrame::setPeakVolume | ( | const PeakVolume & | peak,
|  | ChannelType | type = `MasterVolume`
| ) |  |

Sets the peak volume to peak.

By default this sets the value for the master volume.

See also
  peakVolume()

## ◆ setVolumeAdjustment()

void TagLib::ID3v2::RelativeVolumeFrame::setVolumeAdjustment | ( | float | adjustment,
|  | ChannelType | type = `MasterVolume`
| ) |  |

Set the relative volume adjustment in decibels to adjustment.

By default this sets the value for the master volume.

Note
  Because this is actually stored internally as an "index" to this value the value set by this method may not be identical to the one returned by volumeAdjustment().

See also
  setVolumeAdjustment()
  volumeAdjustmentIndex()

## ◆ setVolumeAdjustmentIndex()

void TagLib::ID3v2::RelativeVolumeFrame::setVolumeAdjustmentIndex | ( | short | index,
|  | ChannelType | type = `MasterVolume`
| ) |  |

Set the volume adjustment to index. As indicated by the ID3v2 standard this is a 16-bit signed integer that reflects the decibels of adjustment when divided by 512.

By default this sets the value for the master volume.

See also
  volumeAdjustmentIndex()
  setVolumeAdjustment()

## ◆ toString()

virtual String TagLib::ID3v2::RelativeVolumeFrame::toString | ( |  | ) | const
| virtual

Returns the frame's identification.

See also
  identification()

Implements TagLib::ID3v2::Frame.

## ◆ volumeAdjustment()

float TagLib::ID3v2::RelativeVolumeFrame::volumeAdjustment | ( | ChannelType | type = `MasterVolume` | ) | const

Returns the relative volume adjustment in decibels.

Note
  Because this is actually stored internally as an "index" to this value the value returned by this method may not be identical to the value set using setVolumeAdjustment().

This defaults to returning the value for the master volume channel if available and returns 0 if the specified channel does not exist.

See also
  setVolumeAdjustment()
  volumeAdjustmentIndex()

## ◆ volumeAdjustmentIndex()

short TagLib::ID3v2::RelativeVolumeFrame::volumeAdjustmentIndex | ( | ChannelType | type = `MasterVolume` | ) | const

Returns the relative volume adjustment "index". As indicated by the ID3v2 standard this is a 16-bit signed integer that reflects the decibels of adjustment when divided by 512.

This defaults to returning the value for the master volume channel if available and returns 0 if the specified channel does not exist.

See also
  setVolumeAdjustmentIndex()
  volumeAdjustment()

## Friends And Related Function Documentation

## ◆ FrameFactory

friend class FrameFactory
| friend

The documentation for this class was generated from the following file:

- relativevolumeframe.h