Constructors Summary |
---|
public FrameBodyTIPL()Creates a new FrameBodyTIPL datatype.
setObjectValue(DataTypes.OBJ_TEXT_ENCODING, TextEncoding.ISO_8859_1);
|
public FrameBodyTIPL(byte textEncoding, String text)Creates a new FrameBodyTIPL data type.
setObjectValue(DataTypes.OBJ_TEXT_ENCODING, textEncoding);
setText(text);
|
public FrameBodyTIPL(ByteBuffer byteBuffer, int frameSize)Creates a new FrameBodyTIPL data type.
super(byteBuffer, frameSize);
|
public FrameBodyTIPL(FrameBodyIPLS body)Convert from V3 to V4 Frame
setObjectValue(DataTypes.OBJ_TEXT_ENCODING, body.getTextEncoding());
setObjectValue(DataTypes.OBJ_TEXT, body.getPairing());
|
Methods Summary |
---|
public void | addPair(java.lang.String text)Parse text as a null separated pairing of name and function
StringTokenizer stz = new StringTokenizer(text, "\0");
if (stz.countTokens()==2)
{
addPair(stz.nextToken(),stz.nextToken());
}
|
public void | addPair(java.lang.String function, java.lang.String name)Add pair
PairedTextEncodedStringNullTerminated.ValuePairs value = ((PairedTextEncodedStringNullTerminated) getObject(DataTypes.OBJ_TEXT)).getValue();
value.add(function, name);
|
public java.lang.String | getIdentifier()The ID3v2 frame identifier
return ID3v24Frames.FRAME_ID_INVOLVED_PEOPLE;
|
public java.lang.String | getKeyAtIndex(int index)Get key at index
PairedTextEncodedStringNullTerminated text = (PairedTextEncodedStringNullTerminated) getObject(DataTypes.OBJ_TEXT);
return (String) text.getValue().getMapping().get(index).getKey();
|
public int | getNumberOfPairs()
PairedTextEncodedStringNullTerminated text = (PairedTextEncodedStringNullTerminated) getObject(DataTypes.OBJ_TEXT);
return text.getValue().getNumberOfPairs();
|
public PairedTextEncodedStringNullTerminated.ValuePairs | getPairing()
return (PairedTextEncodedStringNullTerminated.ValuePairs) getObject(DataTypes.OBJ_TEXT).getValue();
|
public java.lang.String | getText()
PairedTextEncodedStringNullTerminated text = (PairedTextEncodedStringNullTerminated) getObject(DataTypes.OBJ_TEXT);
StringBuilder sb = new StringBuilder();
int count = 1;
for (Pair entry : text.getValue().getMapping())
{
sb.append(entry.getKey() + '\0" + entry.getValue());
if (count != getNumberOfPairs())
{
sb.append('\0");
}
count++;
}
return sb.toString();
|
public java.lang.String | getUserFriendlyValue()
return getText();
|
public java.lang.String | getValueAtIndex(int index)Get value at index
PairedTextEncodedStringNullTerminated text = (PairedTextEncodedStringNullTerminated) getObject(DataTypes.OBJ_TEXT);
return (String) text.getValue().getMapping().get(index).getValue();
|
public void | resetPairs()Remove all Pairs
PairedTextEncodedStringNullTerminated.ValuePairs value = ((PairedTextEncodedStringNullTerminated) getObject(DataTypes.OBJ_TEXT)).getValue();
value.getMapping().clear();
|
public void | setText(java.lang.String text)Set the text, decoded as pairs of involvee - involvement
PairedTextEncodedStringNullTerminated.ValuePairs value = new PairedTextEncodedStringNullTerminated.ValuePairs();
StringTokenizer stz = new StringTokenizer(text, "\0");
while (stz.hasMoreTokens())
{
String key =stz.nextToken();
if(stz.hasMoreTokens())
{
value.add(key, stz.nextToken());
}
}
setObjectValue(DataTypes.OBJ_TEXT, value);
|
protected void | setupObjectList()Consists of a text encoding , and then a series of null terminated Strings, there should be an even number
of Strings as they are paired as involvement/involvee
objectList.add(new NumberHashMap(DataTypes.OBJ_TEXT_ENCODING, this, TextEncoding.TEXT_ENCODING_FIELD_SIZE));
objectList.add(new PairedTextEncodedStringNullTerminated(DataTypes.OBJ_TEXT, this));
|
public void | write(java.io.ByteArrayOutputStream tagBuffer)Because have a text encoding we need to check the data values do not contain characters that cannot be encoded in
current encoding before we write data. If they do change the encoding.
if (!((PairedTextEncodedStringNullTerminated) getObject(DataTypes.OBJ_TEXT)).canBeEncoded())
{
this.setTextEncoding(TextEncoding.UTF_16);
}
super.write(tagBuffer);
|