com.beaglebuddy.id3.pojo.v24

## Class RelativeVolume

- java.lang.Object
- - com.beaglebuddy.id3.pojo.v24.RelativeVolume

-     public class RelativeVolume
      extends java.lang.Object

  A relative volume specifies the volume level on a particular speaker channel. It contains the following fields.

  Level Fields
  | Field | Description
  --- | --- | ---
  1. | `channel` | the speaker channel whose volume will be adjusted.
  2. | volume | the amount to increase/decrease the volume in db.
  3. | `num bits in peak volume` | the number of bits used to store the peak volume. while the ID3v2.4 spec allows this to be any number between 0 and 255, the Beaglebuddy MP3 library only supports 0 and 32 bit peak volumes.
  4. | peak volume | the peak volume for the given speaker channel.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `RelativeVolume.Channel` valid ID3v2.4 channel types
    `static class` | `RelativeVolume.PeakVolumeSize` Peak Volume sizes supported by the Beaglebuddy MP3 library.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RelativeVolume()` The default constructor is called when creating a relative volume.
    `RelativeVolume(RelativeVolume.Channel channel, double volume, RelativeVolume.PeakVolumeSize peakVolumeSize, int peakVolume)` constructor.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `RelativeVolume.Channel` | `getChannel()` get the speaker channel whose volume is being adjusted.
    `int` | `getPeakVolume()` get the peak volume for this speaker channel.
    `RelativeVolume.PeakVolumeSize` | `getPeakVolumeSize()` set the number of bits used to store the peak volume.
    `double` | `getVolume()` get the volume adjustment (in db) for this speaker channel.
    `void` | `setChannel(RelativeVolume.Channel channel)` set the speaker channel whose volume is being adjusted.
    `void` | `setPeakVolume(int peakVolume)` set the peak volume for this speaker channel.
    `void` | `setPeakVolumeSize(RelativeVolume.PeakVolumeSize peakVolumeSize)` set the number of bits used to store the peak volume.
    `void` | `setVolume(double volume)` set the amount of volume adjustment (in db) for this speaker channel.. Ex: +2.5 db Ex: -3.0 db
    `java.lang.String` | `toString()` get a string representation of a relative volume adjustment.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### RelativeVolume

          public RelativeVolume()

      The default constructor is called when creating a relative volume. The default values used are:
      - other speaker channel
      - 0 db
      - no peak volume

    - #### RelativeVolume

          public RelativeVolume(RelativeVolume.Channel channel,
                        double volume,
                        RelativeVolume.PeakVolumeSize peakVolumeSize,
                        int peakVolume)

      constructor.
      Parameters:
        `channel` - speaker channel
        `volume` - volume (in db)
        `peakVolumeSize` - peak volume size.
        `peakVolume` - peak volume.

  - ### Method Detail

    - #### getChannel

          public RelativeVolume.Channel getChannel()

      get the speaker channel whose volume is being adjusted.
      Returns:
        the speaker channel whose volume is being adjusted.
      See Also:
        `setChannel(Channel)`

    - #### setChannel

          public void setChannel(RelativeVolume.Channel channel)

      set the speaker channel whose volume is being adjusted.
      Parameters:
        `channel` - the speaker channel whose volume is being adjusted.
      See Also:
        `getChannel()`

    - #### getVolume

          public double getVolume()

      get the volume adjustment (in db) for this speaker channel.
      Returns:
        the amount of volume adjustment (in db) for this equalization level.
      See Also:
        `setVolume(double)`

    - #### setVolume

          public void setVolume(double volume)

      set the amount of volume adjustment (in db) for this speaker channel..
      Ex: +2.5 db
      Ex: -3.0 db
      Parameters:
        `volume` - the amount of volume (in db) to adjust this equalization level.
      Throws:
        `java.lang.IllegalArgumentException` - if the volume is not in the range of ±64 db.
      See Also:
        `getVolume()`

    - #### getPeakVolumeSize

          public RelativeVolume.PeakVolumeSize getPeakVolumeSize()

      set the number of bits used to store the peak volume. The monkeys who designed the ID3v2.4 spec thought making the number of bits to store the peak volume was a good idea. The Beaglebuddy MP3 library strongly disagrees and hence has restricted the values to either 0, which means no peak volume, or 32 bits.
      Returns:
        the number of bits used to store the peak volume.
      See Also:
        `setPeakVolumeSize(PeakVolumeSize)`

    - #### setPeakVolumeSize

          public void setPeakVolumeSize(RelativeVolume.PeakVolumeSize peakVolumeSize)

      set the number of bits used to store the peak volume.
      Parameters:
        `peakVolumeSize` - the number of bits used to store the peak volume.
      See Also:
        `getPeakVolumeSize()`

    - #### setPeakVolume

          public void setPeakVolume(int peakVolume)

      set the peak volume for this speaker channel.
      Parameters:
        `peakVolume` - the peak volume for this speaker channel.
      See Also:
        `getPeakVolume()`

    - #### getPeakVolume

          public int getPeakVolume()

      get the peak volume for this speaker channel.
      Returns:
        the peak volume for this speaker channel.
      See Also:
        `setPeakVolume(int)`

    - #### toString

          public java.lang.String toString()

      get a string representation of a relative volume adjustment.
      Overrides:
        `toString` in class `java.lang.Object`
      Returns:
        a string representation of a relative volume adjustment.