SYNCPROC callback

User defined synchronizer callback function.

void CALLBACK SyncProc(
    HSYNC handle,
    DWORD channel,
    DWORD data,
    void *user
);

Parameters

handleThe sync that has occurred.
channelThe channel that the sync occurred on.
dataAdditional data associated with the sync's occurrence.
userThe 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 (initiated with BASS_ChannelSlideAttribute) are also performed by the sync thread, so are also affected if a sync callback takes a long time.

Unless the BASS_SYNC_THREAD flag is used, mixtime syncs are not executed in the sync thread but rather immediately in whichever thread triggers them. In most cases that will be an update thread. BASS_ChannelSetPosition may be used in such a callback to implement custom looping, eg. set a sync at the loop end position and seek to the loop start position in the callback. BASS_ChannelStop can also be used to end the channel at its current position.

See also

BASS_ChannelSetSync