public class FrameBodyETCO extends AbstractID3v2FrameBody implements ID3v24FrameBody, ID3v23FrameBody
<Header for 'Event timing codes', ID: "ETCO"> | |
Time stamp format | $xx |
Where time stamp format is:
$01 Absolute time, 32 bit sized, using MPEG frames as unit
$02 Absolute time, 32 bit sized, using milliseconds as unit
Absolute time means that every stamp contains the time from the beginning of the file.
Followed by a list of key events in the following format:
Type of event | $xx |
Time stamp | $xx (xx ...) |
The 'Time stamp' is set to zero if directly at the beginning of the sound or after the previous event. All events should be sorted in chronological order. The type of event is as follows:
$00 | padding (has no meaning) |
$01 | end of initial silence |
$02 | intro start |
$03 | mainpart start |
$04 | outro start |
$05 | outro end |
$06 | verse start |
$07 | refrain start |
$08 | interlude start |
$09 | theme start |
$0A | variation start |
$0B | key change |
$0C | time change |
$0D | momentary unwanted noise (Snap, Crackle & Pop) |
$0E | sustained noise |
$0F | sustained noise end |
$10 | intro end |
$11 | mainpart end |
$12 | verse end |
$13 | refrain end |
$14 | theme end |
$15-$DF | reserved for future use |
$E0-$EF | not predefined sync 0-F |
$F0-$FC | reserved for future use |
$FD | audio end (start of silence) |
$FE | audio file ends |
$FF | one more byte of events follows (all the following bytes with the value $FF have the same function) |
Terminating the start events such as "intro start" is not required. The 'Not predefined sync's ($E0-EF) are for user events. You might want to synchronise your music to something, like setting of an explosion on-stage, turning on your screensaver etc.
There may only be one "ETCO" frame in each tag.
For more details, please refer to the ID3 specifications:
Modifier and Type | Field and Description |
---|---|
static int |
MILLISECONDS |
static int |
MPEG_FRAMES |
TYPE_BODY
objectList
logger
Constructor and Description |
---|
FrameBodyETCO()
Creates a new FrameBodyETCO datatype.
|
FrameBodyETCO(ByteBuffer byteBuffer,
int frameSize)
Creates a new FrameBodyETCO datatype.
|
FrameBodyETCO(FrameBodyETCO body) |
Modifier and Type | Method and Description |
---|---|
void |
addTimingCode(long timestamp,
int... types)
Adds a timing code for each given type.
|
void |
clearTimingCodes()
Remove all timing codes.
|
String |
getIdentifier()
Return the ID3v2 Frame Identifier, must be implemented by concrete subclasses
|
int |
getTimestampFormat()
Timestamp format for all events in this frame.
|
List<Long> |
getTimestamps(int... type)
Chronological list of timestamps of a set of given types.
|
Map<Long,int[]> |
getTimingCodes()
Chronological map of timing codes.
|
void |
read(ByteBuffer byteBuffer)
This reads a frame body from a ByteBuffer into the appropriate FrameBody class and update the position of the
buffer to be just after the end of this frameBody
The ByteBuffer represents the tag and its position should be at the start of this frameBody.
|
boolean |
removeTimingCode(long timestamp,
int... types)
Removes timestamps at a given time with the given types.
|
void |
setTimestampFormat(int timestampFormat)
Sets the timestamp format.
|
protected void |
setupObjectList()
Setup object list.
|
createStructure, equals, getSize, setSize, setSize, write
getBriefDescription, getHeader, getLongDescription, getObject, getObjectValue, getTextEncoding, getUserFriendlyValue, isSubsetOf, iterator, setHeader, setObjectValue, setTextEncoding, toString
public static final int MPEG_FRAMES
public static final int MILLISECONDS
public FrameBodyETCO()
public FrameBodyETCO(FrameBodyETCO body)
public FrameBodyETCO(ByteBuffer byteBuffer, int frameSize) throws InvalidTagException
byteBuffer
- buffer to read fromframeSize
- size of the frameInvalidTagException
- if unable to create framebody from bufferpublic int getTimestampFormat()
1
means absolute time (32 bit) using MPEG frames as unit.
A value of 2
means absolute time (32 bit) using milliseconds as unit.MILLISECONDS
,
MPEG_FRAMES
public void setTimestampFormat(int timestampFormat)
timestampFormat
- 1 for MPEG frames or 2 for millisecondsgetTimestampFormat()
public Map<Long,int[]> getTimingCodes()
public List<Long> getTimestamps(int... type)
type
- typespublic void addTimingCode(long timestamp, int... types)
timestamp
- timestamptypes
- typespublic boolean removeTimingCode(long timestamp, int... types)
timestamp
- timestamptypes
- typestrue
, if any timestamps were removedpublic void clearTimingCodes()
public void read(ByteBuffer byteBuffer) throws InvalidTagException
AbstractID3v2FrameBody
read
in class AbstractID3v2FrameBody
byteBuffer
- file to readInvalidTagException
public String getIdentifier()
AbstractID3v2FrameBody
getIdentifier
in class AbstractID3v2FrameBody
protected void setupObjectList()
setupObjectList
in class AbstractTagFrameBody
Copyright © 2005–2020 jthink.net. All rights reserved.