Miles Sound System SDK 7.2a

AIL_midiOutOpen

The function AIL_midiOutOpen assigns a Windows Multimedia Extensions low-level midiOut driver (or the MIDI Mapper device) to the Windows MSS API for MIDI music performance.

S32 AIL_midiOutOpen(
  HMDIDRIVER *drvr,
  LPHMIDIOUT *lphMidiOut,
  S32 dwDeviceID
);

In Parameters

dwDeviceID
identifies the midiOut driver to open. Typically, dwDeviceID should be set to the constant MIDI_MAPPER (defined in MMSYSTEM.H) to specify the MIDI Mapper device. You can also use the constant MIDI_NULL_DRIVER to load a "no-hardware" MIDI driver - this is commonly used when playing back DLS-only MIDI files.

Out Parameters

drvr
points to a variable of type HMDIDRIVER, which is typedefed as a pointer to a structure of type MDI_DRIVER. If AIL_midiOutOpen succeeds, an MDI_DRIVER structure will be allocated and initialized, and its address stored in the handle pointed to by *drvr. This address, referred to as a "driver handle" of type HMDIDRIVER, should be passed to other MSS functions which require that a driver be specified.
lphMidiOut
if not NULL, points to a variable of type HMIDIOUT which can be used by the application to communicate directly with the opened midiOut driver, if desired. Most applications do not need to communicate directly with waveOut drivers, so *lphMidiOut should normally be set to NULL.

Returns

Zero if the function was successful. Otherwise, a nonzero error code is returned. In the latter case, the AIL_last_error function may be called to obtain a text description of the error.

Discussion

For compatibility with other Miles platforms, you should use the AIL_open_XMIDI_driver function instead of this Windows-only function.

The only reason to use this function instead of AIL_open_XMIDI_driver is if you need to specifically open a particular midiOut device (by setting the dwDeviceID parameter).

If you wish to use this function, you should first become thoroughly familiar with the low-level MME functions midiOutGetNumDevs, midiOutGetDevCaps, and midiOutOpen. These functions permit the identification, selection, and initialization of the desired midiOut drivers. AIL_midiOutOpen takes the place of midiOutOpen and from the application's point of view, the parameters it requires are virtually identical to the MME function it replaces.


Group: XMIDI Services
Related Functions: AIL_close_XMIDI_driver, AIL_last_error, AIL_midiOutOpen, AIL_open_XMIDI_driver
Related Basic Types: HMDIDRIVER, LPHMIDIOUT, S32

For technical support, e-mail Miles3@radgametools.com
© Copyright 1991-2007 RAD Game Tools, Inc. All Rights Reserved.