|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectjavax.sound.midi.MidiFileFormat
public class MidiFileFormat
MidiFileFormat 对象,它封装了 MIDI 文件的类型、长度和定时信息。
MidiFileFormat 对象可包含一组属性。属性是一对键和值:键的类型是 String,关联属性值是任意对象。属性指定其他的信息元数据(如作者或版权)。属性是可选信息,不要求文件 reader 和文件 writer 实现提供或识别属性。
下表列出了一些应在实现中使用的常见属性:
| 属性键 | 值类型 | 描述 |
|---|---|---|
| "author" | String |
此文件的作者名 |
| "title" | String |
此文件的标题 |
| "copyright" | String |
版权消息 |
| "date" | Date |
录制或发行日期 |
| "comment" | String |
任意文本 |
MidiSystem.getMidiFileFormat(java.io.File),
Sequencer.setSequence(java.io.InputStream stream)| 字段摘要 | |
|---|---|
protected int |
byteLength
MIDI 文件的长度,以字节为单位。 |
protected float |
divisionType
MIDI 文件的 division 类型。 |
protected long |
microsecondLength
MIDI 文件的持续时间,以微秒为单位。 |
protected int |
resolution
MIDI 文件的定时精度。 |
protected int |
type
MIDI 文件的类型。 |
static int |
UNKNOWN_LENGTH
表示未知长度。 |
| 构造方法摘要 | |
|---|---|
MidiFileFormat(int type,
float divisionType,
int resolution,
int bytes,
long microseconds)
构造一个 MidiFileFormat。 |
|
MidiFileFormat(int type,
float divisionType,
int resolution,
int bytes,
long microseconds,
Map<String,Object> properties)
构造带一组属性的 MidiFileFormat。 |
|
| 方法摘要 | |
|---|---|
int |
getByteLength()
获得 MIDI 文件的长度,用 8 位字节表示。 |
float |
getDivisionType()
获得 MIDI 文件的定时 division 类型。 |
long |
getMicrosecondLength()
获得 MIDI 文件的长度,用微秒表示。 |
Object |
getProperty(String key)
获得由键指定的属性值。 |
int |
getResolution()
获得 MIDI 文件的定时精度。 |
int |
getType()
获得 MIDI 文件类型。 |
Map<String,Object> |
properties()
获得属性的一个不可修改的映射。 |
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 字段详细信息 |
|---|
public static final int UNKNOWN_LENGTH
getByteLength(),
getMicrosecondLength(),
常量字段值protected int type
protected float divisionType
Sequence.PPQ,
Sequence.SMPTE_24,
Sequence.SMPTE_25,
Sequence.SMPTE_30DROP,
Sequence.SMPTE_30protected int resolution
protected int byteLength
protected long microsecondLength
| 构造方法详细信息 |
|---|
public MidiFileFormat(int type,
float divisionType,
int resolution,
int bytes,
long microseconds)
MidiFileFormat。
type - MIDI 文件类型(0、1 或 2)divisionType - 定时 division 类型(PPQ 或某一 SMPTE 类型)resolution - 定时精度bytes - MIDI 文件的长度,以字节为单位,如果长度未知,则为 UNKNOWN_LENGTHmicroseconds - 文件的持续时间,以微秒为单位,如果文件持续时间未知,则为 UNKNOWN_LENGTHUNKNOWN_LENGTH,
Sequence.PPQ,
Sequence.SMPTE_24,
Sequence.SMPTE_25,
Sequence.SMPTE_30DROP,
Sequence.SMPTE_30
public MidiFileFormat(int type,
float divisionType,
int resolution,
int bytes,
long microseconds,
Map<String,Object> properties)
MidiFileFormat。
type - MIDI 文件类型(0、1 或 2)divisionType - 定时 division 类型(PPQ 或某一 SMPTE 类型)resolution - 定时精度bytes - MIDI 文件的长度,以字节为单位,如果长度未知,则为 UNKNOWN_LENGTHmicroseconds - 文件的持续时间,以微秒为单位,如果文件持续时间未知,则为 UNKNOWN_LENGTHproperties - 一个带属性的 Map<String,Object> 对象UNKNOWN_LENGTH,
Sequence.PPQ,
Sequence.SMPTE_24,
Sequence.SMPTE_25,
Sequence.SMPTE_30DROP,
Sequence.SMPTE_30| 方法详细信息 |
|---|
public int getType()
public float getDivisionType()
Sequence.Sequence(float, int),
Sequence.PPQ,
Sequence.SMPTE_24,
Sequence.SMPTE_25,
Sequence.SMPTE_30DROP,
Sequence.SMPTE_30,
Sequence.getDivisionType()public int getResolution()
getDivisionType(),
Sequence.getResolution()public int getByteLength()
UNKNOWN_LENGTHpublic long getMicrosecondLength()
Sequence.getMicrosecondLength(),
getByteLength(),
UNKNOWN_LENGTHpublic Map<String,Object> properties()
类描述中对属性的概念进行了进一步的介绍。
Map<String,Object> 对象。如果没有任何可识别的属性,则返回一个空映射。getProperty(String)public Object getProperty(String key)
类描述中对属性的概念进行了进一步的介绍。
如果对于一个特定的文件格式,指定的属性未定义,则此方法返回 null。
key - 所需属性的键
null。properties
|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。另请参阅文档重新分发政策。