public class ID3v23FrameBodyEqualization extends ID3v23FrameBody
An equalization frame body is associated with an ID3v2.3 EQUA
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 monkeys who came up with the
ID3v2.3 specification did quite a poor job on this one. Instead of making a nice simple EQ based on the industry standard 32 band graphic equalizers, they tried to solve a problem that didn't exist
and made this as flexible as all humanly possible, which in turn made it unnecessarily complex. The equalization frame body contains the following fields:
Field | Description | |
---|---|---|
1. | numAdjustmentBits | number of bits to use when specifying the levels on the EQ curve. This determines the scale used for the offsets of the points, ie, levels, from the midpoint on the EQ curve. |
2. | levels | list of the points on the EQ curve |
There may be only one equalization frame in an ID3v2.3 tag
.
buffer, dirty, frameType
nextNullTerminatorIndex, nullTerminatorIndex
Constructor and Description |
---|
ID3v23FrameBodyEqualization()
The default constructor is called when creating a new frame.
|
ID3v23FrameBodyEqualization(java.io.InputStream inputStream,
int frameBodySize)
This constructor is called when reading in an existing frame from an .mp3 file.
|
ID3v23FrameBodyEqualization(int numAdjustmentBits,
Level[] levels)
This constructor is called when creating a new frame.
|
ID3v23FrameBodyEqualization(int numAdjustmentBits,
java.util.List<Level> levels)
This constructor is called when creating a new frame.
|
Modifier and Type | Method and Description |
---|---|
java.util.List<Level> |
getLevels()
gets the levels comprising the equalization curve.
|
int |
getNumAdjustmentBits()
gets the number of bits used for the representation of an adjustment in an equalization level.
|
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 |
setLevels(Level[] levels)
sets the levels comprising the equalization curve.
|
void |
setLevels(java.util.List<Level> levels)
sets the levels comprising the equalization curve.
|
void |
setNumAdjustmentBits(int numAdjustmentBits)
sets the number of bits used for the representation of an adjustment in an equalization level.
|
java.lang.String |
toString()
gets a string representation of the equalization frame body showing all of the frame's fields and their values.
|
getFrameType, getNextNullTerminator, getSize, isDirty, save, save
getNextNullTerminator, pricesToString, stringToBytes
bytesToInt, bytesToInt, bytesToShort, bytesToShort, bytesToSynchsafeInt, bytesToSynchsafeShort, formateDate, hex, hex, hex, intToBytes, littleEndianBytesToInt, pad, shortToBytes, synchsafeIntToBytes
public ID3v23FrameBodyEqualization()
public ID3v23FrameBodyEqualization(int numAdjustmentBits, Level[] levels)
numAdjustmentBits
- number of bits used for the representation of the adjustment in an equalization level.levels
- levels comprising the equalization curve.public ID3v23FrameBodyEqualization(int numAdjustmentBits, java.util.List<Level> levels)
numAdjustmentBits
- number of bits used for the representation of the adjustment in an equalization level.levels
- levels comprising the equalization curve.public ID3v23FrameBodyEqualization(java.io.InputStream inputStream, int frameBodySize) throws java.io.IOException
inputStream
- input stream pointing to an equalization frame body in the .mp3 file.frameBodySize
- size (in bytes) of the frame's body.java.io.IOException
- if there is an error while reading the frame body.public int getNumAdjustmentBits()
setNumAdjustmentBits(int)
public void setNumAdjustmentBits(int numAdjustmentBits) throws java.lang.IllegalArgumentException
numAdjustmentBits
- the number of bits used for the representation of an adjustment in an equalization level.java.lang.IllegalArgumentException
- if the number of adjustment bits is less than or equal to 0.getNumAdjustmentBits()
public java.util.List<Level> getLevels()
setLevels(List)
public void setLevels(Level[] levels)
levels
- the levels comprising the equalization curve.getLevels()
public void setLevels(java.util.List<Level> levels)
levels
- the levels comprising the equalization curve.getLevels()
public void parse() throws java.lang.IllegalArgumentException
parse
in class ID3v23FrameBody
java.lang.IllegalArgumentException
- if an invalid value is detected while parsing the frame body's raw bytes.public void setBuffer()
setBuffer
in class ID3v23FrameBody
public java.lang.String toString()
toString
in class java.lang.Object