Methods Summary |
---|
public void | accept(ID3Visitor oID3Visitor)
oID3Visitor.visitAPICID3V2Frame(this);
|
public boolean | equals(java.lang.Object oOther)
if ((oOther == null) || (!(oOther instanceof APICID3V2Frame)))
{
return false;
}
APICID3V2Frame oOtherAPIC = (APICID3V2Frame)oOther;
return (m_oTextEncoding.equals(oOtherAPIC.m_oTextEncoding) &&
m_sMimeType.equals(oOtherAPIC.m_sMimeType) &&
m_oPictureType.equals(oOtherAPIC.m_oPictureType) &&
m_sDescription.equals(oOtherAPIC.m_sDescription) &&
Arrays.equals(m_abyPictureData, oOtherAPIC.m_abyPictureData));
|
public java.lang.String | getDescription()Get the description for the picture in this frame.
return m_sDescription;
|
protected byte[] | getFrameId()
return "APIC".getBytes();
|
public java.lang.String | getMimeType()Get the MIME type of the image contained in this frame. A MIME type of "-->" implies that the
image data contains an URL reference to the actual image data.
return m_sMimeType;
|
public byte[] | getPictureData()Get the picture data for the image in this frame.
return m_abyPictureData;
|
public org.blinkenlights.jid3.v2.APICID3V2Frame$PictureType | getPictureType()Get the classification of the picture in this frame.
return m_oPictureType;
|
public TextEncoding | getTextEncoding()Get the text encoding used for the description in this frame.
return m_oTextEncoding;
|
public void | setDescription(java.lang.String sDescription)Set the description for the picture in this frame.
String sOrigDescription = m_sDescription;
TextEncoding oOrigTextEncoding = m_oTextEncoding;
if (sDescription.length() > 64)
{
// I have no idea why...
throw new ID3Exception("Description in APIC frame cannot exceed 64 characters.");
}
m_oTextEncoding = TextEncoding.getDefaultTextEncoding();
m_sDescription = sDescription;
// try this update, and reverse it if it generates and error
try
{
notifyID3Observers();
}
catch (ID3Exception e)
{
m_sDescription = sOrigDescription;
m_oTextEncoding = oOrigTextEncoding;
throw e;
}
|
public void | setMimeType(java.lang.String sMimeType)Set the MIME type for the image contained in this frame.
Note: It is valid to set the MIME type to "-->", and set the picture data to an URL pointing to the image,
although this is discouraged.
m_sMimeType = sMimeType;
if (m_sMimeType == null)
{
m_sMimeType = "image/";
}
|
public void | setPictureData(byte[] abyPictureData)Set the picture data for the image in this frame.
if ((abyPictureData == null) || (abyPictureData.length == 0))
{
throw new ID3Exception("APIC frame requires picture data.");
}
m_abyPictureData = abyPictureData;
|
public void | setPictureType(org.blinkenlights.jid3.v2.APICID3V2Frame$PictureType oPictureType)Set the classification of the picture in this frame.
m_oPictureType = oPictureType;
|
public void | setTextEncoding(TextEncoding oTextEncoding)Set the text encoding to be used for the description in this frame.
if (oTextEncoding == null)
{
throw new NullPointerException("Text encoding cannot be null.");
}
m_oTextEncoding = oTextEncoding;
|
public java.lang.String | toString()
return "Attached picure: Mime type=[" + m_sMimeType + "], Picture type = " +
m_oPictureType.getValue() + ", Description=[" + m_sDescription + "], Picture data length = " +
m_abyPictureData.length;
|
protected void | writeBody(ID3DataOutputStream oIDOS)
// text encoding
oIDOS.writeUnsignedByte(m_oTextEncoding.getEncodingValue());
// mime type (and trailing null)
oIDOS.write(m_sMimeType.getBytes());
oIDOS.writeUnsignedByte(0);
// picture type
oIDOS.writeUnsignedByte(m_oPictureType.getValue());
// description
if (m_sDescription != null)
{
oIDOS.write(m_sDescription.getBytes(m_oTextEncoding.getEncodingString()));
}
// null separating description from picture data
if (m_oTextEncoding.equals(TextEncoding.ISO_8859_1))
{
oIDOS.writeUnsignedByte(0);
}
else
{
oIDOS.writeUnsignedByte(0);
oIDOS.writeUnsignedByte(0);
}
// actual picture data
oIDOS.write(m_abyPictureData);
|