@Test public void testRemoveTimingCode() { final FrameBodyETCO body = new FrameBodyETCO(); body.addTimingCode(10, 0); body.addTimingCode(5, 0); body.addTimingCode(5, 1); body.addTimingCode(11, 1, 2); body.removeTimingCode(5, 0); final Map<Long, int[]> timingCodes = body.getTimingCodes(); Assert.assertTrue(Arrays.equals(new int[]{0}, timingCodes.get(10L))); Assert.assertTrue(Arrays.equals(new int[]{1}, timingCodes.get(5L))); Assert.assertTrue(Arrays.equals(new int[]{1, 2}, timingCodes.get(11L))); }
public boolean removeTimingCode(final long timestamp, final int... types) { resolveRelativeTimestamps(); final Set<Integer> typeSet = toSet(types); final List<EventTimingCode> codes = (List<EventTimingCode>)getObjectValue(DataTypes.OBJ_TIMED_EVENT_LIST); boolean removed = false; for (final ListIterator<EventTimingCode> iterator = codes.listIterator(); iterator.hasNext(); ) { final EventTimingCode code = iterator.next(); if (timestamp == code.getTimestamp() && typeSet.contains(code.getType())) { iterator.remove(); removed = true; } if (timestamp > code.getTimestamp()) { break; } } return removed; }
FrameBodyETCO extends AbstractID3v2FrameBody implements ID3v24FrameBody, ID3v23FrameBody { public boolean removeTimingCode(final long timestamp, final int... types) { resolveRelativeTimestamps(); final Set<Integer> typeSet = toSet(types); final List<EventTimingCode> codes = (List<EventTimingCode>)getObjectValue(DataTypes.OBJ_TIMED_EVENT_LIST); boolean removed = false; for (final ListIterator<EventTimingCode> iterator = codes.listIterator(); iterator.hasNext(); ) { final EventTimingCode code = iterator.next(); if (timestamp == code.getTimestamp() && typeSet.contains(code.getType())) { iterator.remove(); removed = true; } if (timestamp > code.getTimestamp()) { break; } } return removed; } }
FrameBodyETCO extends AbstractID3v2FrameBody implements ID3v24FrameBody, ID3v23FrameBody { public boolean removeTimingCode(final long timestamp, final int... types) { resolveRelativeTimestamps(); final Set<Integer> typeSet = toSet(types); final List<EventTimingCode> codes = (List<EventTimingCode>)getObjectValue(DataTypes.OBJ_TIMED_EVENT_LIST); boolean removed = false; for (final ListIterator<EventTimingCode> iterator = codes.listIterator(); iterator.hasNext(); ) { final EventTimingCode code = iterator.next(); if (timestamp == code.getTimestamp() && typeSet.contains(code.getType())) { iterator.remove(); removed = true; } if (timestamp > code.getTimestamp()) { break; } } return removed; } FrameBodyETCO();  FrameBodyETCO(final FrameBodyETCO body);  FrameBodyETCO(final ByteBuffer byteBuffer, final int frameSize);  FrameBodyETCO(final Buffer byteBuffer, final int frameSize); }
FrameBodyETCO extends AbstractID3v2FrameBody implements ID3v24FrameBody, ID3v23FrameBody { public boolean removeTimingCode(final long timestamp, final int... types) { resolveRelativeTimestamps(); final Set<Integer> typeSet = toSet(types); final List<EventTimingCode> codes = (List<EventTimingCode>)getObjectValue(DataTypes.OBJ_TIMED_EVENT_LIST); boolean removed = false; for (final ListIterator<EventTimingCode> iterator = codes.listIterator(); iterator.hasNext(); ) { final EventTimingCode code = iterator.next(); if (timestamp == code.getTimestamp() && typeSet.contains(code.getType())) { iterator.remove(); removed = true; } if (timestamp > code.getTimestamp()) { break; } } return removed; } FrameBodyETCO();  FrameBodyETCO(final FrameBodyETCO body);  FrameBodyETCO(final ByteBuffer byteBuffer, final int frameSize);  FrameBodyETCO(final Buffer byteBuffer, final int frameSize); int getTimestampFormat(); void setTimestampFormat(final int timestampFormat); Map<Long, int[]> getTimingCodes(); List<Long> getTimestamps(final int... type); void addTimingCode(final long timestamp, final int... types); boolean removeTimingCode(final long timestamp, final int... types); void clearTimingCodes(); @Override void read(final ByteBuffer byteBuffer); @Override String getIdentifier(); }
FrameBodyETCO extends AbstractID3v2FrameBody implements ID3v24FrameBody, ID3v23FrameBody { public boolean removeTimingCode(final long timestamp, final int... types) { resolveRelativeTimestamps(); final Set<Integer> typeSet = toSet(types); final List<EventTimingCode> codes = (List<EventTimingCode>)getObjectValue(DataTypes.OBJ_TIMED_EVENT_LIST); boolean removed = false; for (final ListIterator<EventTimingCode> iterator = codes.listIterator(); iterator.hasNext(); ) { final EventTimingCode code = iterator.next(); if (timestamp == code.getTimestamp() && typeSet.contains(code.getType())) { iterator.remove(); removed = true; } if (timestamp > code.getTimestamp()) { break; } } return removed; } FrameBodyETCO();  FrameBodyETCO(final FrameBodyETCO body);  FrameBodyETCO(final ByteBuffer byteBuffer, final int frameSize);  FrameBodyETCO(final Buffer byteBuffer, final int frameSize); int getTimestampFormat(); void setTimestampFormat(final int timestampFormat); Map<Long, int[]> getTimingCodes(); List<Long> getTimestamps(final int... type); void addTimingCode(final long timestamp, final int... types); boolean removeTimingCode(final long timestamp, final int... types); void clearTimingCodes(); @Override void read(final ByteBuffer byteBuffer); @Override String getIdentifier(); static final int MPEG_FRAMES; static final int MILLISECONDS; }