Scroll to navigation

Mix_ExpireChannel(3) SDL_mixer3 FUNCTIONS Mix_ExpireChannel(3)

NAME

Mix_ExpireChannel - Change the expiration delay for a particular channel.

SYNOPSIS

#include "SDL3_mixer/SDL_mixer.h"
int Mix_ExpireChannel(int channel, int ticks);

DESCRIPTION

The channel will halt after the 'ticks' milliseconds have elapsed, or remove the expiration if 'ticks' is -1.

This overrides the value passed to the fourth parameter of

Mix_PlayChannelTimed ().

Specifying a channel of -1 will set an expiration for _all_ channels.

Any halted channels will have any currently-registered effects deregistered, and will call any callback specified by

Mix_ChannelFinished () once the halt occurs.

Note that this function does not block for the number of ticks requested; it just schedules the chunk to expire and notes the time for the mixer to manage later, and returns immediately.

FUNCTION PARAMETERS

the channel to change the expiration time on.
number of milliseconds from now to let channel play before halting, -1 to not halt.

RETURN VALUE

Returns the number of channels that changed expirations.

AVAILABILITY

This function is available since SDL_mixer 3.0.0.

SDL_mixer 3.0.0 SDL_mixer