SYNCPROC callback
User defined synchronizer callback function.
void CALLBACK SyncProc( HSYNC handle, DWORD channel, DWORD data, void *user );
Parameters
handle | The sync that has occurred. |
channel | The channel that the sync occurred on. |
data | Additional data associated with the sync's occurrence. |
user | The user instance data given when BASS_ChannelSetSync was called. |
Remarks
BASS creates a single thread dedicated to executing sync callback functions, so a callback function should be quick as other syncs cannot be processed until it has finished. Attribute slides (BASS_ChannelSlideAttribute) are also performed by the sync thread, so are also affected if a sync callback takes a long time."Mixtime" syncs are not executed in the sync thread, but immediately in whichever thread triggers them. In most cases that will be an update thread, and so the same restrictions that apply to stream callbacks (STREAMPROC) also apply here, except that BASS_ChannelStop can be used in a BASS_SYNC_POS sync's callback to stop a channel at a particular position.
BASS_ChannelSetPosition can be used in a mixtime sync to implement custom looping, eg. set a BASS_SYNC_POS sync at the loop end position and seek to the loop start position in the callback.