Studio API Reference | Studio::EventDescription

6. Studio API Reference | Studio::EventDescription

The description for an FMOD Studio Event.

Event descriptions belong to banks and can be queried after the relevant bank has been loaded. Event descriptions may be retrieved via path or GUID lookup, or by enumerating all descriptions in a bank.

Instances:

Sample Data:

Attributes:

Parameters:

User Properties:



General:

See Also:

Studio::EventDescription::createInstance

Creates a playable instance.

C
C++
C#
JS

FMOD_RESULT Studio::EventDescription::createInstance(
  Studio::EventInstance **instance
);
instance Out
EventInstance object. (Studio::EventInstance)

When an event instance is created, any required non-streaming sample data is loaded asynchronously.

Use Studio::EventDescription::getSampleLoadingState to check the loading status.

Sample data can be loaded ahead of time with Studio::EventDescription::loadSampleData or Studio::Bank::loadSampleData. See Sample Data Loading for more information.

See Also: Studio::EventInstance::release

Studio::EventDescription::getID

Retrieves the GUID.

C
C++
C#
JS

FMOD_RESULT Studio::EventDescription::getID(
  FMOD_GUID *id
);
id Out
Event description GUID. (FMOD_GUID)

Studio::EventDescription::getInstanceCount

Retrieves the number of instances.

C
C++
C#
JS

FMOD_RESULT Studio::EventDescription::getInstanceCount(
  int *count
);
count Out
Instance count.

May be used in conjunction with Studio::EventDescription::getInstanceList to enumerate the instances of this event.

Studio::EventDescription::getInstanceList

Retrieves a list of the instances.

C
C++
C#
JS

FMOD_RESULT Studio::EventDescription::getInstanceList(
  Studio::EventInstance **array,
  int capacity,
  int *count
);
array Out
An array to receive the list. (Studio::EventInstance)
capacity
Capacity of array.
count OutOpt
Number of event instances written to array.

This function returns a maximum of capacity instances. If more than capacity instances have been created then additional instances will be silently ignored.

May be used in conjunction with Studio::EventDescription::getInstanceCount to enumerate the instances of this event.

Studio::EventDescription::getLength

Retrieves the length of the timeline.

C
C++
C#
JS

FMOD_RESULT Studio::EventDescription::getLength(
  int *length
);
length Out

Timeline length.

  • Units: Milliseconds

A timeline's length is the largest of any logic markers, transition leadouts and the end of any trigger boxes on the timeline.

See Also: Studio::EventInstance::getTimelinePosition, Studio::EventInstance::setTimelinePosition

Studio::EventDescription::getMaximumDistance

Retrieves the maximum distance for 3D attenuation.

C
C++
C#
JS

FMOD_RESULT Studio::EventDescription::getMaximumDistance(
  float *distance
);
distance Out

Maximum distance.

Retrieves the largest maximum distance value of all FMOD Spatializers FMOD_DSP_TYPE_PAN and FMOD Object Spatializers FMOD_DSP_TYPE_OBJECTPAN on the event's master track. Returns zero if none are found. This function is not compatible with third party spatializers.

See Also: Studio::EventDescription::getMinimumDistance

Studio::EventDescription::getMinimumDistance

Retrieves the minimum distance for 3D attenuation.

C
C++
C#
JS

FMOD_RESULT Studio::EventDescription::getMinimumDistance(
  float *distance
);
distance Out

Minimum distance.

Retrieves the smallest minimum distance value of all FMOD Spatializers FMOD_DSP_TYPE_PAN and FMOD Object Spatializers FMOD_DSP_TYPE_OBJECTPAN on the event's master track. Returns zero if none are found. This function is not compatible with third party spatializers.

See Also: Studio::EventDescription::getMaximumDistance

Studio::EventDescription::getParameterDescriptionByID

Retrieves an event parameter description by id.

C
C++
C#
JS

FMOD_RESULT Studio::EventDescription::getParameterDescriptionByID(
  FMOD_STUDIO_PARAMETER_ID id,
  FMOD_STUDIO_PARAMETER_DESCRIPTION *parameter
);
id
Parameter id. (FMOD_STUDIO_PARAMETER_ID)
parameter Out
Parameter description. (FMOD_STUDIO_PARAMETER_DESCRIPTION)

Studio::EventDescription::getParameterDescriptionByIndex

Retrieves an event parameter description by index.

C
C++
C#
JS

FMOD_RESULT Studio::EventDescription::getParameterDescriptionByIndex(
  int index,
  FMOD_STUDIO_PARAMETER_DESCRIPTION *parameter
);
index
Parameter index.
parameter Out
Parameter description. (FMOD_STUDIO_PARAMETER_DESCRIPTION)

May be used in combination with Studio::EventDescription::getParameterDescriptionCount to enumerate event parameters.

The order of parameters is not necessarily the same as what is shown in the FMOD Studio event editor.

Studio::EventDescription::getParameterDescriptionByName

Retrieves an event parameter description by name.

C
C++
C#
JS

FMOD_RESULT Studio::EventDescription::getParameterDescriptionByName(
  const char *name,
  FMOD_STUDIO_PARAMETER_DESCRIPTION *parameter
);
name
Parameter name (case-insensitive). (UTF-8 string)
parameter Out
Parameter description. (FMOD_STUDIO_PARAMETER_DESCRIPTION)

Studio::EventDescription::getParameterDescriptionCount

Retrieves the number of parameters in the event.

C
C++
C#
JS

FMOD_RESULT Studio::EventDescription::getParameterDescriptionCount(
  int *count
);
count Out
Parameter count.

May be used in conjunction with Studio::EventDescription::getParameterDescriptionByIndex to enumerate event parameters.

Studio::EventDescription::getPath

Retrieves the path.

C
C++
C#
JS

FMOD_RESULT Studio::EventDescription::getPath(
  char *path,
  int size,
  int *retrieved
);
path OutOpt
Buffer to receive the path. (UTF-8 string)
size
Size of the path buffer in bytes. Must be 0 if path is null.
retrieved OutOpt
Length of the path in bytes, including the terminating null character.

The strings bank must be loaded prior to calling this function, otherwise FMOD_ERR_EVENT_NOTFOUND is returned.

If the path is longer than size then it is truncated and this function returns FMOD_ERR_TRUNCATED.

The retrieved parameter can be used to get the buffer size required to hold the full path.

Studio::EventDescription::getSampleLoadingState

Retrieves the sample data loading state.

C
C++
C#
JS

FMOD_RESULT Studio::EventDescription::getSampleLoadingState(
  FMOD_STUDIO_LOADING_STATE *state
);
state Out
Loading state. (FMOD_STUDIO_LOADING_STATE)

If the event is invalid, then the state is set to FMOD_STUDIO_LOADING_STATE_UNLOADED and this function returns FMOD_ERR_INVALID_HANDLE.

See Also: Studio::EventDescription::loadSampleData, Studio::Bank::loadSampleData, Studio::EventDescription::createInstance, Sample Data Loading

Studio::EventDescription::getSoundSize

Retrieves the sound size for 3D panning.

C
C++
C#
JS

FMOD_RESULT Studio::EventDescription::getSoundSize(
  float *size
);
size Out
Sound size.

Retrieves the largest Sound Size value of all Spatializers and 3D Object Spatializers on the event's master track. Returns zero if there are no Spatializers or 3D Object Spatializers.

See Also: Studio::EventDescription::is3D

Studio::EventDescription::getUserData

Retrieves the event user data.

C
C++
C#
JS

FMOD_RESULT Studio::EventDescription::getUserData(
  void **userdata
);
userdata Out
User data set by calling Studio::EventDescription::setUserData.

Studio::EventDescription::getUserProperty

Retrieves a user property by name.

C
C++
C#
JS

FMOD_RESULT Studio::EventDescription::getUserProperty(
  const char *name,
  FMOD_STUDIO_USER_PROPERTY *property
);
name
User property name. (UTF-8 string)
property Out
User property. (FMOD_STUDIO_USER_PROPERTY)

See Also: Studio::EventDescription::getUserPropertyCount, Studio::EventDescription::getUserPropertyByIndex

Studio::EventDescription::getUserPropertyByIndex

Retrieves a user property by index.

C
C++
C#
JS

FMOD_RESULT Studio::EventDescription::getUserPropertyByIndex(
  int index,
  FMOD_STUDIO_USER_PROPERTY *property
);
index
User property index.
property Out
User property. (FMOD_STUDIO_USER_PROPERTY)

May be used in combination with Studio::EventDescription::getUserPropertyCount to enumerate event user properties.

See Also: Studio::EventDescription::getUserProperty

Studio::EventDescription::getUserPropertyCount

Retrieves the number of user properties attached to the event.

C
C++
C#
JS

FMOD_RESULT Studio::EventDescription::getUserPropertyCount(
  int *count
);
count Out
User property count.

May be used in combination with Studio::EventDescription::getUserPropertyByIndex to enumerate event user properties.

See Also: Studio::EventDescription::getUserProperty

Studio::EventDescription::hasCue

Retrieves whether the event has any sustain points.

C
C++
C#
JS

FMOD_RESULT Studio::EventDescription::hasCue(
  bool *cue
);
cue Out

Cue status. True if the event has one or more sustain points.

  • Units: Boolean

Studio::EventDescription::is3D

Retrieves the event's 3D status.

C
C++
C#
JS

FMOD_RESULT Studio::EventDescription::is3D(
  bool *is3d
);
is3d Out

3D status. True if the event is 3D.

  • Units: Boolean

An event is considered 3D if any of these conditions are met:

  • The event has a Spatializer, 3D Object Spatializer, or a 3rd party spatializer on its master track.
  • The event contains an automatic parameter that depends on the event's 3D attributes:
    • Distance
    • Event Cone Angle
    • Event Orientation
    • Direction
    • Elevation
  • The event contains any nested events which are 3D.

Note: If the event contains nested events built to separate banks using versions of FMOD Studio prior to 2.00.10 and those banks have not been loaded then this function may fail to correctly determine the event's 3D status.

Studio::EventDescription::isOneshot

Retrieves the event's oneshot status.

C
C++
C#
JS

FMOD_RESULT Studio::EventDescription::isOneshot(
  bool *oneshot
);
oneshot Out

oneshot status. True if the event is a oneshot event.

  • Units: Boolean

An event is considered oneshot if it is guaranteed to terminate without intervention in bounded time after being started. Instances of such events can be played in a fire-and-forget fashion by calling Studio::EventInstance::start immediately followed by Studio::EventInstance::release.

Note: If the event contains nested events built to separate banks and those banks have not been loaded then this function may fail to correctly determine the event's oneshot status.

Studio::EventDescription::isSnapshot

Retrieves the event's snapshot status.

C
C++
C#
JS

FMOD_RESULT Studio::EventDescription::isSnapshot(
  bool *snapshot
);
snapshot Out

Snapshot status. True if the event is a snapshot.

  • Units: Boolean

Studio::EventDescription::isStream

Retrieves the event's stream status.

C
C++
C#
JS

FMOD_RESULT Studio::EventDescription::isStream(
  bool *isStream
);
isStream Out

Stream status. True if the event contains one or more streamed sounds.

  • Units: Boolean

Note: If the event contains nested events built to separate banks and those banks have not been loaded then this function may fail to correctly determine the event's stream status.

Studio::EventDescription::isValid

Checks that the EventDescription reference is valid.

C
C++
C#
JS

bool Studio::EventDescription::isValid()

Studio::EventDescription::loadSampleData

Loads non-streaming sample data used by the event.

C
C++
C#
JS

FMOD_RESULT Studio::EventDescription::loadSampleData();

This function will load all non-streaming sample data required by the event and any referenced events.

Sample data is loaded asynchronously, Studio::EventDescription::getSampleLoadingState may be used to poll the loading state.

See Also: Studio::EventDescription::unloadSampleData, Sample Data Loading

Studio::EventDescription::releaseAllInstances

Releases all instances.

C
C++
C#
JS

FMOD_RESULT Studio::EventDescription::releaseAllInstances();

This function immediately stops and releases all instances of the event.

See Also: Studio::EventInstance::release

Studio::EventDescription::setCallback

Sets the user callback.

C
C++
C#
JS

FMOD_RESULT Studio::EventDescription::setCallback(
  FMOD_STUDIO_EVENT_CALLBACK callback,
  FMOD_STUDIO_EVENT_CALLBACK_TYPE callbackmask = FMOD_STUDIO_EVENT_CALLBACK_ALL
);
callback
User callback. (FMOD_STUDIO_EVENT_CALLBACK)
callbackmask
Bitfield specifying which callback types are required. (FMOD_STUDIO_EVENT_CALLBACK_TYPE)

This function sets a user callback which will be assigned to all event instances subsequently created from the event. The callback for individual instances can be set with Studio::EventInstance::setCallback.

See Event Callbacks for more information about when callbacks occur.

See Also: Callback Behavior

Studio::EventDescription::setUserData

Sets the event user data.

C
C++
C#
JS

FMOD_RESULT Studio::EventDescription::setUserData(
  void *userdata
);
userdata
User data.

This function allows arbitrary user data to be attached to an event description. The user data can be retrieved by calling Studio::EventDescription::getUserData.

Studio::EventDescription::unloadSampleData

Unloads all non-streaming sample data.

C
C++
C#
JS

FMOD_RESULT Studio::EventDescription::unloadSampleData();

Sample data will not be unloaded until all instances of the event are released.

See Also: Studio::EventDescription::loadSampleData, Sample Data Loading

FMOD_STUDIO_USER_PROPERTY

Describes a user property.

C
C++
C#
JS

typedef struct FMOD_STUDIO_USER_PROPERTY {
  const char                      *name;
  FMOD_STUDIO_USER_PROPERTY_TYPE   type;
  union
  {
      int                              intvalue;
      FMOD_BOOL                        boolvalue;
      float                            floatvalue;
      const char                      *stringvalue;
  }
} FMOD_STUDIO_USER_PROPERTY;
name
Property name. (UTF-8 string)
type
Property type. (FMOD_STUDIO_USER_PROPERTY_TYPE)
intvalue
Integer value. Only valid when type is FMOD_STUDIO_USER_PROPERTY_TYPE_INTEGER.
boolvalue

Boolean value. Only valid when type is FMOD_STUDIO_USER_PROPERTY_TYPE_BOOLEAN.

  • Units: Boolean
floatvalue
Floating point value. Only valid when type is FMOD_STUDIO_USER_PROPERTY_TYPE_FLOAT.
stringvalue
String value. Only valid when type is FMOD_STUDIO_USER_PROPERTY_TYPE_STRING.

See Also: Studio::EventDescription::getUserProperty

FMOD_STUDIO_USER_PROPERTY_TYPE

User property types.

C
C++
C#
JS

typedef enum FMOD_STUDIO_USER_PROPERTY_TYPE {
  FMOD_STUDIO_USER_PROPERTY_TYPE_INTEGER,
  FMOD_STUDIO_USER_PROPERTY_TYPE_BOOLEAN,
  FMOD_STUDIO_USER_PROPERTY_TYPE_FLOAT,
  FMOD_STUDIO_USER_PROPERTY_TYPE_STRING
} FMOD_STUDIO_USER_PROPERTY_TYPE;
FMOD_STUDIO_USER_PROPERTY_TYPE_INTEGER
Integer.
FMOD_STUDIO_USER_PROPERTY_TYPE_BOOLEAN
Boolean.
FMOD_STUDIO_USER_PROPERTY_TYPE_FLOAT
Floating point number.
FMOD_STUDIO_USER_PROPERTY_TYPE_STRING
String.

See Also: FMOD_STUDIO_USER_PROPERTY