FileDocCategorySizeDatePackage
FrameBodyPCNT.javaAPI DocJaudiotagger 2.0.43880Wed Mar 30 16:12:02 BST 2011org.jaudiotagger.tag.id3.framebody

FrameBodyPCNT

public class FrameBodyPCNT extends AbstractID3v2FrameBody implements ID3v24FrameBody, ID3v23FrameBody
Play counter frame.

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

For more details, please refer to the ID3 specifications:

author
: Paul Taylor
author
: Eric Farng
version
$Id: FrameBodyPCNT.java 832 2009-11-12 13:25:38Z paultaylor $

Fields Summary
private static final int
COUNTER_MINIMUM_FIELD_SIZE
Constructors Summary
public FrameBodyPCNT()
Creates a new FrameBodyPCNT datatype.


              
     
    
        this.setObjectValue(DataTypes.OBJ_NUMBER, 0L);
    
public FrameBodyPCNT(FrameBodyPCNT body)

        super(body);
    
public FrameBodyPCNT(long counter)
Creates a new FrameBodyPCNT datatype.

param
counter

        this.setObjectValue(DataTypes.OBJ_NUMBER, counter);
    
public FrameBodyPCNT(ByteBuffer byteBuffer, int frameSize)
Creates a new FrameBodyPCNT datatype.

param
byteBuffer
param
frameSize
throws
InvalidTagException if unable to create framebody from buffer

        super(byteBuffer, frameSize);
    
Methods Summary
public longgetCounter()

return
the play count of this file

        return ((Number) getObjectValue(DataTypes.OBJ_NUMBER)).longValue();
    
public java.lang.StringgetIdentifier()
The ID3v2 frame identifier

return
the ID3v2 frame identifier for this frame type

        return ID3v24Frames.FRAME_ID_PLAY_COUNTER;
    
public voidsetCounter(long counter)
Set the play counter of this file

param
counter

        setObjectValue(DataTypes.OBJ_NUMBER, counter);
    
protected voidsetupObjectList()

        objectList.add(new NumberVariableLength(DataTypes.OBJ_NUMBER, this, COUNTER_MINIMUM_FIELD_SIZE));