[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.5.17 Mix_HookMusicFinished

void Mix_HookMusicFinished(void (*music_finished)())

music_finished
Function pointer to a void function().
NULL will remove the hook.

This sets up a function to be called when music playback is halted. Any time music stops, the music_finished function will be called. Call with NULL to remove the callback.
NOTE: NEVER call SDL_Mixer functions, nor SDL_LockAudio, from a callback function.

 
// make a music finished function
void musicFinished()
{
    printf("Music stopped.\n");
}
...
// use musicFinished for when music stops
Mix_HookMusicFinished(musicFinished);

See Also:
4.5.15 Mix_HaltMusic, 4.5.16 Mix_FadeOutMusic



This document was generated on November, 13 2009 using texi2html