Methods Summary |
---|
public abstract boolean | containsAtLeastOneFrame()Check if this tag contains at least one frame. An ID3V2 tag requires at least one frame to be written.
|
public abstract java.lang.String | getAlbum()Convenience method for retrieving album title directly from tag.
|
public abstract java.lang.String | getArtist()Convenience method for retrieving artist directly from tag.
|
public boolean | getCRC()Get the current CRC status for the extended header in this frame.
return m_bCRCDataFlag;
|
public abstract java.lang.String | getComment()Convenience method for retrieving the comment directly from tag.
|
public static int | getDefaultPaddingLength()Get the default padding length currently set for newly created tags.
return s_iDefaultPaddingLength;
|
public boolean | getExtendedHeader()Get the current extended header status for this tag.
return m_bExtendedHeaderFlag;
|
public abstract java.lang.String | getGenre()Convenience method for retrieving the genre directly from tag.
|
public int | getPaddingLength()Get the padding length currently set for this tag.
return m_iPaddingLength;
|
public ID3V2Frame[] | getSingleFrames()Get all frames set in this tag which can only be stored once in the tag.
This method exists to aid in testing.
return (ID3V2Frame[])m_oFrameIdToFrameMap.values().toArray(new ID3V2Frame[0]);
|
public abstract java.lang.String | getTitle()Convenience method for retrieving song title directly from tag.
|
public abstract int | getTotalTracks()Convenience method for retrieving total number of tracks directly from tag.
|
public abstract int | getTrackNumber()Convenience method for retrieving track number directly from tag.
|
public boolean | getUnsynchronization()Get the current unsynchronization status for this tag.
return m_bUnsynchronizationUsedFlag;
|
public abstract int | getYear()Convenience method for retrieving year directly from tag.
|
public static org.blinkenlights.jid3.v2.ID3V2Tag | read(java.io.InputStream oIS)Read a tag from an input stream.
try
{
ID3DataInputStream oID3DIS = new ID3DataInputStream(oIS);
// check which version of v2 tags we have
int iMinorVersion = oID3DIS.readUnsignedByte();
int iPatchVersion = oID3DIS.readUnsignedByte();
if (iMinorVersion == 3)
{
// there is a tag, we must read it
ID3V2Tag oID3V2Tag = ID3V2_3_0Tag.internalRead(oID3DIS);
return oID3V2Tag;
}
else
{
//TODO: If we're going to support >2.3.0 tags, do that here.
return null;
}
}
catch (ID3Exception e)
{
throw e;
}
catch (Exception e)
{
throw new ID3Exception("Error reading tag.", e);
}
|
public abstract void | sanityCheck()
|
public abstract void | setAlbum(java.lang.String sAlbum)Convenience method for setting album title directly from tag.
|
public abstract void | setArtist(java.lang.String sArtist)Convenience method for setting artist directly from tag.
|
public void | setCRC(boolean bCRCUsed)Set the CRC flag (extended header must be enabled before this flag can be set.
if ( ! m_bExtendedHeaderFlag)
{
throw new ID3Exception("The CRC flag cannot be set unless the extended header flag is set first.");
}
m_bCRCDataFlag = bCRCUsed;
|
public abstract void | setComment(java.lang.String sComment)Convenience method for setting comment directly from tag.
|
public static void | setDefaultPaddingLength(int iPaddingLength)Set the default padding length to be added at the end of newly created tags.
NOTE: When read by Winamp, it seems the last frame in a v2 tag is not seen, unless there are at least six bytes
of padding at the end of the tag. For this reason, the default padding at the end of v2 tags is set to 16.
This value can be modified if desired, but be aware of this observation regarding Winamp.
if (iPaddingLength < 0)
{
throw new ID3Exception("Padding length in ID3 V2 tag cannot be negative.");
}
s_iDefaultPaddingLength = iPaddingLength;
|
public void | setExtendedHeader(boolean bExtendedHeaderUsed)Set the extended header flag for this tag.
m_bExtendedHeaderFlag = bExtendedHeaderUsed;
|
public abstract void | setGenre(java.lang.String sGenre)Convenience method for setting genre directly from tag.
|
public void | setPaddingLength(int iPaddingLength)Set the padding length to be added at the end of this tag.
NOTE: When read by Winamp, it seems the last frame in a v2 tag is not seen, unless there are at least six bytes
of padding at the end of the tag. For this reason, the default padding at the end of v2 tags is set to 16.
This value can be modified if desired, but be aware of this observation regarding Winamp.
if (iPaddingLength < 0)
{
throw new ID3Exception("Padding length in ID3 V2 tag cannot be negative.");
}
m_iPaddingLength = iPaddingLength;
|
public abstract void | setTitle(java.lang.String sTitle)Convenience method for setting song title directly from tag.
|
public abstract void | setTrackNumber(int iTrackNumber)Convenience method for setting track number directly from tag.
|
public abstract void | setTrackNumber(int iTrackNumber, int iTotalTracks)Convenience method for setting track number and total number of tracks directly from tag.
|
public void | setUnsynchronization(boolean bUnsynchronizationUsed)Set the unsynchronization status.
m_bUnsynchronizationUsedFlag = bUnsynchronizationUsed;
|
public abstract void | setYear(int iYear)Convenience method for setting year directly from tag.
|
public java.lang.String | toString()
StringBuffer sbText = new StringBuffer();
sbText.append("Unsynchronization: " + m_bUnsynchronizationUsedFlag +
"\nExtended header: " + m_bExtendedHeaderFlag +
"\nExperimental: " + m_bExperimentalFlag +
"\nCRC: " + m_bCRCDataFlag +
"\nPadding length: " + + m_iPaddingLength +
"\nNum frames: " + m_oFrameIdToFrameMap.size());
Iterator oIter = m_oFrameIdToFrameMap.keySet().iterator();
while(oIter.hasNext())
{
String sFrameId = (String)oIter.next();
sbText.append("\n" + ((ID3V2Frame)m_oFrameIdToFrameMap.get(sFrameId)));
}
return sbText.toString();
|
public abstract void | write(java.io.OutputStream oOS)Write this tag to an output stream.
|