package org.farng.mp3.id3; import java.io.IOException; import java.io.RandomAccessFile; import org.farng.mp3.InvalidTagException; import org.farng.mp3.object.ObjectNumberVariableLength; /** * <h3>4.16.   Play counter</h3> * <p/> * <p>   This is simply a counter of the number of times a file has been<br> * <p/> *    played. The value is increased by one every time the file begins to<br>    play. There may * only be one "PCNT" frame in each tag. When the<br>    counter reaches all one's, one byte is * inserted in front of the<br>    counter thus making the counter eight bits bigger.  The counter * must<br> * <p/> *    be at least 32-bits long to begin with.</p> * <p/> * <p>     <Header for 'Play counter', ID: "PCNT"><br>      * Counter        $xx xx xx xx (xx ...)<br> </p> * * @author Eric Farng * @version $Revision: 2374 $ */ 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)); } }