Methods Summary |
---|
public void | accept(ID3Visitor oID3Visitor)
oID3Visitor.visitTXXXTextInformationID3V2Frame(this);
|
public boolean | equals(java.lang.Object oOther)
if ((oOther == null) || (!(oOther instanceof TXXXTextInformationID3V2Frame)))
{
return false;
}
TXXXTextInformationID3V2Frame oOtherTXXX = (TXXXTextInformationID3V2Frame)oOther;
return (m_oTextEncoding.equals(oOtherTXXX.m_oTextEncoding) &&
m_sDescription.equals(oOtherTXXX.m_sDescription) &&
m_sInformation.equals(oOtherTXXX.m_sInformation));
|
public java.lang.String | getDescription()Get the description of the information stored in this frame.
return m_sDescription;
|
protected byte[] | getFrameId()
return "TXXX".getBytes();
|
public java.lang.String | getInformation()Get the information stored in this frame.
return m_sInformation;
|
public void | setDescriptionAndInformation(java.lang.String sDescription, java.lang.String sInformation)Set the description of the information to be stored in this frame, along with the actual information.
String sOrigDescription = m_sDescription;
String sOrigInformation = m_sInformation;
TextEncoding oOrigTextEncoding = m_oTextEncoding;
if ((sDescription == null) || (sDescription.length() == 0))
{
throw new ID3Exception("Description required for TXXX frame.");
}
if ((sInformation == null) || (sInformation.length() == 0))
{
throw new ID3Exception("Information required for TXXX frame.");
}
m_sDescription = sDescription;
m_oTextEncoding = TextEncoding.getDefaultTextEncoding();
m_sInformation = sInformation;
// try this update, and reverse it if it generates and error
try
{
notifyID3Observers();
}
catch (ID3Exception e)
{
m_sDescription = sOrigDescription;
m_sInformation = sOrigInformation;
m_oTextEncoding = oOrigTextEncoding;
throw e;
}
|
public java.lang.String | toString()
return "User-defined text: Description=[" + m_sDescription + "], Information=[" + m_sInformation + "]";
|
protected void | writeBody(ID3DataOutputStream oIDOS)
oIDOS.writeUnsignedByte(m_oTextEncoding.getEncodingValue());
oIDOS.write(m_sDescription.getBytes(m_oTextEncoding.getEncodingString()));
// null separating description from information string
if (m_oTextEncoding.equals(TextEncoding.ISO_8859_1))
{
oIDOS.writeUnsignedByte(0);
}
else
{
oIDOS.writeUnsignedByte(0);
oIDOS.writeUnsignedByte(0);
}
oIDOS.write(m_sInformation.getBytes(m_oTextEncoding.getEncodingString()));
|