mixSetTrackStoppedCallback function mixer
- Pointer<
MixTrack> track, - Pointer<
NativeFunction< cb,MixTrackStoppedCallback> > - Pointer<
NativeType> userdata
Set a callback that fires when a MIX_Track is stopped.
When a track completes playback, either because it ran out of data to mix (and all loops were completed as well), or it was explicitly stopped by the app, it will fire the callback specified here.
Each track has its own unique callback.
Passing a NULL callback here is legal; it disables this track's callback.
Pausing a track will not fire the callback, nor will the callback fire on a playing track that is being destroyed.
It is legal to adjust the track, including changing its input and restarting it. If this is done because it ran out of data in the middle of mixing, the mixer will start mixing the new track state in its current run without any gap in the audio.
\param track the track to assign this callback to. \param cb the function to call when the track stops. May be NULL. \param userdata an opaque pointer provided to the callback for its own personal use. \returns true on success or false on failure; call SDL_GetError() for more information.
\since This function is available since SDL_mixer 3.0.0.
\sa MIX_TrackStoppedCallback
extern SDL_DECLSPEC bool SDLCALL MIX_SetTrackStoppedCallback(MIX_Track *track, MIX_TrackStoppedCallback cb, void *userdata)
Implementation
bool mixSetTrackStoppedCallback(
Pointer<MixTrack> track,
Pointer<NativeFunction<MixTrackStoppedCallback>> cb,
Pointer<NativeType> userdata,
) {
final mixSetTrackStoppedCallbackLookupFunction = _libMixer
.lookupFunction<
Uint8 Function(
Pointer<MixTrack> track,
Pointer<NativeFunction<MixTrackStoppedCallback>> cb,
Pointer<NativeType> userdata,
),
int Function(
Pointer<MixTrack> track,
Pointer<NativeFunction<MixTrackStoppedCallback>> cb,
Pointer<NativeType> userdata,
)
>('MIX_SetTrackStoppedCallback');
return mixSetTrackStoppedCallbackLookupFunction(track, cb, userdata) == 1;
}