@Test public void testRemoveTempo() { final FrameBodySYTC body = new FrameBodySYTC(); body.addTempo(10, 0); body.addTempo(5, 0); body.addTempo(5, 1); body.addTempo(11, 400); body.removeTempo(5); final Map<Long, Integer> timingCodes = body.getTempi(); Assert.assertEquals(0, (int)timingCodes.get(10L)); Assert.assertEquals(400, (int)timingCodes.get(11L)); Assert.assertNull(timingCodes.get(5L)); }
public boolean removeTempo(final long timestamp) { final List<SynchronisedTempoCode> codes = (List<SynchronisedTempoCode>)getObjectValue(DataTypes.OBJ_SYNCHRONISED_TEMPO_LIST); boolean removed = false; for (final ListIterator<SynchronisedTempoCode> iterator = codes.listIterator(); iterator.hasNext(); ) { final SynchronisedTempoCode code = iterator.next(); if (timestamp == code.getTimestamp()) { iterator.remove(); removed = true; } if (timestamp > code.getTimestamp()) { break; } } return removed; }
FrameBodySYTC extends AbstractID3v2FrameBody implements ID3v24FrameBody, ID3v23FrameBody { public boolean removeTempo(final long timestamp) { final List<SynchronisedTempoCode> codes = (List<SynchronisedTempoCode>)getObjectValue(DataTypes.OBJ_SYNCHRONISED_TEMPO_LIST); boolean removed = false; for (final ListIterator<SynchronisedTempoCode> iterator = codes.listIterator(); iterator.hasNext(); ) { final SynchronisedTempoCode code = iterator.next(); if (timestamp == code.getTimestamp()) { iterator.remove(); removed = true; } if (timestamp > code.getTimestamp()) { break; } } return removed; } }
FrameBodySYTC extends AbstractID3v2FrameBody implements ID3v24FrameBody, ID3v23FrameBody { public boolean removeTempo(final long timestamp) { final List<SynchronisedTempoCode> codes = (List<SynchronisedTempoCode>)getObjectValue(DataTypes.OBJ_SYNCHRONISED_TEMPO_LIST); boolean removed = false; for (final ListIterator<SynchronisedTempoCode> iterator = codes.listIterator(); iterator.hasNext(); ) { final SynchronisedTempoCode code = iterator.next(); if (timestamp == code.getTimestamp()) { iterator.remove(); removed = true; } if (timestamp > code.getTimestamp()) { break; } } return removed; } FrameBodySYTC();  FrameBodySYTC(final int timestampFormat, final byte[] tempo);  FrameBodySYTC(final ByteBuffer byteBuffer, final int frameSize);  FrameBodySYTC(final Buffer byteBuffer, final int frameSize);  FrameBodySYTC(final FrameBodySYTC body); }
FrameBodySYTC extends AbstractID3v2FrameBody implements ID3v24FrameBody, ID3v23FrameBody { public boolean removeTempo(final long timestamp) { final List<SynchronisedTempoCode> codes = (List<SynchronisedTempoCode>)getObjectValue(DataTypes.OBJ_SYNCHRONISED_TEMPO_LIST); boolean removed = false; for (final ListIterator<SynchronisedTempoCode> iterator = codes.listIterator(); iterator.hasNext(); ) { final SynchronisedTempoCode code = iterator.next(); if (timestamp == code.getTimestamp()) { iterator.remove(); removed = true; } if (timestamp > code.getTimestamp()) { break; } } return removed; } FrameBodySYTC();  FrameBodySYTC(final int timestampFormat, final byte[] tempo);  FrameBodySYTC(final ByteBuffer byteBuffer, final int frameSize);  FrameBodySYTC(final Buffer byteBuffer, final int frameSize);  FrameBodySYTC(final FrameBodySYTC body); int getTimestampFormat(); void setTimestampFormat(final int timestampFormat); Map<Long, Integer> getTempi(); List<Long> getTimestamps(); void addTempo(final long timestamp, final int tempo); boolean removeTempo(final long timestamp); void clearTempi(); @Override String getIdentifier(); @Override void read(final ByteBuffer byteBuffer); }
FrameBodySYTC extends AbstractID3v2FrameBody implements ID3v24FrameBody, ID3v23FrameBody { public boolean removeTempo(final long timestamp) { final List<SynchronisedTempoCode> codes = (List<SynchronisedTempoCode>)getObjectValue(DataTypes.OBJ_SYNCHRONISED_TEMPO_LIST); boolean removed = false; for (final ListIterator<SynchronisedTempoCode> iterator = codes.listIterator(); iterator.hasNext(); ) { final SynchronisedTempoCode code = iterator.next(); if (timestamp == code.getTimestamp()) { iterator.remove(); removed = true; } if (timestamp > code.getTimestamp()) { break; } } return removed; } FrameBodySYTC();  FrameBodySYTC(final int timestampFormat, final byte[] tempo);  FrameBodySYTC(final ByteBuffer byteBuffer, final int frameSize);  FrameBodySYTC(final Buffer byteBuffer, final int frameSize);  FrameBodySYTC(final FrameBodySYTC body); int getTimestampFormat(); void setTimestampFormat(final int timestampFormat); Map<Long, Integer> getTempi(); List<Long> getTimestamps(); void addTempo(final long timestamp, final int tempo); boolean removeTempo(final long timestamp); void clearTempi(); @Override String getIdentifier(); @Override void read(final ByteBuffer byteBuffer); static final int MPEG_FRAMES; static final int MILLISECONDS; }