org.jaudiotagger.tag.id3.framebody
Class FrameBodyPOPM

java.lang.Object
  extended by org.jaudiotagger.tag.id3.AbstractTagItem
      extended by org.jaudiotagger.tag.id3.AbstractTagFrameBody
          extended by org.jaudiotagger.tag.id3.framebody.AbstractID3v2FrameBody
              extended by org.jaudiotagger.tag.id3.framebody.FrameBodyPOPM
All Implemented Interfaces:
ID3v23FrameBody, ID3v24FrameBody

public class FrameBodyPOPM
extends AbstractID3v2FrameBody
implements ID3v24FrameBody, ID3v23FrameBody

Popularimeter frame.

The purpose of this frame is to specify how good an audio file is. Many interesting applications could be found to this frame such as a playlist that features better audiofiles more often than others or it could be used to profile a person's taste and find other 'good' files by comparing people's profiles. The frame is very simple. It contains the email address to the user, one rating byte and a four byte play counter, intended to be increased with one for every time the file is played. The email is a terminated string. The rating is 1-255 where 1 is worst and 255 is best. 0 is unknown. If no personal counter is wanted it may be omitted. When the counter reaches all one's, one byte is inserted in front of the counter thus making the counter eight bits bigger in the same away as the play counter ("PCNT"). There may be more than one "POPM" frame in each tag, but only one with the same email address.

<Header for 'Popularimeter', ID: "POPM">
Email to user<text string> $00
Rating $xx
Counter $xx xx xx xx (xx ...)

For more details, please refer to the ID3 specifications:

Version:
$Id: FrameBodyPOPM.java,v 1.16 2009/11/12 13:25:22 paultaylor Exp $
Author:
: Paul Taylor, : Eric Farng

Field Summary
private static int COUNTER_MINIMUM_FIELD_SIZE
           
private static int RATING_FIELD_SIZE
           
 
Fields inherited from class org.jaudiotagger.tag.id3.framebody.AbstractID3v2FrameBody
TYPE_BODY
 
Fields inherited from class org.jaudiotagger.tag.id3.AbstractTagFrameBody
objectList
 
Fields inherited from class org.jaudiotagger.tag.id3.AbstractTagItem
logger
 
Constructor Summary
FrameBodyPOPM()
          Creates a new FrameBodyPOPM datatype.
FrameBodyPOPM(java.nio.ByteBuffer byteBuffer, int frameSize)
          Creates a new FrameBodyPOPM datatype.
FrameBodyPOPM(FrameBodyPOPM body)
           
FrameBodyPOPM(java.lang.String emailToUser, long rating, long counter)
          Creates a new FrameBodyPOPM datatype.
 
Method Summary
 long getCounter()
           
 java.lang.String getEmailToUser()
           
 java.lang.String getIdentifier()
          The ID3v2 frame identifier
 long getRating()
           
 void setCounter(long counter)
          Set the play counter of this file
 void setEmailToUser(java.lang.String description)
           
 void setRating(long rating)
          Set the rating given to this file
protected  void setupObjectList()
          Create the list of Datatypes that this body expects in the correct order This method needs to be implemented by concrete subclasses
 
Methods inherited from class org.jaudiotagger.tag.id3.framebody.AbstractID3v2FrameBody
createStructure, equals, getSize, read, setSize, setSize, write
 
Methods inherited from class org.jaudiotagger.tag.id3.AbstractTagFrameBody
getBriefDescription, getHeader, getLongDescription, getObject, getObjectValue, getTextEncoding, isSubsetOf, iterator, setHeader, setObjectValue, setTextEncoding, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RATING_FIELD_SIZE

private static final int RATING_FIELD_SIZE
See Also:
Constant Field Values

COUNTER_MINIMUM_FIELD_SIZE

private static final int COUNTER_MINIMUM_FIELD_SIZE
See Also:
Constant Field Values
Constructor Detail

FrameBodyPOPM

public FrameBodyPOPM()
Creates a new FrameBodyPOPM datatype.


FrameBodyPOPM

public FrameBodyPOPM(FrameBodyPOPM body)

FrameBodyPOPM

public FrameBodyPOPM(java.lang.String emailToUser,
                     long rating,
                     long counter)
Creates a new FrameBodyPOPM datatype.

Parameters:
emailToUser -
rating -
counter -

FrameBodyPOPM

public FrameBodyPOPM(java.nio.ByteBuffer byteBuffer,
                     int frameSize)
              throws InvalidTagException
Creates a new FrameBodyPOPM datatype.

Parameters:
byteBuffer -
frameSize -
Throws:
InvalidTagException - if unable to create framebody from buffer
Method Detail

setEmailToUser

public void setEmailToUser(java.lang.String description)
Parameters:
description -

getEmailToUser

public java.lang.String getEmailToUser()
Returns:
the memail of the user who rated this

getRating

public long getRating()
Returns:
the rating given to this file

setRating

public void setRating(long rating)
Set the rating given to this file

Parameters:
rating -

getCounter

public long getCounter()
Returns:
the play count of this file

setCounter

public void setCounter(long counter)
Set the play counter of this file

Parameters:
counter -

getIdentifier

public java.lang.String getIdentifier()
The ID3v2 frame identifier

Specified by:
getIdentifier in class AbstractID3v2FrameBody
Returns:
the ID3v2 frame identifier for this frame type

setupObjectList

protected void setupObjectList()
Description copied from class: AbstractTagFrameBody
Create the list of Datatypes that this body expects in the correct order This method needs to be implemented by concrete subclasses

Specified by:
setupObjectList in class AbstractTagFrameBody