MusicSequenceSetUserCallback

Function MusicSequenceSetUserCallback 

Source
pub unsafe extern "C-unwind" fn MusicSequenceSetUserCallback(
    in_sequence: MusicSequence,
    in_callback: MusicSequenceUserCallback,
    in_client_data: *mut c_void,
) -> i32
Available on crate feature MusicPlayer only.
Expand description

Establish a user callback for a sequence

This call is used to register (or remove if inCallback is NULL) a callback that the MusicSequence will call for ANY UserEvents that are added to any of the tracks of the sequence.

If there is a callback registered, then UserEvents will be chased when MusicPlayerSetTime is called. In that case the inStartSliceBeat and inEndSliceBeat will both be the same value and will be the beat that the player is chasing too.

In normal cases, where the sequence data is being scheduled for playback, the following will apply: inStartSliceBeat < = inEventTime < inEndSliceBeat

The only exception to this is if the track that owns the MusicEvent is looping. In this case the start beat will still be less than the end beat (so your callback can still determine that it is playing, and what beats are currently being scheduled), however, the inEventTime will be the original time-stamped time of the user event.

Parameter inSequence: the sequence

Parameter inCallback: the callback

Parameter inClientData: client (user supplied) data provided back to the callback when it is called by the sequence

ยงSafety

  • in_sequence must be a valid pointer.
  • in_callback must be implemented correctly.
  • in_client_data must be a valid pointer or null.