Tao.Sdl SDK Documentation

SdlMixer.Mix_ChannelFinished Method 

Set callback for when channel finishes playing

[Visual Basic]
Public Shared Sub Mix_ChannelFinished( _
   ByVal channel_finished As ChannelFinishedDelegate _
)
[C#]
public static void Mix_ChannelFinished(
   ChannelFinishedDelegate channel_finished
);

Parameters

channel_finished
Function to call when any channel finishes playback.

Remarks

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.

Binds to C-function in SDL_mixer.h

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

Example

            // 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

SdlMixer Class | Tao.Sdl Namespace | Mix_HaltChannel | Mix_ExpireChannel