Plugs a channel into a mixer, optionally delaying the start and limiting the length.
|handle||The mixer handle.
|channel||The handle of the channel to plug into the mixer... a HMUSIC, HSTREAM or HRECORD.
|flags||Any combination of these flags.
|BASS_MIXER_CHAN_ABSOLUTE||start is an absolute position in the mixer output rather than relative to the mixer's current position. If the position has already passed then the source will start immediately.
|BASS_MIXER_CHAN_BUFFER||Buffer the sample data, for use by BASS_Mixer_ChannelGetData and BASS_Mixer_ChannelGetLevel and BASS_Mixer_ChannelGetLevelEx. This increases memory requirements, so should not be enabled needlessly. The size of the buffer can be controlled via the BASS_CONFIG_MIXER_BUFFER config option.
|BASS_MIXER_CHAN_DOWNMIX||If the source uses channels/speakers that the mixer output does not have, then a matrix is created and initialized with a suitable downmixing matrix (for up to 8 channels). Note the source sample data is assumed to follow the standard channel ordering, as described in the STREAMPROC documentation.
|BASS_MIXER_CHAN_LIMIT||Limit the mixer processing to the amount of data available from this source, while the source is active (not ended). If the source stalls, then the mixer will too, rather than continuing to mix other sources, as it would normally do. 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_MATRIX||Creates a matrix, allowing the source's channels to be sent to any of the mixer output channels, at any levels. The matrix can be retrieved and modified via the BASS_Mixer_ChannelGetMatrix and BASS_Mixer_ChannelSetMatrix functions. The matrix will initially contain a mapping of the source's channels to the mixer's corresponding channels, or a one-to-one mapping (1st out = 1st in, 2nd out = 2nd in, etc) if the BASS_MIXER_NOSPEAKER flag is set on the mixer.
|BASS_MIXER_CHAN_NORAMPIN||Do not ramp-in the start, including after seeking (BASS_Mixer_ChannelSetPosition). This is useful for gapless playback, where a source channel is intended to seamlessly follow another. Even without this flag, ramping-in is skipped when the sample data begins at a low level (below -42dB). This does not affect volume and pan changes, which are always ramped.
|BASS_MIXER_CHAN_PAUSE||Pause processing of the source. Use BASS_Mixer_ChannelFlags to resume processing.
|BASS_STREAM_AUTOFREE||Automatically free the source channel when it ends. This allows you to add a channel to a mixer and forget about it, as it will automatically be freed when it has reached the end, or when the source is removed from the mixer or when the mixer is freed. When the mixer reaches the end of it, the source will be freed asynchronously (in another thread) to avoid delaying the mixer's other processing.
|BASS_SPEAKER_xxx||Speaker assignment flags. If matrix mixing is enabled then the matrix will be initialized to place the source on the requested speaker(s), with downmixing also applied if the BASS_MIXER_CHAN_DOWNMIX flag is specified.
|start||Delay (in bytes) before the channel is mixed in. If the mixer is queued (BASS_MIXER_QUEUE) then this delay will not begin until the source is dequeued.
|length||The maximum amount of data (in bytes) to mix... 0 = no limit. Once this end point is reached, the channel will be removed from the mixer.
If successful, then TRUE is returned, else FALSE is returned. Use BASS_ErrorGetCode to get the error code.
|BASS_ERROR_HANDLE||At least one of handle and channel is not valid.
|BASS_ERROR_DECODE||channel is not a decoding channel.
|BASS_ERROR_ALREADY||channel is already plugged into a mixer. It must be unplugged first.
|BASS_ERROR_SPEAKER||The mixer does not support the requested speaker(s), or you are attempting to assign a stereo stream to a mono speaker.
This function is identical to BASS_Mixer_StreamAddChannel, but with the additional ability to specify a delay and duration for the channel.
The start and length parameters relate to the mixer output. So when calculating these values, use the mixer stream's sample format rather than the source channel's. The start parameter is automatically rounded-down to the nearest sample boundary, while the length parameter is rounded-up to the nearest sample boundary. If the mixer is restarted with BASS_ChannelPlay (restart = TRUE) or BASS_ChannelSetPosition (pos = 0), the start delay will not be reset at the same time; the delay will be whatever was remaining before the mixer restarted. This is true even if the BASS_MIXER_CHAN_ABSOLUTE flag is set.
Add a channel to a mixer, delaying the start by 1 second and limiting the duration to 2 seconds.
QWORD start = BASS_ChannelSeconds2Bytes(mixer, 1); // delay
QWORD length = BASS_ChannelSeconds2Bytes(mixer, 2); // duration
BASS_Mixer_StreamAddChannelEx(mixer, channel, 0, start, length); // add the channel
BASS_Mixer_ChannelFlags, BASS_Mixer_ChannelGetLevel, BASS_Mixer_ChannelGetMixer, BASS_Mixer_ChannelGetPosition, BASS_Mixer_ChannelIsActive, BASS_Mixer_ChannelRemove, BASS_Mixer_ChannelSetMatrix, BASS_Mixer_ChannelSetPosition, BASS_Mixer_StreamAddChannel, BASS_Mixer_StreamCreate