User defined synchronizer callback function.
void CALLBACK SyncProc( HSYNC handle, DWORD channel, DWORD data, void *user );
|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.|
"Mixtime" syncs are usually not executed in the sync thread (unless the BASS_SYNC_THREAD flag is used) but rather 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. Other exceptions are that the channel can be freed in a BASS_SYNC_DEV_FAIL or BASS_SYNC_DEV_FORMAT or BASS_SYNC_SLIDE sync's callback.
BASS_ChannelSetPosition can be used in a mixtime sync (without BASS_SYNC_THREAD set) 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.