BASS MIDI

BASS_MIDI_StreamSetFilter


Sets an event filtering function on a MIDI stream.

BOOL BASS_MIDI_StreamSetFilter(
    HSTREAM handle,
    BOOL seeking,
    MIDIFILTERPROC *proc,
    void *user
);

Parameters

handleThe MIDI stream handle.
seekingAlso filter events when seeking?
procThe callback function... NULL = no filtering.
userUser instance data to pass to the callback function.

Return value

If successful, TRUE is returned, else FALSE is returned. Use BASS_ErrorGetCode to get the error code.

Error codes

BASS_ERROR_HANDLEhandle is not valid.
BASS_ERROR_NOTAVAILThe stream does not have an event sequence.

Remarks

This function allows a MIDI stream to have its events modified during playback via a callback function. The callback function will be called before an event is processed, and it can choose to keep the event as is, or it can modify or drop the event. The filtering can also be applied to events while seeking, so that playback begins in a filtered state after seeking.

Filtering only applies to a MIDI stream's defined event sequence, not any events that are applied via BASS_MIDI_StreamEvent or BASS_MIDI_StreamEvents.

See also

MIDIFILTERPROC callback