Firelight Technologies FMOD Studio API
FMOD_STUDIO_EVENT_CALLBACK
Callback that is fired when a Studio::EventInstance changes state.
C/C++ Syntax
FMOD_RESULT F_CALLBACK FMOD_STUDIO_EVENT_CALLBACK(
FMOD_STUDIO_EVENT_CALLBACK_TYPE type,
FMOD_STUDIO_EVENTINSTANCE *event,
void *parameters
);
Parameters
type
The type of event that has occurred.
event
The event instance that has changed state. Can be cast to Studio::EventInstance* type.
parameters
The callback parameters. The data passed varies based on the callback type.
Return Values
If the function succeeds then the return value is FMOD_OK.
If the function fails then the return value will be one of the values defined in the FMOD_RESULT enumeration.
Remarks
This callback is used for tracking replay state and providing programmer sounds. The data passed to the callback function in the parameters argument varies based on the callback type. See FMOD_STUDIO_EVENT_CALLBACK_TYPE for more information.
Example:
FMOD_RESULT F_CALLBACK MyCallback(FMOD_STUDIO_EVENT_CALLBACK_TYPE type, FMOD_STUDIO_EVENTINSTANCE *event, void *parameters)
{
Studio::EventInstance *instance = (Studio::EventInstance *)event;
if (type == FMOD_STUDIO_EVENT_CALLBACK_STOPPED)
{
// Handle event instance stop here
}
else if (type == FMOD_STUDIO_EVENT_CALLBACK_CREATE_PROGRAMMER_SOUND)
{
FMOD_STUDIO_PROGRAMMER_SOUND_PROPERTIES* properties = (FMOD_STUDIO_PROGRAMMER_SOUND_PROPERTIES *)parameters;
// Handle programmer sound creation here
}
else if (type == FMOD_STUDIO_EVENT_CALLBACK_DESTROY_PROGRAMMER_SOUND)
{
FMOD_STUDIO_PROGRAMMER_SOUND_PROPERTIES* properties = (FMOD_STUDIO_PROGRAMMER_SOUND_PROPERTIES *)parameters;
// Handle programmer sound destruction here
}
return FMOD_OK;
}
See Also
- Studio::EventInstance::setCallback
- Studio::EventDescription::setCallback
- Studio::System::getSoundInfo
- FMOD_STUDIO_EVENT_CALLBACK_TYPE
- FMOD_STUDIO_PROGRAMMER_SOUND_PROPERTIES
Version 1.10.03 Built on Feb 1, 2018