BASS_Mixer_StreamGetChannels


Retrieves a mixer's source channels.

DWORD BASS_Mixer_StreamGetChannels(
    HSTREAM handle,
    DWORD *channels,
    DWORD count
);

Parameters

handleThe mixer handle.
channelsAn array to recevive the mixer's source channel handles.
countThe maximum number of channels to receive in the channels array... 0 = get the number of source channels without getting the handles.

Return value

If successful, the number of source channels placed in the channels array is returned, or the total number of source channels if count = 0, else -1 is returned. Use BASS_ErrorGetCode to get the error code.

Error codes

BASS_ERROR_HANDLEhandle is not a valid mixer handle.

Remarks

To determine whether a particular channel is plugged in a mixer, it is simpler to use BASS_Mixer_ChannelGetMixer instead of this function.

Example

Remove all source channels from a mixer.
DWORD *channels;
DWORD a, count;
count=BASS_Mixer_StreamGetChannels(mixer, NULL, 0); // get the number of source channels
channels=(DWORD*)malloc(count*sizeof(DWORD)); // allocate channels array
BASS_Mixer_StreamGetChannels(mixer, channels, count); // get the channels
for (a=0; a<count; a++) // go through them all and...
    BASS_Mixer_ChannelRemove(channels[a]); // remove from the mixer
free(channels); // free the channels array

See also

BASS_Mixer_StreamAddChannel, BASS_Mixer_StreamAddChannelEx, BASS_Mixer_ChannelGetMixer