MIDI Input Driver Messages

This section gives the required and optional messages for MIDI input device drivers. For detailed information on these messages, see the reference section later in this chapter. The midMessage entry-point function for MIDI input drivers must support the following messages.

Required Messages for MIDI Input Device Drivers

MIDM_ADDBUFFER

Adds a buffer to the input queue.

MIDM_CLOSE

Closes and deallocates a MIDI input device.

MIDM_GETDEVCAPS

Requests the capabilities of a MIDI input device.

MIDM_GETNUMDEVS

Requests the number of MIDI input devices a driver supports.

MIDM_OPEN

Opens and allocates a MIDI input device.

MIDM_RESET

Stops output and returns all data blocks to the client application.

MIDM_START

Begins MIDI input and resets the time stamp to zero.

MIDM_STOP

Ends MIDI input.


Optional Messages for MIDI Input Device Drivers

The midMessage entry-point function for MIDI input drivers may support the following messages, depending on whether the driver requires special preparation to client data buffers.

MIDM_PREPARE

Requests that the driver prepare a data block for playback.

MIDM_UNPREPARE

Requests that a driver clean up the preparation previously done on a data block.


Client Notification Messages for MIDI Input Drivers

In addition to receiving messages, drivers must notify clients when certain events occur. MIDI input drivers notify clients by sending one of the following messages using the DriverCallback function.

MIM_CLOSE

Notifies a client application when a device is closed.

MIM_DATA

Notifies a client application when the driver receives a complete MIDI event and is sending the event to the client.

MIM_ERROR

Notifies a client application when the driver receives an incomplete MIDI event.

MIM_LONGDATA

Notifies the client application when the driver returns a buffer with system-exclusive data to the client.

MIM_LONGERROR

Notifies the client application when the driver encounters an error while receiving system-exclusive data.

MIM_OPEN

Notifies a client application when a device is opened.