FMUSIC_OptimizeChannels

##### [API function]

## FMUSIC_OptimizeChannels

This function helps with channel usage. If you are desperate for channels, and you are prepared to
let the music routines drop a few channels, then calling this function can help.
It basically doesnt try to play any new sounds if a certain channel limit is being played (including sound effects),
and the new sound is below a certain specified volume.
ie.
You set it to maxchannels = 16, and minvolume = 0x10.
In this case, the mod will play normally as long as the total number of channels being played inclusing sound effefcts is below 16
(see FSOUND_GetChannelsPlaying).
If the number of channels playing exceeds 16 (through a change in the music, or extra sound effects
are spawned, then sounds with a musician specified volume of less than 0x10 will be ignored.
The volume is based on volume column/default volume/volume set commands in the mod. master volume,
envelope volumes etc are not taken into account (this gives more control over how it will work from the
tracker).

DLL_API signed char F_API FMUSIC_OptimizeChannels(
FMUSIC_MODULE *mod,
int maxchannels,
int minvolume
);

### Parameters

mod | Pointer to the song to set channel/volume optimization settings.
maxchannels | Channel count to be mixed before fmusic starts to drop channels from the song.
minvolume | If maxchannels is exceeded, then music channels with volumes below this value will not be played. Range is 0-64. This is the value the tracker displays. All trackers use 0-64.

### Return Value

On success, TRUE is returned.
On failure, FALSE is returned.

### Remarks

maxchannels will default to the number of channels allocated by FSOUND, so this will never happen
by default.
minvolume will default to 0, so it will always succeed by default.
To see how many channels are currently being MIXED, use FSOUND_GetChannelsPlaying.
As a musician mentioned to me once, most of his default volumes are set fairly high, and any low end
volumes are usually echoes etc, and can afford to be dropped.
------------
Note : This function is not supported with the MIDI format.
___________________
Supported on the following platforms : Win32, WinCE, Linux, Macintosh, XBox, PlayStation 2, GameCube

### See Also

FSOUND_GetChannelsPlaying

This document copyright ©Firelight Technologies, Pty, Ltd, 1999-2002. All rights reserved.
Generated Thu Dec 15 17:31:26 2005 by SourceDoc v0.10, the automated source code documenter.