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

4.3.12 Mix_ChannelFinished

void Mix_ChannelFinished(void (*channel_finished)(int channel))

channel_finished
Function to call when any channel finishes playback.

When channel playback is halted, then the specified channel_finished function is called. The channel parameter will contain the channel number that has finished.
NOTE: NEVER call SDL_Mixer functions, nor SDL_LockAudio, from a callback function.

 
// a simple channel_finished function
void channelDone(int channel) {
    printf("channel %d finished playback.\n",channel);
}

 
// make a channelDone function
void channelDone(int channel)
{
    printf("channel %d finished playing.\n", channel);
}
...
// set the callback for when a channel stops playing
Mix_ChannelFinished(channelDone);

See Also:
4.3.9 Mix_HaltChannel, 4.3.10 Mix_ExpireChannel



This document was generated on November, 13 2009 using texi2html