int Mix_ReserveChannels(int num)


Reserve num channels from being used when playing samples when passing in -1 as a channel number to playback functions. The channels are reserved starting from channel 0 to num-1. Passing in zero will unreserve all channels. Normally SDL_mixer starts without any channels reserved.

The following functions are affected by this setting: 4.3.3 Mix_PlayChannel 4.3.4 Mix_PlayChannelTimed 4.3.5 Mix_FadeInChannel 4.3.6 Mix_FadeInChannelTimed

Returns: The number of channels reserved. Never fails, but may return less channels than you ask for, depending on the number of channels previously allocated.

// reserve the first 8 mixing channels int reserved_count; reserved_count=Mix_ReserveChannels(8); if(reserved_count!=8) {


See Also: 4.3.1 Mix_AllocateChannels

Mix_ReserveChannels (last edited 2009-02-09 22:41:01 by 84)