Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
c5779d6b
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
3
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
c5779d6b
编写于
4月 17, 2009
作者:
A
amenkov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
5050147: RFE: Add More Useful Constructors to MidiMessage Subclasses
Reviewed-by: alexp
上级
66c1a407
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
148 addition
and
0 deletion
+148
-0
src/share/classes/javax/sound/midi/MetaMessage.java
src/share/classes/javax/sound/midi/MetaMessage.java
+23
-0
src/share/classes/javax/sound/midi/ShortMessage.java
src/share/classes/javax/sound/midi/ShortMessage.java
+77
-0
src/share/classes/javax/sound/midi/SysexMessage.java
src/share/classes/javax/sound/midi/SysexMessage.java
+48
-0
未找到文件。
src/share/classes/javax/sound/midi/MetaMessage.java
浏览文件 @
c5779d6b
...
...
@@ -102,6 +102,29 @@ public class MetaMessage extends MidiMessage {
this
(
defaultMessage
);
}
/**
* Constructs a new {@code MetaMessage} and sets the message parameters.
* The contents of the message can be changed by using
* the {@code setMessage} method.
*
* @param type meta-message type (must be less than 128)
* @param data the data bytes in the MIDI message
* @param length an amount of bytes in the {@code data} byte array;
* it should be non-negative and less than or equal to
* {@code data.length}
* @throws InvalidMidiDataException if the parameter values do not specify
* a valid MIDI meta message
* @see #setMessage(int, byte[], int)
* @see #getType()
* @see #getData()
* @since 1.7
*/
public
MetaMessage
(
int
type
,
byte
[]
data
,
int
length
)
throws
InvalidMidiDataException
{
super
(
null
);
setMessage
(
type
,
data
,
length
);
// can throw InvalidMidiDataException
}
/**
* Constructs a new <code>MetaMessage</code>.
...
...
src/share/classes/javax/sound/midi/ShortMessage.java
浏览文件 @
c5779d6b
...
...
@@ -187,6 +187,83 @@ public class ShortMessage extends MidiMessage {
length
=
3
;
}
/**
* Constructs a new {@code ShortMessage} which represents a MIDI
* message that takes no data bytes.
* The contents of the message can be changed by using one of
* the {@code setMessage} methods.
*
* @param status the MIDI status byte
* @throws InvalidMidiDataException if {@code status} does not specify
* a valid MIDI status byte for a message that requires no data bytes
* @see #setMessage(int)
* @see #setMessage(int, int, int)
* @see #setMessage(int, int, int, int)
* @see #getStatus()
* @since 1.7
*/
public
ShortMessage
(
int
status
)
throws
InvalidMidiDataException
{
super
(
null
);
setMessage
(
status
);
// can throw InvalidMidiDataException
}
/**
* Constructs a new {@code ShortMessage} which represents a MIDI message
* that takes up to two data bytes. If the message only takes one data byte,
* the second data byte is ignored. If the message does not take
* any data bytes, both data bytes are ignored.
* The contents of the message can be changed by using one of
* the {@code setMessage} methods.
*
* @param status the MIDI status byte
* @param data1 the first data byte
* @param data2 the second data byte
* @throws InvalidMidiDataException if the status byte or all data bytes
* belonging to the message do not specify a valid MIDI message
* @see #setMessage(int)
* @see #setMessage(int, int, int)
* @see #setMessage(int, int, int, int)
* @see #getStatus()
* @see #getData1()
* @see #getData2()
* @since 1.7
*/
public
ShortMessage
(
int
status
,
int
data1
,
int
data2
)
throws
InvalidMidiDataException
{
super
(
null
);
setMessage
(
status
,
data1
,
data2
);
// can throw InvalidMidiDataException
}
/**
* Constructs a new {@code ShortMessage} which represents a channel
* MIDI message that takes up to two data bytes. If the message only takes
* one data byte, the second data byte is ignored. If the message does not
* take any data bytes, both data bytes are ignored.
* The contents of the message can be changed by using one of
* the {@code setMessage} methods.
*
* @param command the MIDI command represented by this message
* @param channel the channel associated with the message
* @param data1 the first data byte
* @param data2 the second data byte
* @throws InvalidMidiDataException if the command value, channel value
* or all data bytes belonging to the message do not specify
* a valid MIDI message
* @see #setMessage(int)
* @see #setMessage(int, int, int)
* @see #setMessage(int, int, int, int)
* @see #getCommand()
* @see #getChannel()
* @see #getData1()
* @see #getData2()
* @since 1.7
*/
public
ShortMessage
(
int
command
,
int
channel
,
int
data1
,
int
data2
)
throws
InvalidMidiDataException
{
super
(
null
);
setMessage
(
command
,
channel
,
data1
,
data2
);
}
/**
* Constructs a new <code>ShortMessage</code>.
...
...
src/share/classes/javax/sound/midi/SysexMessage.java
浏览文件 @
c5779d6b
...
...
@@ -120,6 +120,54 @@ public class SysexMessage extends MidiMessage {
data
[
1
]
=
(
byte
)
(
ShortMessage
.
END_OF_EXCLUSIVE
&
0xFF
);
}
/**
* Constructs a new {@code SysexMessage} and sets the data for
* the message. The first byte of the data array must be a valid system
* exclusive status byte (0xF0 or 0xF7).
* The contents of the message can be changed by using one of
* the {@code setMessage} methods.
*
* @param data the system exclusive message data including the status byte
* @param length the length of the valid message data in the array,
* including the status byte; it should be non-negative and less than
* or equal to {@code data.length}
* @throws InvalidMidiDataException if the parameter values
* do not specify a valid MIDI meta message.
* @see #setMessage(byte[], int)
* @see #setMessage(int, byte[], int)
* @see #getData()
* @since 1.7
*/
public
SysexMessage
(
byte
[]
data
,
int
length
)
throws
InvalidMidiDataException
{
super
(
null
);
setMessage
(
data
,
length
);
}
/**
* Constructs a new {@code SysexMessage} and sets the data for the message.
* The contents of the message can be changed by using one of
* the {@code setMessage} methods.
*
* @param status the status byte for the message; it must be a valid system
* exclusive status byte (0xF0 or 0xF7)
* @param data the system exclusive message data (without the status byte)
* @param length the length of the valid message data in the array;
* it should be non-negative and less than or equal to
* {@code data.length}
* @throws InvalidMidiDataException if the parameter values
* do not specify a valid MIDI meta message.
* @see #setMessage(byte[], int)
* @see #setMessage(int, byte[], int)
* @see #getData()
* @since 1.7
*/
public
SysexMessage
(
int
status
,
byte
[]
data
,
int
length
)
throws
InvalidMidiDataException
{
super
(
null
);
setMessage
(
status
,
data
,
length
);
}
/**
* Constructs a new <code>SysexMessage</code>.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录