Studio::EventDescription::setCallback

FMOD Studio API

Firelight Technologies FMOD Studio API

Studio::EventDescription::setCallback

Sets a default user callback which will be assigned to all future event instances created from the event.

C++ Syntax

FMOD_RESULT Studio::EventDescription::setCallback(
  FMOD_STUDIO_EVENT_CALLBACK callback,
  FMOD_STUDIO_EVENT_CALLBACK_TYPE callbackmask
);

C Syntax

FMOD_RESULT FMOD_Studio_EventDescription_SetCallback(
  FMOD_STUDIO_EVENTDESCRIPTION *eventdescription,
  FMOD_STUDIO_EVENT_CALLBACK callback,
  FMOD_STUDIO_EVENT_CALLBACK_TYPE callbackmask
);

C# Syntax

RESULT Studio.EventDescription.setCallback(
  EVENT_CALLBACK callback,
  EVENT_CALLBACK_TYPE callbackmask = EVENT_CALLBACK_TYPE.ALL
);

JavaScript Syntax

EventDescription.setCallback(
  callback,                        
  callbackmask                     
);

Parameters

callback
Pointer to a callback function.
callbackmask
A bitfield specifying which callback types are required. Masking out some callback types can help avoid a flood of irrelevant callbacks being triggered. Defaults to FMOD_STUDIO_EVENT_CALLBACK_ALL.

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

Some callbacks can occur asynchronously depending on Studio initialisation flags. See Studio::EventInstance::setCallback for more information about when callbacks occur.

Example:

FMOD_RESULT F_CALLBACK MyEventCallback(FMOD_STUDIO_EVENT_CALLBACK_TYPE type, FMOD_STUDIO_EVENTINSTANCE *event, void *parameters);

FMOD_RESULT SetupEventCallback(Studio::EventDescription *eventDesc)
{
    return eventDesc->setCallback(MyEventCallback, FMOD_STUDIO_EVENT_CALLBACK_STARTED | FMOD_STUDIO_EVENT_CALLBACK_STOPPED);
}

See Also




Version 1.10.03 Built on Feb 1, 2018