public class ID3v24FrameBodyPlayCounter extends ID3v24FrameBody
A play counter frame body is associated with an ID3v2.4 PCNT
frame
which is used to count the number of times an .mp3 file has
been played. The value is increased by one every time the file begins to play. The play counter frame body contains the following fields:
Field | Description | |
---|---|---|
1. | counter | number of times the .mp3 file has been played. |
There may only be one play counter frame in each tag.
buffer, dirty, frameType
nextNullTerminatorIndex, nullTerminatorIndex
Constructor and Description |
---|
ID3v24FrameBodyPlayCounter()
The default constructor is called when creating a new frame.
|
ID3v24FrameBodyPlayCounter(java.io.InputStream inputStream,
int frameBodySize)
This constructor is called when reading in an existing frame from an .mp3 file.
|
ID3v24FrameBodyPlayCounter(int counter)
This constructor is called when creating a new frame.
|
Modifier and Type | Method and Description |
---|---|
int |
getCounter()
gets the number of times the song has been played.
|
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 |
setCounter(int counter)
sets the number of times the song has been played.
|
java.lang.String |
toString()
gets a string representation of the play counter 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 ID3v24FrameBodyPlayCounter()
public ID3v24FrameBodyPlayCounter(int counter)
counter
- the number of times the song has been played.public ID3v24FrameBodyPlayCounter(java.io.InputStream inputStream, int frameBodySize) throws java.io.IOException
inputStream
- input stream pointing to a play counter 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 void parse() throws java.lang.IllegalArgumentException
parse
in class ID3v24FrameBody
java.lang.IllegalArgumentException
- if an invalid value is detected while parsing the frame body's raw bytes.public int getCounter()
setCounter(int)
public void setCounter(int counter)
counter
- the number of times the song has been played.getCounter()
public void setBuffer()
setBuffer
in class ID3v24FrameBody
public java.lang.String toString()
toString
in class java.lang.Object