com.beaglebuddy.id3.v24.frame_body

## Class ID3v24FrameBodyEqualization

- 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.ID3v24FrameBodyEqualization

-     public class ID3v24FrameBodyEqualization
      extends ID3v24FrameBody

  An ID3v2.4 equalization frame body is associated with an ID3v2.4 `EQU2` `frame` which is used to specify points on an equalization (EQ) curve. You may specify as many `points` as you want, but typically you specify 16 or 32, much like the 32 band equalizers you can buy for your home stereo. The equalization frame body contains the following fields:

  Equalization Frame Body Fields
  | Field | Description
  --- | --- | ---
  1. | `interpolation method` | method to use when interpolating between points on the EQ curve.
  2. | identification | uniquely identifies the situation and/or device when this eq curve should be applied.
  3. | `levels` | list of the points on the EQ curve.

  There may be more than one equalization frame in an ID3v2.4 `tag`, but only one with the same identification string.

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

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `ID3v24FrameBodyEqualization.InterpolationMethod` valid ID3v2.4 equalization interpolation methods

  - ### 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
    `ID3v24FrameBodyEqualization()` The default constructor is called when creating a new frame.
    `ID3v24FrameBodyEqualization(ID3v24FrameBodyEqualization.InterpolationMethod interpolationMethod, java.lang.String identification, Level[] levels)` This constructor is called when creating a new frame.
    `ID3v24FrameBodyEqualization(ID3v24FrameBodyEqualization.InterpolationMethod interpolationMethod, java.lang.String identification, java.util.List<Level> levels)` This constructor is called when creating a new frame.
    `ID3v24FrameBodyEqualization(java.io.InputStream inputStream, int frameBodySize)` This constructor is called when reading in an existing frame from an .mp3 file.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getIdentification()` get the string which uniquely identifies the situation and/or device where this EQ curve should be applied.
    `ID3v24FrameBodyEqualization.InterpolationMethod` | `getInterpolationMethod()` get the method to use when interpolating between points on the EQ curve.
    `java.util.List<Level>` | `getLevels()` gets the levels comprising the equalization curve.
    `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` | `setIdentification(java.lang.String identification)` set the string which uniquely identifies the situation and/or device where this EQ curve should be applied.
    `void` | `setInterpolationMethod(ID3v24FrameBodyEqualization.InterpolationMethod interpolationMethod)` set the method to use when interpolating between points on the EQ curve.
    `void` | `setLevels(Level[] levels)` sets the levels comprising the equalization curve.
    `void` | `setLevels(java.util.List<Level> levels)` sets the levels comprising the equalization curve.
    `java.lang.String` | `toString()` gets a string representation of the equalization 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, getUTF16String, getUTF8String, 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

    - #### ID3v24FrameBodyEqualization

          public ID3v24FrameBodyEqualization()

      The default constructor is called when creating a new frame. The default values used are:
      - use LINEAR interpolation between points on the EQ curve
      - "standard" EQ curve
      - no levels, ie, a flat EQ curve

    - #### ID3v24FrameBodyEqualization

          public ID3v24FrameBodyEqualization(ID3v24FrameBodyEqualization.InterpolationMethod interpolationMethod,
                                     java.lang.String identification,
                                     Level[] levels)

      This constructor is called when creating a new frame.
      Parameters:
        `interpolationMethod` - method to use when interpolating between points on the EQ curve.
        `identification` - uniquely identifies the situation and/or device when this EQ curve should be applied.
        `levels` - points comprising the equalization curve.

    - #### ID3v24FrameBodyEqualization

          public ID3v24FrameBodyEqualization(ID3v24FrameBodyEqualization.InterpolationMethod interpolationMethod,
                                     java.lang.String identification,
                                     java.util.List<Level> levels)

      This constructor is called when creating a new frame.
      Parameters:
        `interpolationMethod` - method to use when interpolating between points on the EQ curve.
        `identification` - uniquely identifies the situation and/or device when this EQ curve should be applied.
        `levels` - points comprising the equalization curve.

    - #### ID3v24FrameBodyEqualization

          public ID3v24FrameBodyEqualization(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 an equalization 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.

    - #### getInterpolationMethod

          public ID3v24FrameBodyEqualization.InterpolationMethod getInterpolationMethod()

      get the method to use when interpolating between points on the EQ curve.
      Returns:
        the method to use when interpolating between points on the EQ curve.
      See Also:
        `setInterpolationMethod(InterpolationMethod)`

    - #### setInterpolationMethod

          public void setInterpolationMethod(ID3v24FrameBodyEqualization.InterpolationMethod interpolationMethod)

      set the method to use when interpolating between points on the EQ curve.
      Parameters:
        `interpolationMethod` - method to use when interpolating between points on the EQ curve.
      See Also:
        `getInterpolationMethod()`

    - #### getIdentification

          public java.lang.String getIdentification()

      get the string which uniquely identifies the situation and/or device where this EQ curve should be applied.
      Returns:
        the string which uniquely identifies the situation and/or device where this EQ curve should be applied.
      See Also:
        `setIdentification(String)`

    - #### setIdentification

          public void setIdentification(java.lang.String identification)

      set the string which uniquely identifies the situation and/or device where this EQ curve should be applied.
      Parameters:
        `identification` - string which uniquely identifies the situation and/or device where this EQ curve should be applied.
      See Also:
        `getIdentification()`

    - #### getLevels

          public java.util.List<Level> getLevels()

      gets the levels comprising the equalization curve.
      Returns:
        the levels comprising the equalization curve.
      See Also:
        `setLevels(List)`

    - #### setLevels

          public void setLevels(Level[] levels)

      sets the levels comprising the equalization curve.
      Parameters:
        `levels` - the levels comprising the equalization curve.
      See Also:
        `getLevels()`

    - #### setLevels

          public void setLevels(java.util.List<Level> levels)

      sets the levels comprising the equalization curve.
      Parameters:
        `levels` - the levels comprising the equalization curve.
      See Also:
        `getLevels()`

    - #### 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 equalization 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.