BASS_Mixer_ChannelFlags

Modifies and retrieves a source channel's mixer flags.

DWORD BASS_Mixer_ChannelFlags(
    DWORD handle,
    DWORD flags,
    DWORD mask
);

Parameters

handleThe channel handle.
flagsA combination of these flags.
BASS_MIXER_CHAN_AUTOFREEAutomatically free the source channel when it ends.
BASS_MIXER_CHAN_BUFFERBuffer the sample data, for use by BASS_Mixer_ChannelGetData and BASS_Mixer_ChannelGetLevel and BASS_Mixer_ChannelGetLevelEx.
BASS_MIXER_CHAN_DOWNMIXApply downmixing when switching SPEAKER flags or setting a default matrix with BASS_Mixer_ChannelSetMatrix. This flag is ignored if matrix mixing is not enabled.
BASS_MIXER_CHAN_LIMITLimit the mixer processing to the amount of data available from this source. This flag can only be applied to one source per mixer, so it will automatically be removed from any other source of the same mixer.
BASS_MIXER_CHAN_NORAMPDo not ramp volume/pan/matrix changes.
BASS_MIXER_CHAN_NORAMPINDo not ramp-in the start or resumptions, including after seeking with BASS_Mixer_ChannelSetPosition.
BASS_MIXER_CHAN_PAUSEPause processing of the source.
BASS_MIXER_CHAN_RAMPOUTRamp-out when pausing.
BASS_SPEAKER_xxxSpeaker assignment flags. If matrix mixing is enabled then the matrix will be modified to place the source on the requested speaker(s).
maskThe flags (as above) to modify. Flags that are not included in this are left as they are, so it can be set to 0 in order to just retrieve the current flags. To modify the SPEAKER flags, any of them can be used in the mask (no need to include all of them).

Return value

If successful, the channel's updated flags are returned, else -1 is returned. Use BASS_ErrorGetCode to get the error code.

Error codes

BASS_ERROR_HANDLEhandle is not a mixer source.
BASS_ERROR_SPEAKERThe mixer does not support the requested speaker(s), or you are attempting to assign a stereo source to a mono speaker.

Remarks

This function only deals with the channel's mixer related flags. The channel's standard flags are unaffected; use BASS_ChannelFlags to modify them.

When SPEAKER flags are combined with matrix mixing, they will be used to set the matrix and then discarded; they will not be returned by this function.

Example

Pause processing of a channel.
BASS_Mixer_ChannelFlags(channel, BASS_MIXER_CHAN_PAUSE, BASS_MIXER_CHAN_PAUSE); // set PAUSE flag

Resume processing of a paused channel.

BASS_Mixer_ChannelFlags(channel, 0, BASS_MIXER_CHAN_PAUSE); // unset PAUSE flag

See also

BASS_Mixer_StreamAddChannel