BASS.NET API for the Un4seen BASS Audio LibraryBassBASS_ChannelSetLink Method BASS.NET API for the Un4seen BASS Audio Library
Links two MOD music or stream channels together.

Namespace: Un4seen.Bass
Assembly: Bass.Net (in Bass.Net.dll) Version: 2.4.12.0
Syntax

[DllImportAttribute("bass.dll", CharSet = CharSet.Unicode)]
public static bool BASS_ChannelSetLink(
	int handle,
	int chan
)

Parameters

handle
Type: SystemInt32
The channel handle... a HMUSIC or HSTREAM.
chan
Type: SystemInt32
The handle of the channel to have linked with it... a HMUSIC or HSTREAM.

Return Value

Type: Boolean
If succesful, is returned, else is returned. Use BASS_ErrorGetCode to get the error code.
Remarks

Linked channels are started/stopped/paused/resumed together. Links are one-way, for example, channel chan will be started by channel handle, but not vice versa unless another link has been set in that direction.

If a linked channel has reached the end, it will not be restarted when a channel it is linked to is started. If you want a linked channel to be restarted, you need to have resetted it's position using BASS_ChannelSetPosition(Int32, Int64, BASSMode) beforehand.

ERROR CODEDescription
BASS_ERROR_HANDLEAt least one of handle and chan is not a valid channel.
BASS_ERROR_DECODEAt least one of handle and chan is a "decoding channel", so can't be linked.
BASS_ERROR_ALREADYchan is already linked to handle.
BASS_ERROR_UNKNOWNSome other mystery problem!

Platform-specific

Except for on Windows, linked channels on the same device are guaranteed to start playing simultaneously. On Windows, it is possible for there to be a slight gap between them, but it will generally be shorter (and never longer) than starting them individually.

Examples

Link 2 streams and play them together:
VB
' link stream2 to stream1
Bass.BASS_ChannelSetLink(stream1, stream2)
' start both streams together
Bass.BASS_ChannelPlay(stream1, False)
// link stream2 to stream1
Bass.BASS_ChannelSetLink(stream1, stream2);
// start both streams together
Bass.BASS_ChannelPlay(stream1, false);
See Also

Reference