public class MetaMessage extends MidiMessage
MetaMessage
是
MidiMessage
不是意义的合成器,但可以存储在一个MIDI文件和一个序列程序解释。(看在
MidiMessage
类描述。讨论)标准MIDI文件规范定义了各种类型的元事件,如序列号、抒情,提示点,并设置节奏。也有元事件信息的歌词,版权,节奏的迹象,时间和关键特征,标记,等更多的信息,参见标准MIDI文件1规范,这是完整的MIDI 1详细规范由MIDI制造商协会公布的部分(
http://www.midi.org)。
当数据被使用MIDI线协议传输,一个状态值0xFF
代表一个系统复位消息。在MIDI文件中,这一状态值表示一个ShortMessage
MetaMessage
。元信息的类型区分开来的第一个字节为状态字节0xFF
后续字节数据的字节数。随着系统的独家消息,有任意数量的数据字节,取决于MetaMessage
类型。
MetaEventListener
Modifier and Type | Field and Description |
---|---|
static int |
META
对于
MetaMessage 状态字节(0xFF,或255),这是用于MIDI文件。
|
data, length
Modifier | Constructor and Description |
---|---|
|
MetaMessage()
构建了一种新的
MetaMessage 。
|
protected |
MetaMessage(byte[] data)
构建了一种新的
MetaMessage 。
|
|
MetaMessage(int type, byte[] data, int length)
构建了一种新的
MetaMessage 和设置消息参数。
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
创建同一个类的新对象,并具有与此对象相同的内容。
|
byte[] |
getData()
获取元数据的数据的副本。
|
int |
getType()
得到的
MetaMessage 类型。
|
void |
setMessage(int type, byte[] data, int length)
设置一个
MetaMessage 消息参数。
|
getLength, getMessage, getStatus, setMessage
public static final int META
MetaMessage
状态字节(0xFF,或255),这是用于MIDI文件。它具有system_reset相同的值,用于在实时MIDI线”协议。
public MetaMessage()
MetaMessage
。消息的内容不在这里设置;使用
setMessage
设置他们随后。
public MetaMessage(int type, byte[] data, int length) throws InvalidMidiDataException
MetaMessage
和设置消息参数。短信的内容可以用
setMessage
方法改变。
type
元消息类型(必须小于128)
data
在MIDI消息的数据字节
length
在
data
字节数组的字节数量;它应该是非负且小于或等于
data.length
InvalidMidiDataException
-如果参数值没有指定一个有效的MIDI的元信息
setMessage(int, byte[], int)
,
getType()
,
getData()
protected MetaMessage(byte[] data)
MetaMessage
。
data
-包含完整的信息的字节数组。消息数据可以使用
setMessage
方法改变。
setMessage(int, byte[], int)
public void setMessage(int type, byte[] data, int length) throws InvalidMidiDataException
MetaMessage
消息参数。由于只有一个状态字节的值,
0xFF
,允许的元信息,它不需要在这里指定。呼吁所有的元信息
getStatus
返回
0xFF
。
的type
参数应为字节如下在MetaMessage
状态字节的有效值。的data
论点应该包含所有的MetaMessage
后续字节。换句话说,字节指定MetaMessage
类型不被认为是一个字节的数据。
type
元消息类型(必须小于128)
data
在MIDI消息的数据字节
length
data
字节数组中的字节数
InvalidMidiDataException
-如果参数值没有指定一个有效的MIDI的元信息
public int getType()
MetaMessage
类型。
MetaMessage
型整数
public byte[] getData()
MidiMessage.getLength()
public Object clone()
clone
方法重写,继承类
MidiMessage
Cloneable
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.