Methods Summary |
---|
public void | accept(ID3Visitor oID3Visitor)
oID3Visitor.visitUSLTID3V2Frame(this);
|
public boolean | equals(java.lang.Object oOther)
if ((oOther == null) || (!(oOther instanceof USLTID3V2Frame)))
{
return false;
}
USLTID3V2Frame oOtherUSLT = (USLTID3V2Frame)oOther;
return (m_oTextEncoding.equals(oOtherUSLT.m_oTextEncoding) &&
m_sLanguage.equals(oOtherUSLT.m_sLanguage) &&
m_sContentDescriptor.equals(oOtherUSLT.m_sContentDescriptor) &&
m_sLyrics.equals(oOtherUSLT.m_sLyrics));
|
public java.lang.String | getContentDescriptor()Get the content descriptor for this frame.
return m_sContentDescriptor;
|
protected byte[] | getFrameId()
return "USLT".getBytes();
|
public java.lang.String | getLanguage()Get the language used in this frame.
return m_sLanguage;
|
public java.lang.String | getLyrics()Get the lyrics for this frame.
return m_sLyrics;
|
public TextEncoding | getTextEncoding()Get the text encoding used for the content descriptor and lyrics in this frame.
return m_oTextEncoding;
|
public void | setContentDescriptor(java.lang.String sContentDescriptor)Set the content descriptor for this frame.
String sOrigContentDescriptor = m_sContentDescriptor;
if (sContentDescriptor == null)
{
throw new ID3Exception("Content descriptor is required for USLT frame.");
}
m_sContentDescriptor = sContentDescriptor;
// try this update, and reverse it if it generates and error
try
{
notifyID3Observers();
}
catch (ID3Exception e)
{
m_sContentDescriptor = sOrigContentDescriptor;
throw e;
}
|
public void | setLanguage(java.lang.String sLanguage)Set the language used in this frame.
String sOrigLanguage = m_sLanguage;
if ((sLanguage == null) || (sLanguage.length() != 3))
{
throw new ID3Exception("A three character length language code is required in USLT frame.");
}
m_sLanguage = sLanguage;
// try this update, and reverse it if it generates and error
try
{
notifyID3Observers();
}
catch (ID3Exception e)
{
m_sLanguage = sOrigLanguage;
throw e;
}
|
public void | setLyrics(java.lang.String sLyrics)Set the lyrics for this frame.
if (sLyrics == null)
{
m_sLyrics = "";
}
m_sLyrics = sLyrics;
|
public void | setTextEncoding(TextEncoding oTextEncoding)Set the text encoding to be used for the content descriptor and lyrics in this frame.
if (oTextEncoding == null)
{
throw new NullPointerException("Text encoding cannot be null.");
}
m_oTextEncoding = oTextEncoding;
|
public java.lang.String | toString()
return "Unsychronized lyrics: Language=[" + m_sLanguage + "], Content descriptor=[" +
m_sContentDescriptor + "], Lyrics=[" + m_sLyrics + "]";
|
protected void | writeBody(ID3DataOutputStream oIDOS)
// text encoding
oIDOS.writeUnsignedByte(m_oTextEncoding.getEncodingValue());
// language
oIDOS.write(m_sLanguage.getBytes());
// content descriptor
if (m_sContentDescriptor != null)
{
oIDOS.write(m_sContentDescriptor.getBytes(m_oTextEncoding.getEncodingString()));
}
// null separating content descriptor from lyrics
if (m_oTextEncoding.equals(TextEncoding.ISO_8859_1))
{
oIDOS.writeUnsignedByte(0);
}
else
{
oIDOS.writeUnsignedByte(0);
oIDOS.writeUnsignedByte(0);
}
// lyrics
oIDOS.write(m_sLyrics.getBytes(m_oTextEncoding.getEncodingString()));
|