Methods Summary |
---|
public void | accept(ID3Visitor oID3Visitor)
oID3Visitor.visitSYTCID3V2Frame(this);
|
public void | addTempoChange(org.blinkenlights.jid3.v2.SYTCID3V2Frame$TempoChange oTempoChange)Add a tempo change to the frame.
if (oTempoChange == null)
{
throw new ID3Exception("TempoChange cannot be null.");
}
if (m_oTempoChangeMap.keySet().contains(new Integer(oTempoChange.getTimestamp())))
{
throw new ID3Exception("SYTC frame already contains a tempo change for timestamp " + oTempoChange.getTimestamp() + ".");
}
m_oTempoChangeMap.put(new Integer(oTempoChange.getTimestamp()), new Integer(oTempoChange.getBeatsPerMinute()));
|
public boolean | equals(java.lang.Object oOther)
if ((oOther == null) || (!(oOther instanceof SYTCID3V2Frame)))
{
return false;
}
SYTCID3V2Frame oOtherSYTC = (SYTCID3V2Frame)oOther;
return (m_oTimestampFormat.equals(oOtherSYTC.m_oTimestampFormat) &&
m_oTempoChangeMap.equals(oOtherSYTC.m_oTempoChangeMap));
|
protected byte[] | getFrameId()
return "SYTC".getBytes();
|
public org.blinkenlights.jid3.v2.SYTCID3V2Frame$TempoChange | getTempoChange(int iTimestamp)Get a tempo change from this frame.
if (m_oTempoChangeMap.keySet().contains(new Integer(iTimestamp)))
{
try
{
return new TempoChange(((Integer)m_oTempoChangeMap.get(new Integer(iTimestamp))).intValue(), iTimestamp);
}
catch (Exception e) { return null; } // we've already created this object, so this can't happen
}
else
{
return null;
}
|
public org.blinkenlights.jid3.v2.SYTCID3V2Frame$TempoChange | removeTempoChange(int iTimestamp)Remove a tempo change from this frame.
if (m_oTempoChangeMap.keySet().contains(new Integer(iTimestamp)))
{
try
{
return new TempoChange(((Integer)m_oTempoChangeMap.remove(new Integer(iTimestamp))).intValue(), iTimestamp);
}
catch (Exception e) { return null; } // we've already created this object, so this can't happen
}
else
{
return null;
}
|
public java.lang.String | toString()
StringBuffer sbText = new StringBuffer();
sbText.append("Synchronized tempo codes: Timestamp format=[" + m_oTimestampFormat.getValue() + "]");
Iterator oIter = m_oTempoChangeMap.keySet().iterator();
while (oIter.hasNext())
{
Integer oTimestamp = (Integer)oIter.next();
Integer oBeatsPerMinute = (Integer)m_oTempoChangeMap.get(oTimestamp);
sbText.append(" TempoChange(" + oTimestamp.intValue() + ", BPM=" + oBeatsPerMinute.intValue() + ")");
}
return sbText.toString();
|
protected void | writeBody(ID3DataOutputStream oIDOS)
oIDOS.write(m_oTimestampFormat.getValue());
// tempo changes
Iterator oIter = m_oTempoChangeMap.keySet().iterator();
while (oIter.hasNext())
{
Integer oTimestamp = (Integer)oIter.next();
// beats per minute (one byte if < 255, sum of two bytes if >= 255)
Integer oBeatsPerMinute = (Integer)m_oTempoChangeMap.get(oTimestamp);
int iBeatsPerMinute = oBeatsPerMinute.intValue();
if (iBeatsPerMinute >= 255)
{
oIDOS.write(255);
oIDOS.write(iBeatsPerMinute - 255);
}
else
{
oIDOS.write(iBeatsPerMinute);
}
oIDOS.writeBE32(oTimestamp.intValue()); // timestamp
}
|