6. Studio API Reference | Studio::EventInstance
An instance of an FMOD Studio Event.
Playback Control:
Playback Properties:
3D Attributes:
Parameters:
Core:
Profiling:
Callbacks:
General:
Retrieves the 3D attributes.
FMOD_RESULT Studio::EventInstance::get3DAttributes(
FMOD_3D_ATTRIBUTES *attributes
);
FMOD_RESULT FMOD_Studio_EventInstance_Get3DAttributes(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
FMOD_3D_ATTRIBUTES *attributes
);
RESULT Studio.EventInstance.get3DAttributes(
out _3D_ATTRIBUTES attributes
);
Studio.EventInstance.get3DAttributes(
attributes
);
- attributes Out
- 3D attributes. (FMOD_3D_ATTRIBUTES)
See Also: Studio::EventInstance::set3DAttributes
Retrieves the core channel group.
FMOD_RESULT Studio::EventInstance::getChannelGroup(
ChannelGroup **group
);
FMOD_RESULT FMOD_Studio_EventInstance_GetChannelGroup(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
FMOD_CHANNELGROUP **group
);
RESULT Studio.EventInstance.getChannelGroup(
out FMOD.ChannelGroup group
);
Studio.EventInstance.getChannelGroup(
group
);
- group Out
- Core channel group corresponding to the master track. (ChannelGroup)
Until the event instance has been fully created this function will return FMOD_ERR_STUDIO_NOT_LOADED.
Retrieves the event CPU usage data.
FMOD_RESULT Studio::EventInstance::getCPUUsage(
unsigned int *exclusive,
unsigned int *inclusive
);
FMOD_RESULT FMOD_Studio_EventInstance_GetCPUUsage(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
unsigned int *exclusive,
unsigned int *inclusive
);
RESULT Studio.EventInstance.getCPUUsage(
out uint exclusive,
out uint inclusive
);
Studio.EventInstance.getCPUUsage(
exclusive,
inclusive
);
- exclusive OutOpt
-
CPU time spent processing just this unit during the last update.
- inclusive OutOpt
-
CPU time spent processing this unit and all of its input during the last update.
FMOD_INIT_PROFILE_ENABLE with System::init is required to call this function.
Retrieves the event description.
FMOD_RESULT Studio::EventInstance::getDescription(
Studio::EventDescription **description
);
FMOD_RESULT FMOD_Studio_EventInstance_GetDescription(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
FMOD_STUDIO_EVENTDESCRIPTION **description
);
RESULT Studio.EventInstance.getDescription(
out EventDescription description
);
Studio.EventInstance.getDescription(
description
);
- description Out
- Event description. (Studio::EventDescription)
Retrieves the listener mask.
FMOD_RESULT Studio::EventInstance::getListenerMask(
unsigned int *mask
);
FMOD_RESULT FMOD_Studio_EventInstance_GetListenerMask(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
unsigned int *mask
);
RESULT Studio.EventInstance.getListenerMask(
out uint mask
);
Studio.EventInstance.getListenerMask(
mask
);
- mask Out
- Listener mask.
See Also: Studio::EventInstance::setListenerMask
Retrieves memory usage statistics.
FMOD_RESULT Studio::EventInstance::getMemoryUsage(
FMOD_STUDIO_MEMORY_USAGE *memoryusage
);
FMOD_RESULT FMOD_Studio_EventInstance_GetMemoryUsage(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
FMOD_STUDIO_MEMORY_USAGE *memoryusage
);
RESULT Studio.EventInstance.getMemoryUsage(
out MEMORY_USAGE memoryusage
);
Not supported for JavaScript.
- memoryusage Out
- Memory usage. (FMOD_STUDIO_MEMORY_USAGE)
Memory usage statistics are only available in logging builds, in release builds memoryusage will contain zero for all values this function.
Retrieves a parameter value by unique identifier.
FMOD_RESULT Studio::EventInstance::getParameterByID(
FMOD_STUDIO_PARAMETER_ID id,
float *value,
float *finalvalue = nullptr
);
FMOD_RESULT FMOD_Studio_EventInstance_GetParameterByID(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
FMOD_STUDIO_PARAMETER_ID id,
float *value,
float *finalvalue
);
RESULT Studio.EventInstance.getParameterByID(
PARAMETER_ID id,
out float value
);
RESULT Studio.EventInstance.getParameterByID(
PARAMETER_ID id,
out float value,
out float finalvalue
);
Studio.EventInstance.getParameterByID(
id,
value,
finalvalue
);
- id
- Parameter identifier. (FMOD_STUDIO_PARAMETER_ID)
- value OutOpt
- Parameter value as set from the public API.
- finalvalue OutOpt
- Final combined parameter value.
Automatic parameters always return value as 0 since they can never have their value set from the public API.
finalvalue is the final value of the parameter after applying adjustments due to automation, modulation, seek speed, and parameter velocity to value. This is calculated asynchronously when the Studio system updates.
See Also: Studio::EventInstance::setParameterByID
Retrieves a parameter value by name.
FMOD_RESULT Studio::EventInstance::getParameterByName(
const char *name,
float *value,
float *finalvalue = nullptr
);
FMOD_RESULT FMOD_Studio_EventInstance_GetParameterByName(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
const char *name,
float *value,
float *finalvalue
);
RESULT Studio.EventInstance.getParameterByName(
string name,
out float value
);
RESULT Studio.EventInstance.getParameterByName(
string name,
out float value,
out float finalvalue
);
Studio.EventInstance.getParameterByName(
name,
value,
finalvalue
);
- name
- Parameter name (case-insensitive). (UTF-8 string)
- value OutOpt
- Parameter value as set from the public API.
- finalvalue OutOpt
- Final combined parameter value.
Automatic parameters always return value as 0 since they can never have their value set from the public API.
finalvalue is the final value of the parameter after applying adjustments due to automation, modulation, seek speed, and parameter velocity to value. This is calculated asynchronously when the Studio system updates.
See Also: Studio::EventInstance::setParameterByName
Retrieves the pause state.
FMOD_RESULT Studio::EventInstance::getPaused(
bool *paused
);
FMOD_RESULT FMOD_Studio_EventInstance_GetPaused(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
FMOD_BOOL *paused
);
RESULT Studio.EventInstance.getPaused(
out bool paused
);
Studio.EventInstance.getPaused(
paused
);
- paused Out
-
Pause state. True if the event instance is paused.
See Also: Studio::EventInstance::setPaused
Retrieves the pitch multiplier.
FMOD_RESULT Studio::EventInstance::getPitch(
float *pitch,
float *finalpitch = nullptr
);
FMOD_RESULT FMOD_Studio_EventInstance_GetPitch(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
float *pitch,
float *finalpitch
);
RESULT Studio.EventInstance.getPitch(
out float pitch
);
RESULT Studio.EventInstance.getPitch(
out float pitch,
out float finalpitch
);
Studio.EventInstance.getPitch(
pitch,
finalpitch
);
- pitch OutOpt
- Pitch multiplier as set from the public API.
- finalpitch OutOpt
- Final combined pitch.
The final combined value returned in finalpitch combines the pitch set using Studio::EventInstance::setPitch with the result of any automation or modulation. The final combined pitch is calculated asynchronously when the Studio system updates.
Retrieves the playback state.
FMOD_RESULT Studio::EventInstance::getPlaybackState(
FMOD_STUDIO_PLAYBACK_STATE *state
);
FMOD_RESULT FMOD_Studio_EventInstance_GetPlaybackState(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
FMOD_STUDIO_PLAYBACK_STATE *state
);
RESULT Studio.EventInstance.getPlaybackState(
out PLAYBACK_STATE state
);
Studio.EventInstance.getPlaybackState(
state
);
- state Out
- Playback state. (FMOD_STUDIO_PLAYBACK_STATE)
You can poll this function to track the playback state of an event instance.
If the instance is invalid, then the state will be set to FMOD_STUDIO_PLAYBACK_STOPPED.
See Also: Studio::EventInstance::start, Studio::EventInstance::stop, FMOD_STUDIO_EVENT_CALLBACK_TYPE
Retrieves the value of a built-in property.
FMOD_RESULT Studio::EventInstance::getProperty(
FMOD_STUDIO_EVENT_PROPERTY index,
float *value
);
FMOD_RESULT FMOD_Studio_EventInstance_GetProperty(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
FMOD_STUDIO_EVENT_PROPERTY index,
float *value
);
RESULT Studio.EventInstance.getProperty(
EVENT_PROPERTY index,
out float value
);
Studio.EventInstance.getProperty(
index,
value
);
- index
- Property index. (FMOD_STUDIO_EVENT_PROPERTY)
- value Out
- Property value.
See Also: Studio::EventInstance::setProperty
Retrieves the core reverb send level.
FMOD_RESULT Studio::EventInstance::getReverbLevel(
int index,
float *level
);
FMOD_RESULT FMOD_Studio_EventInstance_GetReverbLevel(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
int index,
float *level
);
RESULT Studio.EventInstance.getReverbLevel(
int index,
out float level
);
Studio.EventInstance.getReverbLevel(
index,
level
);
- index
-
Core reverb instance index.
- level Out
- Reverb send level.
See Also: Studio::EventInstance::setReverbLevel
Retrieves the timeline cursor position.
FMOD_RESULT Studio::EventInstance::getTimelinePosition(
int *position
);
FMOD_RESULT FMOD_Studio_EventInstance_GetTimelinePosition(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
int *position
);
RESULT Studio.EventInstance.getTimelinePosition(
out int position
);
Studio.EventInstance.getTimelinePosition(
position
);
- position Out
- Timeline position.
See Also: Studio::EventInstance::setTimelinePosition
Retrieves the event instance user data.
FMOD_RESULT Studio::EventInstance::getUserData(
void **userdata
);
FMOD_RESULT FMOD_Studio_EventInstance_GetUserData(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
void **userdata
);
RESULT Studio.EventInstance.getUserData(
out IntPtr userdata
);
Studio.EventInstance.getUserData(
userdata
);
- userdata Out
- User data.
See Also: Studio::EventInstance::setUserData
Retrieves the volume level.
FMOD_RESULT Studio::EventInstance::getVolume(
float *volume,
float *finalvolume = nullptr
);
FMOD_RESULT FMOD_Studio_EventInstance_GetVolume(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
float *volume,
float *finalvolume
);
RESULT Studio.EventInstance.getVolume(
out float volume
);
RESULT Studio.EventInstance.getVolume(
out float volume,
out float finalvolume
);
Studio.EventInstance.getVolume(
volume,
finalvolume
);
- volume OutOpt
- Volume as set from the public API.
- finalvolume OutOpt
- Final combined volume.
The final combined value returned in finalvolume combines the volume set using the public API with the result of any automation or modulation. The final combined volume is calculated asynchronously when the Studio system updates.
See Also: Studio::EventInstance::setVolume
Checks that the EventInstance reference is valid.
bool Studio::EventInstance::isValid()
bool FMOD_Studio_EventInstance_IsValid(FMOD_STUDIO_EVENTINSTANCE *eventinstance)
bool Studio.EventInstance.isValid()
Studio.EventInstance.isValid()
Retrieves the virtualization state.
FMOD_RESULT Studio::EventInstance::isVirtual(
bool *virtualstate
);
FMOD_RESULT FMOD_Studio_EventInstance_IsVirtual(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
FMOD_BOOL *virtualstate
);
RESULT Studio.EventInstance.isVirtual(
out bool virtualstate
);
Studio.EventInstance.isVirtual(
virtualstate
);
- virtualstate Out
-
Virtualization state. True if the event instance has been virtualized.
This function checks whether an event instance has been virtualized due to the polyphony limit being exceeded.
Marks the event instance for release.
FMOD_RESULT Studio::EventInstance::release();
FMOD_RESULT FMOD_Studio_EventInstance_Release(FMOD_STUDIO_EVENTINSTANCE *eventinstance);
RESULT Studio.EventInstance.release();
Studio.EventInstance.release();
This function marks the event instance to be released. Event instances marked for release are destroyed by the asynchronous update when they are in the stopped state (FMOD_STUDIO_PLAYBACK_STOPPED).
See Also: Studio::EventInstance::stop, Studio::EventInstance::getPlaybackState
Sets the 3D attributes.
FMOD_RESULT Studio::EventInstance::set3DAttributes(
const FMOD_3D_ATTRIBUTES *attributes
);
FMOD_RESULT FMOD_Studio_EventInstance_Set3DAttributes(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
FMOD_3D_ATTRIBUTES *attributes
);
RESULT Studio.EventInstance.set3DAttributes(
_3D_ATTRIBUTES attributes
);
Studio.EventInstance.set3DAttributes(
attributes
);
- attributes
- 3D attributes. (FMOD_3D_ATTRIBUTES)
An event's 3D attributes specify its position, velocity and orientation. The 3D attributes are used to calculate 3D panning, doppler and the values of automatic distance and angle parameters.
See Also: Studio::EventInstance::get3DAttributes
Sets the user callback.
FMOD_RESULT Studio::EventInstance::setCallback(
FMOD_STUDIO_EVENT_CALLBACK callback,
FMOD_STUDIO_EVENT_CALLBACK_TYPE callbackmask = FMOD_STUDIO_EVENT_CALLBACK_ALL
);
FMOD_RESULT FMOD_Studio_EventInstance_SetCallback(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
FMOD_STUDIO_EVENT_CALLBACK callback,
FMOD_STUDIO_EVENT_CALLBACK_TYPE callbackmask
);
RESULT Studio.EventInstance.setCallback(
EVENT_CALLBACK callback,
EVENT_CALLBACK_TYPE callbackmask = EVENT_CALLBACK_TYPE.ALL
);
Studio.EventInstance.setCallback(
callback,
callbackmask
);
- callback
- User callback. (FMOD_STUDIO_EVENT_CALLBACK)
- callbackmask
- Bitfield specifying which callback types are required. (FMOD_STUDIO_EVENT_CALLBACK_TYPE)
See Event Callbacks for more information about when callbacks occur.
See Also: Callback Behavior, Studio::EventDescription::setCallback
Sets the listener mask.
FMOD_RESULT Studio::EventInstance::setListenerMask(
unsigned int mask
);
FMOD_RESULT FMOD_Studio_EventInstance_SetListenerMask(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
unsigned int mask
);
RESULT Studio.EventInstance.setListenerMask(
uint mask
);
Studio.EventInstance.setListenerMask(
mask
);
- mask
-
Listener mask.
The listener mask controls which listeners are considered when calculating 3D panning and the values of listener relative automatic parameters.
To create the mask you must perform bitwise OR and shift operations, the basic form is 1 << listener_index ORd together with other required listener indices.
For example to create a mask for listener index 0 and 2 the calculation would be mask = (1 << 0) | (1 << 2), to include all listeners use the default mask of 0xFFFFFFFF.
See Also: Studio::EventInstance::getListenerMask
Sets a parameter value by unique identifier.
FMOD_RESULT Studio::EventInstance::setParameterByID(
FMOD_STUDIO_PARAMETER_ID id,
float value,
bool ignoreseekspeed = false
);
FMOD_RESULT FMOD_Studio_EventInstance_SetParameterByID(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
FMOD_STUDIO_PARAMETER_ID id,
float value,
FMOD_BOOL ignoreseekspeed
);
RESULT Studio.EventInstance.setParameterByID(
PARAMETER_ID id,
float value,
bool ignoreseekspeed = false
);
Studio.EventInstance.setParameterByID(
id,
value,
ignoreseekspeed
);
- id
- Parameter identifier. (FMOD_STUDIO_PARAMETER_ID)
- value
- Value for given identifier.
- ignoreseekspeed
-
Specifies whether to ignore the parameter's seek speed and set the value immediately.
The value will be set instantly regardless of ignoreseekspeed when the Event playback state is FMOD_STUDIO_PLAYBACK_STOPPED.
If the specified parameter is an automatic parameter then FMOD_ERR_INVALID_PARAM is returned.
See Also: Studio::EventInstance::setParameterByName, Studio::EventInstance::setParametersByIDs, Studio::EventInstance::getParameterByName, Studio::EventInstance::getParameterByID
Sets a parameter value by name.
FMOD_RESULT Studio::EventInstance::setParameterByName(
const char *name,
float value,
bool ignoreseekspeed = false
);
FMOD_RESULT FMOD_Studio_EventInstance_SetParameterByName(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
const char *name,
float value,
FMOD_BOOL ignoreseekspeed
);
RESULT Studio.EventInstance.setParameterByName(
string name,
float value,
bool ignoreseekspeed = false
);
Studio.EventInstance.setParameterByName(
name,
value,
ignoreseekspeed
);
- name
- Parameter name (case-insensitive). (UTF-8 string)
- value
- Value for given name.
- ignoreseekspeed
-
Specifies whether to ignore the parameter's seek speed and set the value immediately.
The value will be set instantly regardless of ignoreseekspeed when the Event playback state is FMOD_STUDIO_PLAYBACK_STOPPED.
If the specified parameter is an automatic parameter then FMOD_ERR_INVALID_PARAM is returned.
If the event has no parameter matching name then FMOD_ERR_EVENT_NOTFOUND is returned.
See Also: Studio::EventInstance::setParameterByID, Studio::EventInstance::setParametersByIDs, Studio::EventInstance::getParameterByName, Studio::EventInstance::getParameterByID
Sets multiple parameter values by unique identifier.
FMOD_RESULT Studio::EventInstance::setParametersByIDs(
const FMOD_STUDIO_PARAMETER_ID *ids,
float *values,
int count,
bool ignoreseekspeed = false
);
FMOD_RESULT FMOD_Studio_EventInstance_SetParametersByIDs(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
const FMOD_STUDIO_PARAMETER_ID *ids,
float *values,
int count,
FMOD_BOOL ignoreseekspeed
);
RESULT Studio.EventInstance.setParametersByIDs(
PARAMETER_ID[] ids,
float[] values,
int count,
bool ignoreseekspeed = false
);
Studio.EventInstance.setParametersByIDs(
ids,
values,
count,
ignoreseekspeed
);
- ids
- Array of parameter identifiers. (FMOD_STUDIO_PARAMETER_ID)
- values
- Array of values for each given identifier.
- count
-
Number of items in the given arrays.
- ignoreseekspeed
-
Specifies whether to ignore the parameter's seek speed and set the value immediately.
All values will be set instantly regardless of ignoreseekspeed when the Event playback state is FMOD_STUDIO_PLAYBACK_STOPPED.
If any ID is set to all zeroes then the corresponding value will be ignored.
See Also: Studio::EventInstance::setParameterByName, Studio::EventInstance::setParameterByID, Studio::EventInstance::getParameterByName, Studio::EventInstance::getParameterByID
Sets the pause state.
FMOD_RESULT Studio::EventInstance::setPaused(
bool paused
);
FMOD_RESULT FMOD_Studio_EventInstance_SetPaused(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
FMOD_BOOL paused
);
RESULT Studio.EventInstance.setPaused(
bool paused
);
Studio.EventInstance.setPaused(
paused
);
- paused
-
The desired pause state. True = paused, False = unpaused.
This function allows pausing/unpausing of an event instance.
See Also: Studio::EventInstance::getPaused
Sets the pitch multiplier.
FMOD_RESULT Studio::EventInstance::setPitch(
float pitch
);
FMOD_RESULT FMOD_Studio_EventInstance_SetPitch(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
float pitch
);
RESULT Studio.EventInstance.setPitch(
float pitch
);
Studio.EventInstance.setPitch(
pitch
);
- pitch
-
Pitch multiplier.
- Units: Linear
- Range: [0, inf)
- Default: 1
The pitch multiplier is used to modulate the event instance's pitch. The pitch multiplier can be set to any value greater than or equal to zero but the final combined pitch is clamped to the range [0, 100] before being applied.
See Also: Studio::EventInstance::getPitch
Sets the value of a built-in property.
FMOD_RESULT Studio::EventInstance::setProperty(
FMOD_STUDIO_EVENT_PROPERTY index,
float value
);
FMOD_RESULT FMOD_Studio_EventInstance_SetProperty(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
FMOD_STUDIO_EVENT_PROPERTY index,
float value
);
RESULT Studio.EventInstance.setProperty(
EVENT_PROPERTY index,
float value
);
Studio.EventInstance.setProperty(
index,
value
);
- index
- Property index. (FMOD_STUDIO_EVENT_PROPERTY)
- value
- Property value.
See Also: Studio::EventInstance::getProperty
Sets the core reverb send level.
FMOD_RESULT Studio::EventInstance::setReverbLevel(
int index,
float level
);
FMOD_RESULT FMOD_Studio_EventInstance_SetReverbLevel(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
int index,
float level
);
RESULT Studio.EventInstance.setReverbLevel(
int index,
float level
);
Studio.EventInstance.setReverbLevel(
index,
level
);
- index
-
Core reverb instance index.
- level
-
Reverb send level.
- Units: Linear
- Range: [0, 1]
- Default: 0
This function controls the send level for the signal from the event instance to a core reverb instance.
See Also: Studio::EventInstance::getReverbLevel, Working with Reverb
Sets the timeline cursor position.
FMOD_RESULT Studio::EventInstance::setTimelinePosition(
int position
);
FMOD_RESULT FMOD_Studio_EventInstance_SetTimelinePosition(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
int position
);
RESULT Studio.EventInstance.setTimelinePosition(
int position
);
Studio.EventInstance.setTimelinePosition(
position
);
- position
-
Timeline position.
- Units: Milliseconds
- Range: [0, inf)
See Also: Studio::EventInstance::getTimelinePosition
Sets the event instance user data.
FMOD_RESULT Studio::EventInstance::setUserData(
void *userdata
);
FMOD_RESULT FMOD_Studio_EventInstance_SetUserData(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
void *userdata
);
RESULT Studio.EventInstance.setUserData(
IntPtr userdata
);
Studio.EventInstance.setUserData(
userdata
);
- userdata
- User data.
This function allows arbitrary user data to be attached to an event instance. The user data can be retrieved by calling Studio::EventInstance::getUserData.
Sets the volume level.
FMOD_RESULT Studio::EventInstance::setVolume(
float volume
);
FMOD_RESULT FMOD_Studio_EventInstance_SetVolume(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
float volume
);
RESULT Studio.EventInstance.setVolume(
float volume
);
Studio.EventInstance.setVolume(
volume
);
- volume
-
Volume.
- Units: Linear
- Range: [0, inf)
- Default: 1
This volume is applied as a scaling factor for the event volume. It does not override the volume level set in FMOD Studio, nor any internal volume automation or modulation.
See Also: Studio::EventInstance::getVolume
Starts playback.
FMOD_RESULT Studio::EventInstance::start();
FMOD_RESULT FMOD_Studio_EventInstance_Start(FMOD_STUDIO_EVENTINSTANCE *eventinstance);
RESULT Studio.EventInstance.start();
Studio.EventInstance.start();
If the instance was already playing then calling this function will restart the event.
See Also: Studio::EventInstance::stop, Sample Data Loading
Stops playback.
FMOD_RESULT Studio::EventInstance::stop(
FMOD_STUDIO_STOP_MODE mode
);
FMOD_RESULT FMOD_Studio_EventInstance_Stop(
FMOD_STUDIO_EVENTINSTANCE *eventinstance,
FMOD_STUDIO_STOP_MODE mode
);
RESULT Studio.EventInstance.stop(
STOP_MODE mode
);
Studio.EventInstance.stop(
mode
);
- mode
- Stop mode. (FMOD_STUDIO_STOP_MODE)
See Also: Studio::EventInstance::start
Triggers a cue on the event instance.
FMOD_RESULT Studio::EventInstance::triggerCue();
FMOD_RESULT FMOD_Studio_EventInstance_TriggerCue(FMOD_STUDIO_EVENTINSTANCE *eventinstance);
RESULT Studio.EventInstance.triggerCue();
Studio.EventInstance.triggerCue();
Triggering cues allows the timeline cursor to continue past sustain points.
Multiple cues may be triggered ahead of time and the trigger count will be decremented each time the timeline cursor passes a sustain point.
This function returns FMOD_ERR_EVENT_NOTFOUND if the event has no sustain points.
See Also: Studio::EventDescription::hasCue
Callback that is fired when a Studio::EventInstance changes state.
FMOD_RESULT F_CALLBACK FMOD_STUDIO_EVENT_CALLBACK(
FMOD_STUDIO_EVENT_CALLBACK_TYPE type,
FMOD_STUDIO_EVENTINSTANCE *event,
void *parameters
);
delegate RESULT Studio.EVENT_CALLBACK(
EVENT_CALLBACK_TYPE type,
IntPtr event,
IntPtr parameters
);
function FMOD_STUDIO_EVENT_CALLBACK(
type,
event,
parameters
)
- type
- The type of event that has occurred. (FMOD_STUDIO_EVENT_CALLBACK_TYPE)
- event
- The event instance that has changed state. (Studio::EventInstance)
- parameters
- The callback parameters. The data passed varies based on the callback type.
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.
The 'event' argument Can be cast to Studio::EventInstance *.
See Also: Callback Behavior, Studio::EventInstance::setCallback, Studio::EventDescription::setCallback, Studio::System::getSoundInfo, FMOD_STUDIO_EVENT_CALLBACK_TYPE, FMOD_STUDIO_PROGRAMMER_SOUND_PROPERTIES
Studio event callback types.
#define FMOD_STUDIO_EVENT_CALLBACK_CREATED 0x00000001
#define FMOD_STUDIO_EVENT_CALLBACK_DESTROYED 0x00000002
#define FMOD_STUDIO_EVENT_CALLBACK_STARTING 0x00000004
#define FMOD_STUDIO_EVENT_CALLBACK_STARTED 0x00000008
#define FMOD_STUDIO_EVENT_CALLBACK_RESTARTED 0x00000010
#define FMOD_STUDIO_EVENT_CALLBACK_STOPPED 0x00000020
#define FMOD_STUDIO_EVENT_CALLBACK_START_FAILED 0x00000040
#define FMOD_STUDIO_EVENT_CALLBACK_CREATE_PROGRAMMER_SOUND 0x00000080
#define FMOD_STUDIO_EVENT_CALLBACK_DESTROY_PROGRAMMER_SOUND 0x00000100
#define FMOD_STUDIO_EVENT_CALLBACK_PLUGIN_CREATED 0x00000200
#define FMOD_STUDIO_EVENT_CALLBACK_PLUGIN_DESTROYED 0x00000400
#define FMOD_STUDIO_EVENT_CALLBACK_TIMELINE_MARKER 0x00000800
#define FMOD_STUDIO_EVENT_CALLBACK_TIMELINE_BEAT 0x00001000
#define FMOD_STUDIO_EVENT_CALLBACK_SOUND_PLAYED 0x00002000
#define FMOD_STUDIO_EVENT_CALLBACK_SOUND_STOPPED 0x00004000
#define FMOD_STUDIO_EVENT_CALLBACK_REAL_TO_VIRTUAL 0x00008000
#define FMOD_STUDIO_EVENT_CALLBACK_VIRTUAL_TO_REAL 0x00010000
#define FMOD_STUDIO_EVENT_CALLBACK_ALL 0xFFFFFFFF
enum Studio.EVENT_CALLBACK_TYPE : uint
{
CREATED = 0x00000001,
DESTROYED = 0x00000002,
STARTING = 0x00000004,
STARTED = 0x00000008,
RESTARTED = 0x00000010,
STOPPED = 0x00000020,
START_FAILED = 0x00000040,
CREATE_PROGRAMMER_SOUND = 0x00000080,
DESTROY_PROGRAMMER_SOUND = 0x00000100,
PLUGIN_CREATED = 0x00000200,
PLUGIN_DESTROYED = 0x00000400,
TIMELINE_MARKER = 0x00000800,
TIMELINE_BEAT = 0x00001000,
SOUND_PLAYED = 0x00002000,
SOUND_STOPPED = 0x00004000,
REAL_TO_VIRTUAL = 0x00008000,
VIRTUAL_TO_REAL = 0x00010000,
ALL = 0xFFFFFFFF,
}
STUDIO_EVENT_CALLBACK_CREATED 0x00000001
STUDIO_EVENT_CALLBACK_DESTROYED 0x00000002
STUDIO_EVENT_CALLBACK_STARTING 0x00000004
STUDIO_EVENT_CALLBACK_STARTED 0x00000008
STUDIO_EVENT_CALLBACK_RESTARTED 0x00000010
STUDIO_EVENT_CALLBACK_STOPPED 0x00000020
STUDIO_EVENT_CALLBACK_START_FAILED 0x00000040
STUDIO_EVENT_CALLBACK_CREATE_PROGRAMMER_SOUND 0x00000080
STUDIO_EVENT_CALLBACK_DESTROY_PROGRAMMER_SOUND 0x00000100
STUDIO_EVENT_CALLBACK_PLUGIN_CREATED 0x00000200
STUDIO_EVENT_CALLBACK_PLUGIN_DESTROYED 0x00000400
STUDIO_EVENT_CALLBACK_TIMELINE_MARKER 0x00000800
STUDIO_EVENT_CALLBACK_TIMELINE_BEAT 0x00001000
STUDIO_EVENT_CALLBACK_SOUND_PLAYED 0x00002000
STUDIO_EVENT_CALLBACK_SOUND_STOPPED 0x00004000
STUDIO_EVENT_CALLBACK_REAL_TO_VIRTUAL 0x00008000
STUDIO_EVENT_CALLBACK_VIRTUAL_TO_REAL 0x00010000
STUDIO_EVENT_CALLBACK_ALL 0xFFFFFFFF
- FMOD_STUDIO_EVENT_CALLBACK_CREATED
- Called when an instance is fully created. Parameters = unused.
- FMOD_STUDIO_EVENT_CALLBACK_DESTROYED
- Called when an instance is just about to be destroyed. Parameters = unused.
- FMOD_STUDIO_EVENT_CALLBACK_STARTING
- Studio::EventInstance::start has been called on an event which was not already playing. The event will remain in this state until its sample data has been loaded. Parameters = unused.
- FMOD_STUDIO_EVENT_CALLBACK_STARTED
- The event has commenced playing. Normally this callback will be issued immediately after FMOD_STUDIO_EVENT_CALLBACK_STARTING, but may be delayed until sample data has loaded. Parameters = unused.
- FMOD_STUDIO_EVENT_CALLBACK_RESTARTED
- Studio::EventInstance::start has been called on an event which was already playing. Parameters = unused.
- FMOD_STUDIO_EVENT_CALLBACK_STOPPED
- The event has stopped. Parameters = unused.
- FMOD_STUDIO_EVENT_CALLBACK_START_FAILED
- Studio::EventInstance::start has been called but the polyphony settings did not allow the event to start. In this case none of FMOD_STUDIO_EVENT_CALLBACK_STARTING, FMOD_STUDIO_EVENT_CALLBACK_STARTED and FMOD_STUDIO_EVENT_CALLBACK_STOPPED will not be called. Parameters = unused.
- FMOD_STUDIO_EVENT_CALLBACK_CREATE_PROGRAMMER_SOUND
- A programmer sound is about to play. FMOD expects the callback to provide an FMOD::Sound object for it to use. Parameters = FMOD_STUDIO_PROGRAMMER_SOUND_PROPERTIES.
- FMOD_STUDIO_EVENT_CALLBACK_DESTROY_PROGRAMMER_SOUND
- A programmer sound has stopped playing. At this point it is safe to release the FMOD::Sound object that was used. Parameters = FMOD_STUDIO_PROGRAMMER_SOUND_PROPERTIES.
- FMOD_STUDIO_EVENT_CALLBACK_PLUGIN_CREATED
- Called when a DSP plugin instance has just been created. Parameters = FMOD_STUDIO_PLUGIN_INSTANCE_PROPERTIES.
- FMOD_STUDIO_EVENT_CALLBACK_PLUGIN_DESTROYED
- Called when a DSP plugin instance is about to be destroyed. Parameters = FMOD_STUDIO_PLUGIN_INSTANCE_PROPERTIES.
- FMOD_STUDIO_EVENT_CALLBACK_TIMELINE_MARKER
- Called when the timeline passes a named marker. Parameters = FMOD_STUDIO_TIMELINE_MARKER_PROPERTIES.
- FMOD_STUDIO_EVENT_CALLBACK_TIMELINE_BEAT
- Called when the timeline hits a beat in a tempo section. Parameters = FMOD_STUDIO_TIMELINE_BEAT_PROPERTIES.
- FMOD_STUDIO_EVENT_CALLBACK_SOUND_PLAYED
- Called when the event plays a sound. Parameters = Sound.
- FMOD_STUDIO_EVENT_CALLBACK_SOUND_STOPPED
- Called when the event finishes playing a sound. Parameters = Sound.
- FMOD_STUDIO_EVENT_CALLBACK_REAL_TO_VIRTUAL
- Called when the event becomes virtual. Parameters = unused.
- FMOD_STUDIO_EVENT_CALLBACK_VIRTUAL_TO_REAL
- Called when the event becomes real. Parameters = unused.
- FMOD_STUDIO_EVENT_CALLBACK_ALL
- Pass this mask to Studio::EventDescription::setCallback or Studio::EventInstance::setCallback to receive all callback types.
See Also: Callback Behavior, Studio::EventDescription::setCallback, Studio::EventInstance::setCallback, FMOD_STUDIO_EVENT_CALLBACK
These definitions describe built-in event properties.
typedef enum FMOD_STUDIO_EVENT_PROPERTY {
FMOD_STUDIO_EVENT_PROPERTY_CHANNELPRIORITY,
FMOD_STUDIO_EVENT_PROPERTY_SCHEDULE_DELAY,
FMOD_STUDIO_EVENT_PROPERTY_SCHEDULE_LOOKAHEAD,
FMOD_STUDIO_EVENT_PROPERTY_MINIMUM_DISTANCE,
FMOD_STUDIO_EVENT_PROPERTY_MAXIMUM_DISTANCE,
FMOD_STUDIO_EVENT_PROPERTY_COOLDOWN,
FMOD_STUDIO_EVENT_PROPERTY_MAX
} FMOD_STUDIO_EVENT_PROPERTY;
enum Studio.EVENT_PROPERTY
{
CHANNELPRIORITY,
SCHEDULE_DELAY,
SCHEDULE_LOOKAHEAD,
MINIMUM_DISTANCE,
MAXIMUM_DISTANCE,
COOLDOWN,
MAX
};
STUDIO_EVENT_PROPERTY_CHANNELPRIORITY
STUDIO_EVENT_PROPERTY_SCHEDULE_DELAY
STUDIO_EVENT_PROPERTY_SCHEDULE_LOOKAHEAD
STUDIO_EVENT_PROPERTY_MINIMUM_DISTANCE
STUDIO_EVENT_PROPERTY_MAXIMUM_DISTANCE
STUDIO_EVENT_PROPERTY_COOLDOWN
STUDIO_EVENT_PROPERTY_MAX
- FMOD_STUDIO_EVENT_PROPERTY_CHANNELPRIORITY
-
Priority to set on Core channels created by this event instance, or -1 for default.
- Range: [-1, 256]
- Default: -1
- FMOD_STUDIO_EVENT_PROPERTY_SCHEDULE_DELAY
-
Schedule delay in DSP clocks, or -1 for default.
- Range: -1, [0, inf)
- Default: -1
- FMOD_STUDIO_EVENT_PROPERTY_SCHEDULE_LOOKAHEAD
-
Schedule look-ahead on the timeline in DSP clocks, or -1 for default.
- Range: -1, [0, inf)
- Default: -1
- FMOD_STUDIO_EVENT_PROPERTY_MINIMUM_DISTANCE
-
Override the event's 3D minimum distance, or -1 for default.
- Range: -1, [0, inf)
- Default: -1
- FMOD_STUDIO_EVENT_PROPERTY_MAXIMUM_DISTANCE
-
Override the event's 3D maximum distance, or -1 for default.
- Range: -1, [0, inf)
- Default: -1
- FMOD_STUDIO_EVENT_PROPERTY_COOLDOWN
-
Override the event's cooldown, or -1 for default.
- Range: -1, [0, inf)
- Default: -1
- FMOD_STUDIO_EVENT_PROPERTY_MAX
- Maximum number of event property types.
See Also: Studio::EventInstance::getProperty, Studio::EventInstance::setProperty
Describes a DSP plugin instance.
typedef struct FMOD_STUDIO_PLUGIN_INSTANCE_PROPERTIES {
const char *name;
FMOD_DSP *dsp;
} FMOD_STUDIO_PLUGIN_INSTANCE_PROPERTIES;
struct Studio.PLUGIN_INSTANCE_PROPERTIES
{
IntPtr name;
IntPtr dsp;
}
FMOD_STUDIO_PLUGIN_INSTANCE_PROPERTIES
{
name,
};
- name
- Name of the plugin effect or sound (set in FMOD Studio).
- dsp
- DSP plugin instance. (DSP)
This data is passed to the event callback function when type is FMOD_STUDIO_EVENT_CALLBACK_PLUGIN_CREATED or FMOD_STUDIO_EVENT_CALLBACK_PLUGIN_DESTROYED.
The dsp argument can be cast to FMOD::DSP *.
See Also: FMOD_STUDIO_EVENT_CALLBACK
Describes a programmer sound.
typedef struct FMOD_STUDIO_PROGRAMMER_SOUND_PROPERTIES {
const char *name;
FMOD_SOUND *sound;
int subsoundIndex;
} FMOD_STUDIO_PROGRAMMER_SOUND_PROPERTIES;
struct Studio.PROGRAMMER_SOUND_PROPERTIES
{
StringWrapper name;
IntPtr sound;
int subsoundIndex;
}
FMOD_STUDIO_PROGRAMMER_SOUND_PROPERTIES
{
name,
sound,
subsoundIndex,
};
- name
- Name of the programmer instrument (set in FMOD Studio). (UTF-8 string)
- sound
- Programmer-created sound. (Sound)
- subsoundIndex
- Subsound index.
This data is passed to the event callback function when type is FMOD_STUDIO_EVENT_CALLBACK_CREATE_PROGRAMMER_SOUND or FMOD_STUDIO_EVENT_CALLBACK_DESTROY_PROGRAMMER_SOUND.
When the callback type is FMOD_STUDIO_EVENT_CALLBACK_CREATE_PROGRAMMER_SOUND the callback should fill in the sound and subsoundIndex fields. The provided sound should be created with the FMOD_LOOP_NORMAL mode bit set. FMOD will set this bit internally if it is not set, possibly incurring a performance penalty. The subsound index should be set to the subsound to play, or -1 if the provided sound should be used directly.
When the callback type is FMOD_STUDIO_EVENT_CALLBACK_DESTROY_PROGRAMMER_SOUND the sound in sound should be cleaned up.
sound can be cast to/from FMOD::Sound *.
See Also: FMOD_STUDIO_EVENT_CALLBACK
Stop modes.
typedef enum FMOD_STUDIO_STOP_MODE {
FMOD_STUDIO_STOP_ALLOWFADEOUT,
FMOD_STUDIO_STOP_IMMEDIATE
} FMOD_STUDIO_STOP_MODE;
enum Studio.STOP_MODE
{
ALLOWFADEOUT,
IMMEDIATE,
}
STUDIO_STOP_ALLOWFADEOUT
STUDIO_STOP_IMMEDIATE
- FMOD_STUDIO_STOP_ALLOWFADEOUT
- Allows AHDSR modulators to complete their release, and DSP effect tails to play out.
- FMOD_STUDIO_STOP_IMMEDIATE
- Stops the event instance immediately.
See Also: Studio::EventInstance::stop, Studio::Bus::stopAllEvents
Describes a beat on the timeline.
typedef struct FMOD_STUDIO_TIMELINE_BEAT_PROPERTIES {
int bar;
int beat;
int position;
float tempo;
int timesignatureupper;
int timesignaturelower;
} FMOD_STUDIO_TIMELINE_BEAT_PROPERTIES;
struct Studio.TIMELINE_BEAT_PROPERTIES
{
int bar;
int beat;
int position;
float tempo;
int timesignatureupper;
int timesignaturelower;
}
FMOD_STUDIO_TIMELINE_BEAT_PROPERTIES
{
bar,
beat,
position,
tempo,
timesignatureupper,
timesignaturelower,
};
- bar
- Bar number (starting from 1).
- beat
- Beat number within bar (starting from 1).
- position
- Position of the beat on the timeline in milliseconds.
- tempo
- Current tempo in beats per minute.
- timesignatureupper
- Current time signature upper number (beats per bar).
- timesignaturelower
- Current time signature lower number (beat unit).
This data is passed to the event callback function when type is FMOD_STUDIO_EVENT_CALLBACK_TIMELINE_BEAT.
See Also: FMOD_STUDIO_EVENT_CALLBACK
Describes a marker on the timeline.
typedef struct FMOD_STUDIO_TIMELINE_MARKER_PROPERTIES {
const char *name;
int position;
} FMOD_STUDIO_TIMELINE_MARKER_PROPERTIES;
struct Studio.TIMELINE_MARKER_PROPERTIES
{
IntPtr name;
int position;
}
FMOD_STUDIO_TIMELINE_MARKER_PROPERTIES
{
name,
position,
};
- name
- Marker name.
- position
- Position of the marker on the timeline in milliseconds.
This data is passed to the event callback function when type is FMOD_STUDIO_EVENT_CALLBACK_TIMELINE_MARKER.
See Also: Studio::EventDescription::setCallback, Studio::EventInstance::setCallback