Show / Hide Table of Contents

Delegate SyncProcedureEx

User defined extended mixer synchronizer callback function (see ChannelSetSync(Int32, SyncFlags, Int64, SyncProcedureEx, IntPtr) for details).

Namespace: System.Dynamic.ExpandoObject
Assembly: ManagedBass.Mix.dll
Syntax
public delegate void SyncProcedureEx(int Handle, int Channel, int Data, IntPtr User, long Offset);
Parameters
Int32 Handle

The sync handle that has occured (as returned by ChannelSetSync(Int32, SyncFlags, Int64, SyncProcedureEx, IntPtr)).

Int32 Channel

The channel that the sync occured on (the mixer source channel).

Int32 Data

Additional data associated with the sync's occurance.

IntPtr User

The user instance data given when ChannelSetSync(Int32, SyncFlags, Int64, SyncProcedureEx, IntPtr) was called.

Int64 Offset

The offset in bytes containing the position of the sync occurrence within the update cycle converted to the mixer stream.

Remarks

A sync callback function should be very quick as other syncs can't be processed until it has finished. Attribute slides (ChannelSlideAttribute(Int32, ChannelAttribute, Single, Int32)) are also performed by the sync thread, so are also affected if a sync callback takes a long time.

If the sync is a Mixtime sync, then depending on the sync type, the callback will be executed in the update thread. The Offset specifies the position of the sync within the update buffer converted to the mixer stream position. Note that the Offset is based on the mixer's sample format, so you'll need to convert that to the source's format if using the sync to trigger things on the source.

The usual restrictions on which BASS functions can be called that apply to stream callbacks (StreamProcedure) also apply here. It is also unsafe to call ChannelSetSync(Int32, SyncFlags, Int64, SyncProcedure, IntPtr) on the same channel from a mixtime sync callback. ChannelSetPosition(Int32, Int64, PositionFlags) can be used in a mixtime sync to implement custom looping, eg. set a Position sync at the loop end position and seek to the loop start position in the callback.

Back to top Copyright © 2017 Mathew Sachin
Generated by DocFx