Firelight Technologies FMOD Studio API
FMOD_CHANNELCONTROL_CALLBACK
Callback for channel events.
C/C++ Syntax
FMOD_RESULT F_CALLBACK FMOD_CHANNELCONTROL_CALLBACK(
FMOD_CHANNELCONTROL *channel,
FMOD_CHANNELCONTROL_TYPE controltype,
FMOD_CHANNELCONTROL_CALLBACK_TYPE callbacktype,
void *commanddata1,
void *commanddata2
);
Parameters
channel
Pointer to a channel control handle.
controltype
Subtype of the channel control handle, either a channel or a channel group.
callbacktype
The type of callback. Refer to FMOD_CHANNELCONTROL_CALLBACK_TYPE.
commanddata1
The first callback type specific data generated by the callback. See remarks for meaning.
commanddata2
The second callback type specific data generated by the callback. See remarks for meaning.
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
Casting the channel handle
The 'channel' argument can be used when calling functions that are common to Channel and Channelgroup. It can be cast to FMOD::ChannelControl*
for C++.
If a Channel or Channelgroup specific function is needed the 'controltype' argument can be used. The 'controltype' argument is either:
- FMOD_CHANNELCONTROL_CHANNEL
C++: The 'channel' argument can be castFMOD::Channel*
C: The 'channel' argument can be cast toFMOD_CHANNEL*
- FMOD_CHANNELCONTROL_CHANNELGROUP
C++: The 'channel' argument can be cast toFMOD::ChannelGroup*
C: The 'channel' argument can be cast toFMOD_CHANNELGROUP*
'commanddata1' and 'commanddata2' meanings.
These 2 values are set by the callback depending on what is happening in the callback and the type of callback.
- FMOD_CHANNELCONTROL_CALLBACK_END
commanddata1: Always 0.
commanddata2: Always 0. - FMOD_CHANNELCONTROL_CALLBACK_VIRTUALVOICE
commanddata1: (cast toint
) 0 when voice is swapped from emulated to real. 1 when voice is swapped from real to emulated.
commanddata2: Always 0. - FMOD_CHANNELCONTROL_CALLBACK_SYNCPOINT
commanddata1: (cast toint
) The index of the sync point. Use Sound::getSyncPointInfo to retrieve the sync point's attributes.
commanddata2: Always 0. - FMOD_CHANNELCONTROL_CALLBACK_OCCLUSION
commanddata1: (cast tofloat *
) pointer to a floating point direct value that can be read (dereferenced) and modified after the geometry engine has calculated it for this channel.
commanddata2: (cast tofloat *
) pointer to a floating point reverb value that can be read (dereferenced) and modified after the geometry engine has calculated it for this channel.
Note! Currently the user must call System::update for these callbacks to trigger!
See Also
Version 1.10.03 Built on Feb 1, 2018