Namespace: Un4seen.Bass
Assembly: Bass.Net (in Bass.Net.dll) Version: 2.4.17.5
[DllImportAttribute("bass")] 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: BooleanIf succesful, is returned, else is returned. Use BASS_ErrorGetCode to get the error code.
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 CODE | Description |
---|---|
BASS_ERROR_HANDLE | At least one of handle and chan is not a valid channel. |
BASS_ERROR_DECODE | At least one of handle and chan is a "decoding channel", so can't be linked. |
BASS_ERROR_ALREADY | chan is already linked to handle. |
BASS_ERROR_UNKNOWN | Some 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.
// link stream2 to stream1 Bass.BASS_ChannelSetLink(stream1, stream2); // start both streams together Bass.BASS_ChannelPlay(stream1, false);