The MIDI Mapper Stream Handler is used to map MIDI data. This stream handler does not interface with an audio device driver directly but is basically a "filter" stream handler that filters the MIDI data. The Audio Stream Handler is used to interface to the audio device drivers.
This module is implemented as an OS/2 DLL running at ring 3.
Flushing a Filter Stream Group
A filter stream group requires some extra steps to properly erase its contents. Stop flushes must be sent separately to each stream. An example stream group of one master stream connected through a filter handler to a slave stream would need a stop flush sent first to the master stream. When the master stop event is received, the second stop flush must then be sent to the slave stream. Refer to the SHC_STOP command message in the OS/2 Multimedia Programming Reference.
Application and Media Driver Capabilities
For optimum performance, each application and media driver should have the following capabilities:
SEEK
External Interface Description
The description for the MIDI Mapper Stream Handler external interface follows:
File Name
This stream handler does not generate or receive sync pulses, but it can be included in a sync group. In fact, MIDI mapping is done by grouping the input stream (master stream) with the output streams (slave streams) to create a sync group. A stream will be created for each output port. The MIDI sync group can be started, stopped, and seeked as a group by using the "slaves" flag with each of these calls.
Device Control Blocks
The MIDI Mapper Stream Handler does not support a device control block.
Associate Control Blocks
The MIDI Mapper Stream Handler supports the following associate control blocks shown in the following figure.
/****************************************************** * MISH - MIDI stream handler port-stream table ACB ******************************************************/ #define ACBTYPE_MISH 0x0005L /* MIDI port-stream table */ typedef struct _acb_MISH /* acbmish - MIDI Assoc. Control Block */ { ULONG ulACBLen; /* Length of structure */ ULONG ulObjType; /* ACB_MISH */ HSTREAM hstreamDefault; /* Default hstream to use when */ /* mapper is turned off. */ ULONG ulReserved1; ULONG ulReserved2; ULONG ulNumInStreams; HSTREAM hstreamInMAX[_PORTS]; /* Array of Input streams */ ULONG ulNumOutStreams; HSTREAM hstreamOut[MAX_PORTS]; /* Array of Output streams */ /* The index into the array is */ /* the source channel for that */ /* stream. */ } ACB_MISH; /****************************************************** * MISH - MIDI stream handler SET ACB ******************************************************/ #define ACBTYPE_SET 0x0006L /* MIDI set function */ typedef struct _acb_set /* acbset - Set Assoc. Control Block */ { ULONG ulACBLen; /* Length of structure */ ULONG ulObjType; /* ACB_SET */ ULONG ulFlag; /* Set flag */ ULONG ulTempo; /* Not used. */ } ACB_SET; /* ulFlag defines: */ #define MIDI_MAP_ON 0x0000L /* turn mapping function on */ #define MIDI_MAP_OFF 0x0001L /* turn mapping function off */
Implicit Events (EVENT_IMPLICIT_TYPE) Supported
The following implicit (EVENT_IMPLICIT_TYPE) events for the MIDI Mapper Stream Handler are supported:
The ulStatus field will contain the error code. The possible error codes that can be generated and returned by this stream handler are:
Explicit Events Supported
No explicit events are supported for the MIDI Mapper Stream Handler.
Stream Handler Commands Supported
The following stream handler commands (SHC) are supported. Refer to the OS/2 Multimedia Programming Reference for a description of these SHC commands and the error return codes.
Possible Return Codes:
Possible Return Codes:
Possible Return Codes:
Possible Return Codes:
Possible Return Codes:
Possible Return Codes:
Possible Return Codes:
Possible Return Codes:
Possible Return Codes:
Possible Return Codes:
Possible Return Codes:
Base Stream Protocol Control Blocks Supported
The MIDI Mapper Stream Handler supports the following stream protocol control blocks (SPCBs).
Stream Handler Limits
Limited by system memory.