Assembly: Bass.Net (in Bass.Net.dll) Version: 18.104.22.168
public static int BASS_Mixer_ChannelSetSyncEx( int handle, BASSSync type, long param, SYNCPROCEX proc, IntPtr user )
Public Shared Function BASS_Mixer_ChannelSetSyncEx ( handle As Integer, type As BASSSync, param As Long, proc As SYNCPROCEX, user As IntPtr ) As Integer
- Type: SystemInt32
The mixer source channel handle (which was add via BASS_Mixer_StreamAddChannel(Int32, Int32, BASSFlag) or BASS_Mixer_StreamAddChannelEx(Int32, Int32, BASSFlag, Int64, Int64)) beforehand).
- Type: Un4seen.BassBASSSync
The type of sync (see BASSSync for details). This can be one of the standard sync types, as available via BASS_ChannelSetSync(Int32, BASSSync, Int64, SYNCPROC, IntPtr), or one of the mixer specific sync types listed below plus one of the following flags:
BASS_SYNC_ONETIME Call the sync only once, and then remove it from the channel. BASS_SYNC_MIXTIME Call the sync function when the sync occurs during decoding/mixing, instead of delaying the call until the sync is actually heard. This is automatically applied with decoding channels, as they can not be played/heard.
- Type: SystemInt64
The sync parameters, depends on the sync type (see BASS_ChannelSetSync(Int32, BASSSync, Int64, SYNCPROC, IntPtr) or BASSSync for details).
- Type: Un4seen.Bass.AddOn.MixSYNCPROCEX
The callback function which should be invoked with the sync.
- Type: SystemIntPtr
User instance data to pass to the callback function.
Return ValueType: Int32
If succesful, then the new synchronizer's handle is returned, else 0 is returned. Use BASS_ErrorGetCode to get the error code.
|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.
data : LOWORD = envelope type, HIWORD = node number.
|BASS_SYNC_STALL||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.
The main difference between this method and BASS_Mixer_ChannelSetSync(Int32, BASSSync, Int64, SYNCPROC, IntPtr) is, that this method invokes the SYNCPROCEX callback. This callback contains an extra 'offeset' parameter, which defines the position of the sync occurrence within the current update cycle of the source converted to the mixer stream position. This offset might be used to calculate more accurate non-mixtime sync triggers (as with non-mixtime sync's a variable delay is to be expected, as the accuracy depends on the sync thread waking in time, and there is no guarantee when that will happen) - as well as mixtime syncs are only accurate to the current update period, as they are triggered within such. So a mixtime sync is being triggered ahead of the actual mixer position being heard. The 'offset' parameter might be used to compensate for that.
When used on a decoding channel (eg. a mixer source channel), syncs set with BASS_ChannelSetSync(Int32, BASSSync, Int64, SYNCPROC, IntPtr) are automatically "mixtime", which means that they will be triggered as soon as the sync event is encountered during decoding. But if the mixer output is being played, then there is a playback buffer involved, which will delay the hearing of the sync event. This function compensates for that, delaying the triggering of the sync until the event is actually heard. 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(Int32, BASSSync, Int64, SYNCPROC, IntPtr). One sync type that is slightly different is the BASS_SYNC_STALL sync, which can be either mixtime or not.
Sync types that would automatically be mixtime when using BASS_ChannelSetSync(Int32, BASSSync, Int64, SYNCPROC, IntPtr) are not so when using this function. The BASS_SYNC_MIXTIME flag should be specified in those cases, or BASS_ChannelSetSync(Int32, BASSSync, Int64, SYNCPROC, IntPtr) 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.
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(Int32, BASSSync, Int64, SYNCPROC, IntPtr) are unaffected.
|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.|