FrameBodyPOPMpublic class FrameBodyPOPM extends AbstractID3v2FrameBody implements ID3v24FrameBody, ID3v23FrameBodyPopularimeter 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:
|
Fields Summary |
---|
private static final int | RATING_FIELD_SIZE | private static final int | COUNTER_MINIMUM_FIELD_SIZE | public static final String | MEDIA_MONKEY_NO_EMAIL |
Constructors Summary |
---|
public FrameBodyPOPM()Creates a new FrameBodyPOPM datatype.
this.setObjectValue(DataTypes.OBJ_EMAIL, "");
this.setObjectValue(DataTypes.OBJ_RATING, (long) 0);
this.setObjectValue(DataTypes.OBJ_COUNTER, (long) 0);
| public FrameBodyPOPM(FrameBodyPOPM body)
super(body);
| public FrameBodyPOPM(String emailToUser, long rating, long counter)Creates a new FrameBodyPOPM datatype.
this.setObjectValue(DataTypes.OBJ_EMAIL, emailToUser);
this.setObjectValue(DataTypes.OBJ_RATING, rating);
this.setObjectValue(DataTypes.OBJ_COUNTER, counter);
| public FrameBodyPOPM(ByteBuffer byteBuffer, int frameSize)Creates a new FrameBodyPOPM datatype.
super(byteBuffer, frameSize);
|
Methods Summary |
---|
public long | getCounter()
return ((Number) getObjectValue(DataTypes.OBJ_COUNTER)).longValue();
| public java.lang.String | getEmailToUser()
return (String) getObjectValue(DataTypes.OBJ_EMAIL);
| public java.lang.String | getIdentifier()The ID3v2 frame identifier
return ID3v24Frames.FRAME_ID_POPULARIMETER;
| public long | getRating()
return ((Number) getObjectValue(DataTypes.OBJ_RATING)).longValue();
| public java.lang.String | getUserFriendlyValue()
return getEmailToUser()+":"+getRating()+":"+getCounter();
| public void | parseString(java.lang.String data)
try
{
int value = Integer.parseInt(data);
setRating(value);
setEmailToUser(MEDIA_MONKEY_NO_EMAIL);
}
catch(NumberFormatException nfe)
{
}
| public void | setCounter(long counter)Set the play counter of this file
setObjectValue(DataTypes.OBJ_COUNTER, counter);
| public void | setEmailToUser(java.lang.String description)
setObjectValue(DataTypes.OBJ_EMAIL, description);
| public void | setRating(long rating)Set the rating given to this file
setObjectValue(DataTypes.OBJ_RATING, rating);
| protected void | setupObjectList()
objectList.add(new StringNullTerminated(DataTypes.OBJ_EMAIL, this));
objectList.add(new NumberFixedLength(DataTypes.OBJ_RATING, this, RATING_FIELD_SIZE));
objectList.add(new NumberVariableLength(DataTypes.OBJ_COUNTER, this, COUNTER_MINIMUM_FIELD_SIZE));
|
|