作者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