mixUnregisterEffect function

int mixUnregisterEffect(
  1. int channel,
  2. Pointer<NativeFunction<MixEffectFuncT>> f
)

Explicitly unregister a special effect function.

You may not need to call this at all, unless you need to stop an effect from processing in the middle of a chunk's playback.

Posteffects are never implicitly unregistered as they are for channels (as the output stream does not have an end), but they may be explicitly unregistered through this function by specifying MIX_CHANNEL_POST for a channel.

Note that unlike most SDL and SDL_mixer functions, this function returns zero if there's an error, not on success. We apologize for the API design inconsistency here.

\param channel the channel to unregister an effect on, or MIX_CHANNEL_POST. \param f effect the callback stop calling in future mixing iterations. \returns zero if error (no such channel or effect), nonzero if removed. Error messages can be retrieved from Mix_GetError().

\since This function is available since SDL_mixer 2.0.0.

extern DECLSPEC int SDLCALL Mix_UnregisterEffect(int channel, Mix_EffectFunc_t f)

Implementation

int mixUnregisterEffect(
    int channel, Pointer<NativeFunction<MixEffectFuncT>> f) {
  final mixUnregisterEffectLookupFunction = libSdl2Mixer.lookupFunction<
      Int32 Function(Int32 channel, Pointer<NativeFunction<MixEffectFuncT>> f),
      int Function(int channel,
          Pointer<NativeFunction<MixEffectFuncT>> f)>('Mix_UnregisterEffect');
  return mixUnregisterEffectLookupFunction(channel, f);
}