Event Callbacks for different callback types

Hi,
Is it possible to setup multiple callbacks on events,
eg different callbacks for differnt EVENT_CALLBACK_TYPEs?

Or is it only possible to have a single callback on an event?

Just looking for some clarity as I’m unclear on this from the docs.

I’m trying to setup a callback for programmer instruments and a diffferent callback for markers and beats, eg something along the lines of this:

instrumentCallback = new FMOD.Studio.EVENT_CALLBACK(InstrumentEventCallback);

eventInstance.setCallback(instrumentCallback, FMOD.Studio.EVENT_CALLBACK_TYPE.CREATE_PROGRAMMER_SOUND | EVENT_CALLBACK_TYPE.DESTROY_PROGRAMMER_SOUND);

eventCallback = new FMOD.Studio.EVENT_CALLBACK(BeatEventCallback);
            
eventInstance.setCallback(eventCallback, FMOD.Studio.EVENT_CALLBACK_TYPE.TIMELINE_BEAT | FMOD.Studio.EVENT_CALLBACK_TYPE.TIMELINE_MARKER);

thanks all

Hi,

Thank you for sharing the code.

It is indeed possible to set up multiple callbacks flags on the same event instance. I would suggest you to have a look at a similar post which I will link here:

Hope it helps, let me know if you have any questions.

1 Like