FrameBodyUSLTpublic class FrameBodyUSLT extends AbstractID3v2FrameBody implements ID3v24FrameBody, ID3v23FrameBodyUnsychronised lyrics/text transcription frame.
This frame contains the lyrics of the song or a text transcription of other vocal activities. The head includes an
encoding descriptor and a content descriptor. The body consists of the actual text. The 'Content descriptor' is a
terminated string. If no descriptor is entered, 'Content descriptor' is $00 (00) only. Newline characters are
allowed in the text. There may be more than one 'Unsynchronised lyrics/text transcription' frame in each tag, but
only one with the same language and content descriptor.
<Header for 'Unsynchronised lyrics/text transcription', ID: "USLT"> |
Text encoding | $xx |
Language | $xx xx xx |
Content descriptor | <text string according to encoding> $00 (00) |
Lyrics/text | <full text string according to encoding> |
You can retrieve the first value without the null terminator using {@link #getFirstTextValue}
For more details, please refer to the ID3 specifications:
|
Constructors Summary |
---|
public FrameBodyUSLT()Creates a new FrameBodyUSLT dataType.
setObjectValue(DataTypes.OBJ_TEXT_ENCODING, TextEncoding.ISO_8859_1);
setObjectValue(DataTypes.OBJ_LANGUAGE, "");
setObjectValue(DataTypes.OBJ_DESCRIPTION, "");
setObjectValue(DataTypes.OBJ_LYRICS, "");
| public FrameBodyUSLT(FrameBodyUSLT body)Copy constructor
super(body);
| public FrameBodyUSLT(byte textEncoding, String language, String description, String text)Creates a new FrameBodyUSLT datatype.
setObjectValue(DataTypes.OBJ_TEXT_ENCODING, textEncoding);
setObjectValue(DataTypes.OBJ_LANGUAGE, language);
setObjectValue(DataTypes.OBJ_DESCRIPTION, description);
setObjectValue(DataTypes.OBJ_LYRICS, text);
| public FrameBodyUSLT(ByteBuffer byteBuffer, int frameSize)Creates a new FrameBodyUSLT datatype, populated from buffer
super(byteBuffer, frameSize);
|
Methods Summary |
---|
public void | addLyric(java.lang.String text)Add additional lyric to the lyric field
setLyric(getLyric() + text);
| public void | addLyric(Lyrics3Line line)
setLyric(getLyric() + line.writeString());
| public java.lang.String | getDescription()Get a description field
return (String) getObjectValue(DataTypes.OBJ_DESCRIPTION);
| public java.lang.String | getFirstTextValue()Get first value
TextEncodedStringSizeTerminated text = (TextEncodedStringSizeTerminated) getObject(DataTypes.OBJ_LYRICS);
return text.getValueAtIndex(0);
| public java.lang.String | getIdentifier()The ID3v2 frame identifier
return ID3v24Frames.FRAME_ID_UNSYNC_LYRICS;
| public java.lang.String | getLanguage()Get the language field
return (String) getObjectValue(DataTypes.OBJ_LANGUAGE);
| public java.lang.String | getLyric()Get the lyric field
return (String) getObjectValue(DataTypes.OBJ_LYRICS);
| public java.lang.String | getUserFriendlyValue()
return getFirstTextValue();
| public void | setDescription(java.lang.String description)Set a description field
setObjectValue(DataTypes.OBJ_DESCRIPTION, description);
| public void | setLanguage(java.lang.String language)Set the language field
setObjectValue(DataTypes.OBJ_LANGUAGE, language);
| public void | setLyric(java.lang.String lyric)Set the lyric field
setObjectValue(DataTypes.OBJ_LYRICS, lyric);
| protected void | setupObjectList()
objectList.add(new NumberHashMap(DataTypes.OBJ_TEXT_ENCODING, this, TextEncoding.TEXT_ENCODING_FIELD_SIZE));
objectList.add(new StringHashMap(DataTypes.OBJ_LANGUAGE, this, Languages.LANGUAGE_FIELD_SIZE));
objectList.add(new TextEncodedStringNullTerminated(DataTypes.OBJ_DESCRIPTION, this));
objectList.add(new TextEncodedStringSizeTerminated(DataTypes.OBJ_LYRICS, this));
| public void | write(java.io.ByteArrayOutputStream tagBuffer)
//Ensure valid for type
this.setTextEncoding(ID3TextEncodingConversion.getTextEncoding(getHeader(), getTextEncoding()));
//Ensure valid for data
if (!((AbstractString) getObject(DataTypes.OBJ_DESCRIPTION)).canBeEncoded())
{
this.setTextEncoding(ID3TextEncodingConversion.getUnicodeTextEncoding(getHeader()));
}
if (!((AbstractString) getObject(DataTypes.OBJ_LYRICS)).canBeEncoded())
{
this.setTextEncoding(ID3TextEncodingConversion.getUnicodeTextEncoding(getHeader()));
}
super.write(tagBuffer);
|
|