public class MetaMessage extends MidiMessage
Modifier and Type | Field and Description |
---|---|
static int |
META |
static int |
TYPE_END_OF_TRACK |
static int |
TYPE_TEMPO |
data, length
Modifier | Constructor and Description |
---|---|
|
MetaMessage()
Constructor with default message
|
protected |
MetaMessage(byte[] data)
Constructor with raw data
|
|
MetaMessage(int type,
byte[] data,
int length)
Constructor with the entire information of message
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Clone the object
|
byte[] |
getData()
Get the data of
MetaMessage |
int |
getType()
Get the type of
MetaMessage |
void |
setMessage(int type,
byte[] data,
int length)
Set the entire information of message.
|
getLength, getMessage, getStatus, setMessage, toString
public static final int META
public static final int TYPE_END_OF_TRACK
public static final int TYPE_TEMPO
public MetaMessage()
protected MetaMessage(@NonNull byte[] data)
data
- the data source with META header(2 bytes) + length( > 1 byte), the data.length must be >= 3 bytesNegativeArraySizeException
- MUST be caught. We can't throw InvalidMidiDataException
because of API compatibility.public MetaMessage(int type, @Nullable byte[] data, int length) throws InvalidMidiDataException
type
- the data typedata
- the data sourcelength
- unused parameter. Use always data.lengthInvalidMidiDataException
public void setMessage(int type, @Nullable byte[] data, int length) throws InvalidMidiDataException
type
- the data type 0-127data
- the data sourcelength
- unused parameter. Use always data.lengthInvalidMidiDataException
public int getType()
MetaMessage
@NonNull public byte[] getData()
MetaMessage
@NonNull public Object clone()
MidiMessage
clone
in class MidiMessage