BASS.NET API for the Un4seen BASS Audio Library

BassBASS_ChannelLock Method

BASS.NET API for the Un4seen BASS Audio Library
Locks a stream, MOD music or recording channel to the current thread.

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

[DllImportAttribute("bass")]
public static bool BASS_ChannelLock(
	int handle,
	bool state
)

Parameters

handle
Type: SystemInt32
The channel handle... a HMUSIC, HSTREAM or HRECORD handle.
state
Type: SystemBoolean
If , unlock the channel, else lock it.

Return Value

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

Locking a channel prevents other threads from performing most functions on it, including buffer updates. Other threads wanting to access a locked channel will block until it is unlocked, so a channel should only be locked very briefly. A channel must be unlocked in the same thread that it was locked.
Examples

Lock a channel to ensure that 2 DSP functions start together:
Bass.BASS_ChannelLock(channel, true); // lock channel
Bass.BASS_ChannelSetDSP(channel, DspProc1, null, 0); // set 1st DSP
Bass.BASS_ChannelSetDSP(channel, DspProc2, null, 0); // set 2nd DSP
Bass.BASS_ChannelLock(channel, false); // unlock channel
See Also

Reference