Locks a stream, MOD music or recording channel to the current thread.
|handle||The channel handle... a HMUSIC, HSTREAM or HRECORD.
|lock||If FALSE, unlock the channel, else lock it.
If successful, TRUE is returned, else FALSE is returned. Use BASS_ErrorGetCode to get the error code.
|BASS_ERROR_HANDLE||handle is not a valid channel.
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.
Lock a channel to ensure that 2 DSP functions start together.
BASS_ChannelLock(channel, TRUE); // lock channel
BASS_ChannelSetDSP(channel, DspProc1, NULL, 0); // set 1st DSP
BASS_ChannelSetDSP(channel, DspProc2, NULL, 0); // set 2nd DSP
BASS_ChannelLock(channel, FALSE); // unlock channel