Tao.Sdl SDK Documentation |
|
SdlMixer.Mix_SetPostMix Method
Hook in a postmix processor
Parameters
-
mix_func
- The function pointer for the postmix processor. NULL unregisters the current postmixer.
-
arg
- A pointer to data to pass into the mix_func's udata parameter. It is a good place to keep the state data for the processor, especially if the processor is made to handle multiple channels at the same time. This may be NULL, depending on the processor.
Remarks
Hook a processor function mix_func to the postmix stream for post processing effects. You may just be reading the data and displaying it, or you may be altering the stream to add an echo. Most processors also have state data that they allocate as they are in use, this would be stored in the arg pointer data space. This processor is never really finished, until the audio device is closed, or you pass NULL as the mix_func.
There can only be one postmix function used at a time through this method. Use Mix_RegisterEffect(MIX_CHANNEL_POST, mix_func, NULL, arg) to use multiple postmix processors.
This postmix processor is run AFTER all the registered postmixers set up by Mix_RegisterEffect.
void Mix_SetPostMix(void (*mix_func)(void *udata, Uint8 *stream, int len), void *arg)
Example
// make a passthru processor function that does nothing...
void noEffect(void *udata, Uint8 *stream, int len)
{
// you could work with stream here...
}
...
// register noEffect as a postmix processor
Mix_SetPostMix(noEffect, NULL);
See Also
SdlMixer Class | Tao.Sdl Namespace | Mix_RegisterEffect