public class FrameBodySYTC extends AbstractID3v2FrameBody implements ID3v24FrameBody, ID3v23FrameBody
The tempo descriptor is followed by a time stamp. Every time the tempo in the music changes, a tempo descriptor may indicate this for the player. All tempo descriptors should be sorted in chronological order. The first beat-stroke in a time-period is at the same time as the beat description occurs. There may only be one "SYTC" frame in each tag.
<Header for 'Synchronised tempo codes', ID: "SYTC"> | |
Time stamp format | $xx |
Tempo data | <binary data> |
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
Abolute time means that every stamp contains the time from the beginning of the file.
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 |
---|
FrameBodySYTC()
Creates a new FrameBodySYTC datatype.
|
FrameBodySYTC(ByteBuffer byteBuffer,
int frameSize)
Creates a new FrameBody from buffer
|
FrameBodySYTC(FrameBodySYTC body)
Copy constructor
|
FrameBodySYTC(int timestampFormat,
byte[] tempo) |
Modifier and Type | Method and Description |
---|---|
void |
addTempo(long timestamp,
int tempo)
Adds a tempo.
|
void |
clearTempi()
Remove all timing codes.
|
String |
getIdentifier()
Return the ID3v2 Frame Identifier, must be implemented by concrete subclasses
|
Map<Long,Integer> |
getTempi()
Chronological map of tempi.
|
int |
getTimestampFormat()
Timestamp format for all events in this frame.
|
List<Long> |
getTimestamps()
Chronological list of timestamps.
|
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 |
removeTempo(long timestamp)
Removes a tempo at a given timestamp.
|
void |
setTimestampFormat(int timestampFormat)
Sets the timestamp format.
|
protected void |
setupObjectList()
Create the list of Datatypes that this body
expects in the correct order This method needs to be implemented by concrete subclasses
|
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 FrameBodySYTC()
public FrameBodySYTC(int timestampFormat, byte[] tempo)
timestampFormat
- tempo
- public FrameBodySYTC(ByteBuffer byteBuffer, int frameSize) throws InvalidTagException
byteBuffer
- frameSize
- InvalidTagException
public FrameBodySYTC(FrameBodySYTC body)
body
- public 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 List<Long> getTimestamps()
public void addTempo(long timestamp, int tempo)
timestamp
- timestamptempo
- tempopublic boolean removeTempo(long timestamp)
timestamp
- timestamptrue
, if any timestamps were removedpublic void clearTempi()
public String getIdentifier()
AbstractID3v2FrameBody
getIdentifier
in class AbstractID3v2FrameBody
public void read(ByteBuffer byteBuffer) throws InvalidTagException
AbstractID3v2FrameBody
read
in class AbstractID3v2FrameBody
byteBuffer
- file to readInvalidTagException
protected void setupObjectList()
AbstractTagFrameBody
setupObjectList
in class AbstractTagFrameBody
Copyright © 2005–2020 jthink.net. All rights reserved.