Sets up a synchronizer on a mixer source channel.
HSYNC BASS_Mixer_ChannelSetSync( DWORD handle, DWORD type, QWORD param, SYNCPROC *proc, void *user );
handle | The channel handle. |
type | The type of sync. This can be one of the standard sync types, as available via BASS_ChannelSetSync, or one of the mixer specific sync types listed below. |
param | The sync parameter. |
proc | The callback function. |
user | User instance data to pass to the callback function. |
Sync types, with param and SYNCPROC data definitions.
BASS_SYNC_MIXER_ENVELOPE | Sync when an envelope ends. This is not triggered by looping envelopes. param : envelope type to sync on, 0 = all types. data : envelope type. |
BASS_SYNC_MIXER_ENVELOPE_NODE | Sync when an envelope reaches a new node. param : envelope type to sync on, 0 = all types. data : LOWORD = envelope type, HIWORD = node number. |
BASS_SYNC_STALL | Sync when mixing of the source channel is stalled/resumed. This is like the standard BASS_SYNC_STALL sync, except it can be either mixtime or not. param : not used. data : 0 = stalled, 1 = resumed. |
BASS_ERROR_HANDLE | The channel is not plugged into a mixer. |
BASS_ERROR_ILLTYPE | An illegal type was specified. |
BASS_ERROR_ILLPARAM | An illegal param was specified. |
Sync types that would automatically be mixtime when using BASS_ChannelSetSync are not so when using this function. The BASS_SYNC_MIXTIME flag should be specified in those cases, or BASS_ChannelSetSync used instead.
If the mixer itself is a decoding channel, or the BASS_SYNC_MIXTIME flag is used, then there is effectively no real difference between this function and BASS_ChannelSetSync, except for the mixer specific sync types listed above.
Using syncs on sources to make mixer state changes (eg. adding or removing sources) is not recommended if precise timing is required because they may not take effect at the same time as the sync event (they could be a bit before or after). It is better to use syncs on the mixer itself via BASS_ChannelSetSync for scheduling mixer state changes.
When a source is removed from a mixer, any syncs that have been set on it via this function are automatically removed. If the channel is subsequently plugged back into a mixer, the previous syncs will not still be set on it. Syncs set via BASS_ChannelSetSync are unaffected.