spSetDefaultDecisionFunction
Install a global decision function to be called for every marker.
Synopsis
Err spSetDefaultDecisionFunction (SPPlayer *player,SPDecisionFunction decisionFunc, void *decisionData)
Description
Install a global decision function that is to be called when the player reaches each marker. This can be used as a way to do some common operation at multiple locations during playback (e.g. processing a script).
Clear the global decision function with spClearDefaultDecisionFunction()
.
Arguments
- player
- SPPlayer to which to install default decision function.
- decisionFunc
- An SPDecisionFunction to install, or NULL to clear.
- decisionData
- A pointer to client-supplied data to be passed to decisionFunc when called. Can be NULL.
Return Value
Non-negative value on success; negative error code on failure.
Notes
The player normally optimizes reading data from disc by ignoring markers that have neither a branch destination nor a marker decision function. When a default decision function is installed, the player must interrupt reading data from disc in preparation for a potential branch at EVERY marker, even if the default decision function does nothing. This can severely impact performance depending on the placement of markers.
Implementation
Library call implemented in music.lib V24.
Associated Files
soundplayer.h, music.lib
See Also
spClearMarkerDecisionFunction
(), spSetMarkerDecisionFunction(), SPDecisionFunction