MusicSequenceSetUserCallback(_:_:_:)
Registers a user callback function with a music sequence.
Declaration
func MusicSequenceSetUserCallback(_ inSequence: MusicSequence, _ inCallback: MusicSequenceUserCallback?, _ inClientData: UnsafeMutableRawPointer?) -> OSStatusParameters
- inSequence:
The music sequence that you want to add a user callback function to.
- inCallback:
A reference to your callback function. Use
NULLto remove a registered callback function. - inClientData:
Your data that the music sequence provides back to your callback function when it is invoked.
Return Value
A result code.
Discussion
The music sequence invokes your callback for each user event added to any music track owned by 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 to.
Usually, where the sequence data is being scheduled for playback, the following applies:
inStartSliceBeat <= inEventTime < inEndSliceBeatThe 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.
See Also
Managing Music Sequences
NewMusicSequence(_:)DisposeMusicSequence(_:)MusicSequenceBarBeatTimeToBeats(_:_:_:)MusicSequenceBeatsToBarBeatTime(_:_:_:_:)MusicSequenceDisposeTrack(_:_:)MusicSequenceFileCreate(_:_:_:_:_:)MusicSequenceFileCreateData(_:_:_:_:_:)MusicSequenceFileLoad(_:_:_:_:)MusicSequenceFileLoadData(_:_:_:_:)MusicSequenceGetAUGraph(_:_:)MusicSequenceGetBeatsForSeconds(_:_:_:)MusicSequenceGetIndTrack(_:_:_:)MusicSequenceGetInfoDictionary(_:)MusicSequenceGetSMPTEResolution(_:_:_:)MusicSequenceGetSecondsForBeats(_:_:_:)