Miles Sound System SDK 7.2a

AIL_register_event_callback

The function AIL_register_event_callback registers an application function to be called immediately prior to processing each XMIDI or MIDI Channel Voice message event associated with a given driver.

AILEVENTCB AIL_register_event_callback(
  HMDIDRIVER mdi,
  AILEVENTCB callback
);

In Parameters

mdi
indicates the driver whose XMIDI and MIDI events are to be trapped by the callback function.
callback
should be set to the address of an application function prototyped as an AILEVENTCB callback.

Returns

The address of the previously-installed event trap function handler.

Discussion

Most MSS functions can be safely invoked from within callback functions. Exceptions include driver-installation or driver-shutdown functions and any other functions which may perform DOS or BIOS calls, such as AIL_init_sequence. These exceptions are noted in the descriptions of the functions involved. If in doubt about whether a particular action may safely be performed from within a callback function, contact RAD Game Tools for assistance.

Notwithstanding the above, it is recommended that application programmers refrain from calling other MSS XMIDI functions from within a MIDI event trap except when absolutely necessary, and only after carefully examining AILXMIDI.C's source code to guard against potentially undesirable side-effects. For example, an explicit call to AIL_send_channel_voice_message from within a MIDI event trap callback function may result in a reentrant call to the MIDI event trap function.

This function is intended primarily for use in tool and diagnostic program development, and to provide a way for the application to implement its own MIDI/XMIDI interpreter (for example, a software-based "wavetable synthesizer" such as AILXDIG.C).


Group: XMIDI Services
Related Functions: AILEVENTCB, AIL_init_sequence, AIL_register_beat_callback, AIL_register_prefix_callback, AIL_register_sequence_callback, AIL_register_timbre_callback, AIL_register_trigger_callback, AIL_send_channel_voice_message
Related Basic Types: HMDIDRIVER
Related FAQs: What's the deal with callbacks - are they threads, interrupts, system timers, or what?

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