作者vivimice (麦斯◎我的奶酪在哪里﹖)
看板Visual_Basic
标题[API] Querying MIDI Devices
时间Wed Jul 27 15:32:37 2005
来源﹕mk:@MSITStore:E:\Microsoft%20Visual%20Studio\MSDN98\98VS\2052\
MultiMed.chm::/devdoc/live/pdgrmm/midi_6bhv.htm
翻译﹕vivimice 智慧权所有
定位﹕平台SDK/Graphics and MultiMedia Services/MultiMedia Audio/
Musical Intrument Device Interface/About MIDI/MIDI Services
原载﹕缥缈水云间 (bbs.freecity.cn)
Querying MIDI Devices
查询 MIDI 设备
Before playing or recording MIDI data, you must determine the capabilities of
the MIDI hardware present in the system. MIDI capability can vary from one
multimedia computer to the next; applications should not make assumptions about
the hardware present in a given system.
在播放或者录制MIDI数据之前﹐你必须确定系统中现有MIDI硬件的能力。不同多媒体电脑
的MIDI能力可能是不同的。应用程序不应该对於一个给定系统中的现有硬件作出假设(译
者注﹕例如假设硬件的能力、数量、存在性等等)。
Windows provides the following functions to determine how many MIDI devices are
available for input or output in a given system:
Windows提供下列函数来确定给定系统中用於输入或输出的MIDI设备的数量。
‧midiInGetNumDevs Retrieves the number of MIDI input devices present in
the system.
midiInGetNumDevs 获得系统中现有MIDI输入设备的数量。
‧midiOutGetNumDevs Retrieves the number of MIDI output devices present in
the system.
midiOutGetNumDevs 获得系统中现有MIDI输出设备的数量。
Like other audio devices, MIDI devices are identified by a device identifier,
which is determined implicitly from the number of devices present in a given
system. Device identifiers range from zero to the number of devices present,
minus one. For example, if there are two MIDI output devices in a system, valid
device identifiers are 0 and 1.
跟其他音频设备一样﹐MIDI设备是由设备标识符来识别的﹐该标识符是由给定系统中现有
设备的数量所确定的。设备标识符的范围是从0到现有设备的数量减一。比如﹐如果系统
中有两个MIDI输出设备﹐那麽有效的设备标识符就是0和1。
After you determine how many MIDI input or output devices are present in a
system, you can inquire about the capabilities of each device. Windows provides
the following functions to determine the capabilities of audio devices:
当你确定了给定系统中MIDI输入或输出设备的数量以後﹐你就可以开始查询每个设备的能
力了。Windows提供以下函数来确定MIDI设备(译者注﹕按照原文应该译为音频设备﹐但是
这些函数仅仅用於确定MIDI设备的能力)的能力。
‧midiInGetDevCaps Retrieves the capabilities of a given MIDI input device
and places this information in the MIDIINCAPS structure.
midiInGetDevCaps 获得给定MIDI输入设备的能力﹐并把相关信息填充到MIDIINCAPS
结构中。
‧midiOutGetDevCaps Retrieves the capabilities of a given MIDI output
device and places this information in the MIDIOUTCAPS structure.
midiOurGetDevCaps 获得给定MIDI输出设备的能力﹐并把相关信息填充到
MIDIOUTCAPS结构中。
Each of these functions has a parameter specifying the address of a structure
that the function fills with information about the capabilities of a specified
device.
这些函数都包含一个提供一个结构体指针的参数﹐这些函数就是通过利用这个指针将给定
设备的能力信息填充到相关结构体中的。
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 218.108.88.250