com.beaglebuddy.id3.v24.frame_body

## Class ID3v24FrameBodyReverb

- java.lang.Object
- - com.beaglebuddy.util.Utility
  - - com.beaglebuddy.id3.v24.frame_body.ID3v24FrameBodyUtility
    - - com.beaglebuddy.id3.v24.frame_body.ID3v24FrameBody
      - - com.beaglebuddy.id3.v24.frame_body.ID3v24FrameBodyReverb

-     public class ID3v24FrameBodyReverb
      extends ID3v24FrameBody

  A reverb frame body is associated with an ID3v2.4 `RVRB` `frame` which is used to adjust echoes of different kinds when the .mp3 file is played. The reverb frame body contains the following fields:

  Reverb Frame Body Fields
  | Field | Description
  --- | --- | ---
  1. | left | the delay between every bounce (in ms) on the left channel
  2. | right | the delay between every bounce (in ms) on the right channel
  3. | leftBounces | the number of bounces that should be made for the reverb on the left channel. (0x00 == 0 bounces, 0xFF == an infinite number of bounces)
  4. | rightBounces | the number of bounces that should be made for the reverb on the right channel. (0x00 == 0 bounces, 0xFF == an infinite number of bounces)
  5. | feedbackLeftToLeft | the volume that should be returned to the next echo bounce. 0x00 is 0%, 0xFF is 100%.
  6. | feedbackLeftToRight | if this value were 0x7F, there would be 50% volume reduction on the first bounce, 50% of that on the second and so on.
  7. | feedbackRightToRight | left to right means the first bounce is heard on the left channel, the second bounce on the right channel, and so on.
  8. | feedbackRightToLeft | right to left means the first bounce is heard on the right channel, the second bounce on the left channel, and so on.
  9. | premixLeftToRight | the amount of left sound to be mixed in the right before any reverb is applied, where 0x00 id 0% and 0xFF is 100%.
  10. | premixRightToLeft | setting both premix to 0xFF would result in a mono output (if the reverb is applied symmetric).

  There may only be one reverb frame in an ID3v2.4 `tag`.

  See Also:
    `ID3v24Frame`, ID3 tag version 2.4.0 standard, wikipedia history of ID3 tags

- - ### Field Summary

    - ### Fields inherited from class com.beaglebuddy.id3.v24.frame_body.ID3v24FrameBody

      `buffer, dirty, frameType`

    - ### Fields inherited from class com.beaglebuddy.id3.v24.frame_body.ID3v24FrameBodyUtility

      `nextNullTerminatorIndex, nullTerminatorIndex`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ID3v24FrameBodyReverb()` The default constructor is called when creating a new frame.
    `ID3v24FrameBodyReverb(java.io.InputStream inputStream, int frameBodySize)` This constructor is called when reading in an existing frame from an .mp3 file.
    `ID3v24FrameBodyReverb(int left, int right, byte leftBounces, byte rightBounces, byte feedbackLeftToLeft, byte feedbackLeftToRight, byte feedbackRightToRight, byte feedbackRightToLeft, byte premixLeftToRight, byte premixRightToLeft)` This constructor is called when creating a new frame.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `byte` | `getFeedbackLeftToLeft()` gets the left to left feedback, which is the volume that should be returned to the next echo bounce on the left channel.
    `byte` | `getFeedbackLeftToRight()` gets the left to right feedback, which is the volume that should be returned to the next echo bounce.
    `byte` | `getFeedbackRightToLeft()` gets the right to left feedback, which is the volume that should be returned to the next echo bounce.
    `byte` | `getFeedbackRightToRight()` sets the right to right feedback, which is the volume that should be returned to the next echo bounce on the right channel.
    `int` | `getLeft()` gets the amount of reverb in the left channel.
    `byte` | `getLeftBounces()` gets the number of bounces that should be made for the reverb on the left channel.
    `byte` | `getPremixLeftToRight()` gets the amount of left sound to be mixed in the right before any reverb is applied, where 0x00 id 0% and 0xFF is 100%.
    `byte` | `getPremixRightToLeft()` gets the amount of right sound to be mixed in the left before any reverb is applied, where 0x00 id 0% and 0xFF is 100%.
    `int` | `getRight()` gets the amount of reverb in the right channel.
    `byte` | `getRightBounces()` gets the number of bounces that should be made for the reverb on the right channel.
    `void` | `parse()` parses the raw bytes of the frame body and stores the parsed values in the frame's fields.
    `void` | `setBuffer()` If the frame body's values have been modified, then resize the raw binary buffer and store the new values there.
    `void` | `setFeedbackLeftToLeft(byte feedbackLeftToLeft)` sets the left to left feedback, which is the volume that should be returned to the next echo bounce on the left channel.
    `void` | `setFeedbackLeftToRight(byte feedbackLeftToRight)` sets the left to right feedback, which is the volume that should be returned to the next echo bounce.
    `void` | `setFeedbackRightToLeft(byte feedbackRightToLeft)` sets the right to left feedback, which is the volume that should be returned to the next echo bounce.
    `void` | `setFeedbackRightToRight(byte feedbackRightToRight)` sets the right to right feedback, which is the volume that should be returned to the next echo bounce on the right channel.
    `void` | `setLeft(int left)` sets the delay between every bounce (in ms) on the left channel.
    `void` | `setLeftBounces(byte leftBounces)` sets the number of bounces that should be made for the reverb on the left channel.
    `void` | `setPremixLeftToRight(byte premixLeftToRight)` sets the amount of left sound to be mixed in the right before any reverb is applied, where 0x00 id 0% and 0xFF is 100%.
    `void` | `setPremixRightToLeft(byte premixRightToLeft)` gets the amount of right sound to be mixed in the left before any reverb is applied, where 0x00 id 0% and 0xFF is 100%.
    `void` | `setRight(int right)` sets the delay between every bounce (in ms) on the right channel.
    `void` | `setRightBounces(byte rightBounces)` sets the number of bounces that should be made for the reverb on the right channel.
    `java.lang.String` | `toString()` gets a string representation of the reverb frame body showing all of the frame's fields and their values.

    - ### Methods inherited from class com.beaglebuddy.id3.v24.frame_body.ID3v24FrameBody

      `getFrameType, getNextNullTerminator, getSize, isDirty, save, save`

    - ### Methods inherited from class com.beaglebuddy.id3.v24.frame_body.ID3v24FrameBodyUtility

      `getNextNullTerminator, pricesToString, stringToBytes`

    - ### Methods inherited from class com.beaglebuddy.util.Utility

      `bytesToInt, bytesToInt, bytesToShort, bytesToShort, bytesToSynchsafeInt, bytesToSynchsafeShort, formateDate, hex, hex, hex, intToBytes, littleEndianBytesToInt, pad, shortToBytes, synchsafeIntToBytes`

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

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

- - ### Constructor Detail

    - #### ID3v24FrameBodyReverb

          public ID3v24FrameBodyReverb()

      The default constructor is called when creating a new frame. The default values used are:
      - 0 left
      - 0 right
      - 0 left bounces
      - 0 right bounces
      - 0 feedback left to left
      - 0 feedback left to right
      - 0 feedback right to right
      - 0 feedback right to left
      - 0 premix left to right
      - 0 premix right to left

    - #### ID3v24FrameBodyReverb

          public ID3v24FrameBodyReverb(int left,
                               int right,
                               byte leftBounces,
                               byte rightBounces,
                               byte feedbackLeftToLeft,
                               byte feedbackLeftToRight,
                               byte feedbackRightToRight,
                               byte feedbackRightToLeft,
                               byte premixLeftToRight,
                               byte premixRightToLeft)

      This constructor is called when creating a new frame.
      Parameters:
        `left` - the delay between every bounce (in ms) on the left channel
        `right` - the delay between every bounce (in ms) on the right channel
        `leftBounces` - the number of bounces that should be made for the reverb on the left channel. (0x00 == 0, 0xFF == an infinite number of bounces)
        `rightBounces` - the number of bounces that should be made for the reverb on the right channel. (0x00 == 0, 0xFF == an infinite number of bounces)
        `feedbackLeftToLeft` - the volume that should be returned to the next echo bounce. 0x00 is 0%, $FF is 100%.
        `feedbackLeftToRight` - if this value were 0x7F, there would be 50% volume reduction on the first bounce, 50% of that on the second and so on.
        `feedbackRightToRight` - left to right means the first bounce is heard on the left channel, the second bounce on the right channel, and so on.
        `feedbackRightToLeft` - right to left means the first bounce is heard on the right channel, the second bounce on the left channel, and so on.
        `premixLeftToRight` - the amount of left sound to be mixed in the right before any reverb is applied, where 0x00 id 0% and 0xFF is 100%.
        `premixRightToLeft` - setting both premix to $FF would result in a mono output (if the reverb is applied symmetric).

    - #### ID3v24FrameBodyReverb

          public ID3v24FrameBodyReverb(java.io.InputStream inputStream,
                               int frameBodySize)
                                throws java.io.IOException

      This constructor is called when reading in an existing frame from an .mp3 file. This is then followed by a call to the parse() method.
      Parameters:
        `inputStream` - input stream pointing to a reverb frame body in the .mp3 file.
        `frameBodySize` - size (in bytes) of the frame's body.
      Throws:
        `java.io.IOException` - if there is an error while reading the frame body.

  - ### Method Detail

    - #### parse

          public void parse()
                     throws java.lang.IllegalArgumentException

      parses the raw bytes of the frame body and stores the parsed values in the frame's fields.
      Overrides:
        `parse` in class `ID3v24FrameBody`
      Throws:
        `java.lang.IllegalArgumentException` - if an invalid value is detected while parsing the frame body's raw bytes.

    - #### getLeft

          public int getLeft()

      gets the amount of reverb in the left channel.
      Returns:
        the amount of reverb in the left channel.
      See Also:
        `setLeft(int)`, `getRight()`

    - #### setLeft

          public void setLeft(int left)

      sets the delay between every bounce (in ms) on the left channel.
      Parameters:
        `left` - the amount of reverb in the left channel.
      See Also:
        `getLeft()`, `setRight(int)`

    - #### getRight

          public int getRight()

      gets the amount of reverb in the right channel.
      Returns:
        the amount of reverb in the right channel.
      See Also:
        `setRight(int)`, `getLeft()`

    - #### setRight

          public void setRight(int right)

      sets the delay between every bounce (in ms) on the right channel.
      Parameters:
        `right` - the amount of reverb in the right channel.
      See Also:
        `getRight()`, `setLeft(int)`

    - #### getLeftBounces

          public byte getLeftBounces()

      gets the number of bounces that should be made for the reverb on the left channel.
      Returns:
        the number of bounces that should be made for the reverb on the left channel.
      See Also:
        `setLeftBounces(byte)`, `getRightBounces()`

    - #### setLeftBounces

          public void setLeftBounces(byte leftBounces)

      sets the number of bounces that should be made for the reverb on the left channel.
      Parameters:
        `leftBounces` - the number of bounces where 0x00 == 0 bounces and 0xFF == an infinite number of bounces.
      See Also:
        `getLeftBounces()`, `setRightBounces(byte)`

    - #### getRightBounces

          public byte getRightBounces()

      gets the number of bounces that should be made for the reverb on the right channel.
      Returns:
        the number of bounces that should be made for the reverb on the right channel.
      See Also:
        `setRightBounces(byte)`, `getLeftBounces()`

    - #### setRightBounces

          public void setRightBounces(byte rightBounces)

      sets the number of bounces that should be made for the reverb on the right channel.
      Parameters:
        `rightBounces` - the number of bounces where 0x00 == 0 bounces and 0xFF == an infinite number of bounces.
      See Also:
        `getRightBounces()`, `setLeftBounces(byte)`

    - #### getFeedbackLeftToLeft

          public byte getFeedbackLeftToLeft()

      gets the left to left feedback, which is the volume that should be returned to the next echo bounce on the left channel. 0x00 is 0%, 0x7F is 50%, and 0xFF is 100%. If this value were 0x7F, there would be 50% volume reduction on the first bounce, 50% of that on the second and so on.
      Returns:
        the left to left feedback.
      See Also:
        `setFeedbackLeftToLeft(byte)`

    - #### setFeedbackLeftToLeft

          public void setFeedbackLeftToLeft(byte feedbackLeftToLeft)

      sets the left to left feedback, which is the volume that should be returned to the next echo bounce on the left channel. 0x00 is 0%, 0x7F is 50%, 0xFF is 100%. If this value were 0x7F, there would be 50% volume reduction on the first bounce, 50% of that on the second and so on.
      Parameters:
        `feedbackLeftToLeft` - the volume that should be returned to the next echo bounce on the left channel.
      See Also:
        `getFeedbackLeftToRight()`

    - #### getFeedbackLeftToRight

          public byte getFeedbackLeftToRight()

      gets the left to right feedback, which is the volume that should be returned to the next echo bounce. 0x00 is 0%, 0x7F is 50%, 0xFF is 100%. If this value were 0x7F, there would be 50% volume reduction on the first bounce, 50% of that on the second and so on. left to right means the first bounce is heard on the left channel, the second bounce on the right channel, and so on.
      Returns:
        the left to right feedback.
      See Also:
        `setFeedbackLeftToRight(byte)`

    - #### setFeedbackLeftToRight

          public void setFeedbackLeftToRight(byte feedbackLeftToRight)

      sets the left to right feedback, which is the volume that should be returned to the next echo bounce. 0x00 is 0%, 0x7F is 50%, 0xFF is 100%. If this value were 0x7F, there would be 50% volume reduction on the first bounce, 50% of that on the second and so on. left to right means the first bounce is heard on the left channel, the second bounce on the right channel, and so on.
      Parameters:
        `feedbackLeftToRight` - the volume that should be returned to the next echo bounce. 0x00 is 0%, 0x7F is 50%, 0xFF is 100%.
      See Also:
        `getFeedbackLeftToRight()`

    - #### getFeedbackRightToRight

          public byte getFeedbackRightToRight()

      sets the right to right feedback, which is the volume that should be returned to the next echo bounce on the right channel. 0x00 is 0%, 0x7F is 50%, and 0xFF is 100%. If this value were 0x7F, there would be 50% volume reduction on the first bounce, 50% of that on the second and so on.
      Returns:
        the right to right feedback.
      See Also:
        `setFeedbackRightToRight(byte)`

    - #### setFeedbackRightToRight

          public void setFeedbackRightToRight(byte feedbackRightToRight)

      sets the right to right feedback, which is the volume that should be returned to the next echo bounce on the right channel. 0x00 is 0%, 0xFF is 100%.
      Parameters:
        `feedbackRightToRight` - the volume that should be returned to the next echo bounce on the right channel. 0x00 is 0%, $FF is 100%.
      See Also:
        `getFeedbackRightToRight()`

    - #### getFeedbackRightToLeft

          public byte getFeedbackRightToLeft()

      gets the right to left feedback, which is the volume that should be returned to the next echo bounce. 0x00 is 0%, 0x7F is 50%, 0xFF is 100%. If this value were 0x7F, there would be 50% volume reduction on the first bounce, 50% of that on the second and so on. right to left means the first bounce is heard on the right channel, the second bounce on the left channel, and so on.
      Returns:
        the right to left feedback.

    - #### setFeedbackRightToLeft

          public void setFeedbackRightToLeft(byte feedbackRightToLeft)

      sets the right to left feedback, which is the volume that should be returned to the next echo bounce. 0x00 is 0%, 0x7F is 50%, 0xFF is 100%. If this value were 0x7F, there would be 50% volume reduction on the first bounce, 50% of that on the second and so on. right to left means the first bounce is heard on the right channel, the second bounce on the left channel, and so on.
      Parameters:
        `feedbackRightToLeft` - the volume that should be returned to the next echo bounce. 0x00 is 0%, 0x7F is 50%, 0xFF is 100%.

    - #### getPremixLeftToRight

          public byte getPremixLeftToRight()

      gets the amount of left sound to be mixed in the right before any reverb is applied, where 0x00 id 0% and 0xFF is 100%. setting both premix to 0xFF would result in a mono output (if the reverb is applied symmetric).
      Returns:
        the amount of left sound to be mixed in the right before any reverb is applied.

    - #### setPremixLeftToRight

          public void setPremixLeftToRight(byte premixLeftToRight)

      sets the amount of left sound to be mixed in the right before any reverb is applied, where 0x00 id 0% and 0xFF is 100%. setting both premix to 0xFF would result in a mono output (if the reverb is applied symmetric).
      Parameters:
        `premixLeftToRight` - the amount of left sound to be mixed in the right before any reverb is applied, where 0x00 id 0% and 0xFF is 100%.

    - #### getPremixRightToLeft

          public byte getPremixRightToLeft()

      gets the amount of right sound to be mixed in the left before any reverb is applied, where 0x00 id 0% and 0xFF is 100%. setting both premix to 0xFF would result in a mono output (if the reverb is applied symmetric).
      Returns:
        the amount of right sound to be mixed in the left before any reverb is applied.

    - #### setPremixRightToLeft

          public void setPremixRightToLeft(byte premixRightToLeft)

      gets the amount of right sound to be mixed in the left before any reverb is applied, where 0x00 id 0% and 0xFF is 100%. setting both premix to 0xFF would result in a mono output (if the reverb is applied symmetric).
      Parameters:
        `premixRightToLeft` - the amount of right sound to be mixed in the left before any reverb is applied, where 0x00 id 0% and 0xFF is 100%.

    - #### setBuffer

          public void setBuffer()

      If the frame body's values have been modified, then resize the raw binary buffer and store the new values there. When finished, the dirty flag is reset to indicate that the buffer is up to date, and the frame is now ready to be saved to the .mp3 file.
      Overrides:
        `setBuffer` in class `ID3v24FrameBody`

    - #### toString

          public java.lang.String toString()

      gets a string representation of the reverb frame body showing all of the frame's fields and their values.
      Overrides:
        `toString` in class `java.lang.Object`
      Returns:
        a string representation of the frame body.