SDL_image 1.2.4: Mix_HookMusicFinished

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

### 4.5.15 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.13 Mix_HaltMusic, 4.5.14 Mix_FadeOutMusic

This document was generated on November, 1 2002 using texi2html