org.farng.mp3.id3.FrameBodyPCNT Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jid3lib Show documentation
Show all versions of jid3lib Show documentation
This library reads song information, such as song title, artist, and album, from an MP3 file. It supports ID3v1, ID3v1.1, Lyrics3v1, Lyrics3v2, ID3v2.2, ID3v2.3, and ID3v2.4 tags. MP3 Frame Headers can also be read. There is a FilenameTag, a ID3v2.4 tag that is intelligently derived from the file name. It contains tag synchronization utilities, multiple save options, and easy tag conversion methods.
The newest version!
package org.farng.mp3.id3;
import org.farng.mp3.InvalidTagException;
import org.farng.mp3.object.ObjectNumberVariableLength;
import java.io.IOException;
import java.io.RandomAccessFile;
/**
* 4.16. Play counter
*
* This is simply a counter of the number of times a file has been
*
* played. The value is increased by one every time the file begins to
play. There may
* only be one "PCNT" frame in each tag. When the
counter reaches all one's, one byte is
* inserted in front of the
counter thus making the counter eight bits bigger. The counter
* must
*
* be at least 32-bits long to begin with.
*
* <Header for 'Play counter', ID: "PCNT">
* Counter $xx xx xx xx (xx ...)
*
* @author Eric Farng
* @version $Revision: 1.4 $
*/
public class FrameBodyPCNT extends AbstractID3v2FrameBody {
/**
* Creates a new FrameBodyPCNT object.
*/
public FrameBodyPCNT() {
super();
}
/**
* Creates a new FrameBodyPCNT object.
*/
public FrameBodyPCNT(final FrameBodyPCNT body) {
super(body);
}
/**
* Creates a new FrameBodyPCNT object.
*/
public FrameBodyPCNT(final long counter) {
setObject("Counter", new Long(counter));
}
/**
* Creates a new FrameBodyPCNT object.
*/
public FrameBodyPCNT(final RandomAccessFile file) throws IOException, InvalidTagException {
this.read(file);
}
public String getIdentifier() {
return "PCNT";
}
protected void setupObjectList() {
appendToObjectList(new ObjectNumberVariableLength("Counter", 4));
}
}