pub struct EventDescription { /* private fields */ }
studio
only.Expand description
The description for an FMOD Studio event.
Event descriptions belong to banks, and so an event description can only be queried if the relevant bank is loaded. Event descriptions may be retrieved via path or GUID lookup, or by enumerating all descriptions in a bank.
Implementations§
Source§impl EventDescription
impl EventDescription
Sourcepub fn is_3d(&self) -> Result<bool>
pub fn is_3d(&self) -> Result<bool>
Retrieves the event’s 3D status.
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
- Speed
- Speed (Absolute)
- 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.
Sourcepub fn is_doppler_enabled(&self) -> Result<bool>
pub fn is_doppler_enabled(&self) -> Result<bool>
Retrieves the event’s doppler status.
Note: If the event was built to a bank using versions of FMOD Studio prior to 2.01.09, then this function will return false regardless of the event’s doppler state.
Sourcepub fn is_oneshot(&self) -> Result<bool>
pub fn is_oneshot(&self) -> Result<bool>
Retrieves the event’s oneshot status.
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 EventInstance::start
immediately followed by 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.
Sourcepub fn is_snapshot(&self) -> Result<bool>
pub fn is_snapshot(&self) -> Result<bool>
Retrieves the event’s snapshot status.
Sourcepub fn is_stream(&self) -> Result<bool>
pub fn is_stream(&self) -> Result<bool>
Retrieves the event’s stream status.
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.
Sourcepub fn has_sustain_point(&self) -> Result<bool>
pub fn has_sustain_point(&self) -> Result<bool>
Retrieves whether the event has any sustain points.
Sourcepub fn get_min_max_distance(&self) -> Result<(c_float, c_float)>
pub fn get_min_max_distance(&self) -> Result<(c_float, c_float)>
Retrieves the minimum and maximum distances for 3D attenuation.
Sourcepub fn get_sound_size(&self) -> Result<c_float>
pub fn get_sound_size(&self) -> Result<c_float>
Retrieves the sound size for 3D panning.
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.
Source§impl EventDescription
impl EventDescription
Sourcepub fn get_userdata(&self) -> Result<*mut c_void>
pub fn get_userdata(&self) -> Result<*mut c_void>
Retrieves the event user data.
Sourcepub fn set_callback<C: EventInstanceCallback>(
&self,
mask: EventCallbackMask,
) -> Result<()>
pub fn set_callback<C: EventInstanceCallback>( &self, mask: EventCallbackMask, ) -> Result<()>
Sets the user callback.
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 EventInstance::set_callback
.
Source§impl EventDescription
impl EventDescription
Sourcepub fn get_length(&self) -> Result<c_int>
pub fn get_length(&self) -> Result<c_int>
Retrieves the length of the timeline.
A timeline’s length is the largest of any logic markers, transition leadouts and the end of any trigger boxes on the timeline.
Sourcepub fn get_path(&self) -> Result<Utf8CString>
pub fn get_path(&self) -> Result<Utf8CString>
Retrieves the path.
The strings bank must be loaded prior to calling this function, otherwise FMOD_RESULT::FMOD_ERR_EVENT_NOTFOUND
is returned.
Sourcepub fn is_valid(&self) -> bool
pub fn is_valid(&self) -> bool
Checks that the EventDescription
reference is valid.
Source§impl EventDescription
impl EventDescription
Sourcepub fn create_instance(&self) -> Result<EventInstance>
pub fn create_instance(&self) -> Result<EventInstance>
Creates a playable instance.
When an event instance is created, any required non-streaming sample data is loaded asynchronously.
Use EventDescription::get_sample_loading_state
to check the loading status.
Sample data can be loaded ahead of time with EventDescription::load_sample_data
or Bank::load_sample_data
. See Sample Data Loading for more information.
Sourcepub fn instance_count(&self) -> Result<c_int>
pub fn instance_count(&self) -> Result<c_int>
Retrieves the number of instances.
Sourcepub fn get_instance_list(&self) -> Result<Vec<EventInstance>>
pub fn get_instance_list(&self) -> Result<Vec<EventInstance>>
Retrieves a list of the instances.
Sourcepub fn get_instance_list_into(
&self,
slice: &mut [Option<EventInstance>],
) -> Result<c_int>
pub fn get_instance_list_into( &self, slice: &mut [Option<EventInstance>], ) -> Result<c_int>
Retrieves a list of the instances.
Fills in the provided slice instead of allocating a Vec
, like EventDescription::get_instance_list
does.
Any instances not filled in are left as None
.
Returns how many instances were fetched.
Sourcepub fn release_all_instances(&self) -> Result<()>
pub fn release_all_instances(&self) -> Result<()>
Releases all instances.
This function immediately stops and releases all instances of the event.
Source§impl EventDescription
impl EventDescription
Sourcepub fn get_parameter_description_by_name(
&self,
name: &Utf8CStr,
) -> Result<ParameterDescription>
pub fn get_parameter_description_by_name( &self, name: &Utf8CStr, ) -> Result<ParameterDescription>
Retrieves an event parameter description by name.
Sourcepub fn get_parameter_description_by_id(
&self,
id: ParameterID,
) -> Result<ParameterDescription>
pub fn get_parameter_description_by_id( &self, id: ParameterID, ) -> Result<ParameterDescription>
Retrieves an event parameter description by id.
Sourcepub fn get_parameter_description_by_index(
&self,
index: c_int,
) -> Result<ParameterDescription>
pub fn get_parameter_description_by_index( &self, index: c_int, ) -> Result<ParameterDescription>
Retrieves an event parameter description by index.
May be used in combination with EventDescription::parameter_description_count
to enumerate event parameters.
Note: The order of parameters is not necessarily the same as what is shown in the FMOD Studio event editor.
Sourcepub fn parameter_description_count(&self) -> Result<c_int>
pub fn parameter_description_count(&self) -> Result<c_int>
Retrieves the number of parameters in the event.
May be used in conjunction with EventDescription::get_parameter_description_by_index
to enumerate event parameters.
Sourcepub fn get_parameter_label_by_name(
&self,
name: &Utf8CStr,
label_index: c_int,
) -> Result<Utf8CString>
pub fn get_parameter_label_by_name( &self, name: &Utf8CStr, label_index: c_int, ) -> Result<Utf8CString>
Retrieves an event parameter label by name or path.
name
can be the short name (such as Wind
) or the full path (such as parameter:/Ambience/Wind
).
Path lookups will only succeed if the strings bank has been loaded.
Sourcepub fn get_parameter_label_by_id(
&self,
id: ParameterID,
label_index: c_int,
) -> Result<Utf8CString>
pub fn get_parameter_label_by_id( &self, id: ParameterID, label_index: c_int, ) -> Result<Utf8CString>
Retrieves an event parameter label by ID.
Sourcepub fn get_parameter_label_by_index(
&self,
index: c_int,
label_index: c_int,
) -> Result<Utf8CString>
pub fn get_parameter_label_by_index( &self, index: c_int, label_index: c_int, ) -> Result<Utf8CString>
Retrieves an event parameter label by index.
May be used in combination with EventDescription::parameter_description_count
to enumerate event parameters.
Source§impl EventDescription
impl EventDescription
Sourcepub fn load_sample_data(&self) -> Result<()>
pub fn load_sample_data(&self) -> Result<()>
Loads non-streaming sample data used by the event.
This function will load all non-streaming sample data required by the event and any referenced events.
Sample data is loaded asynchronously, EventDescription::get_sample_loading_state
may be used to poll the loading state.
Sourcepub fn unload_sample_data(&self) -> Result<()>
pub fn unload_sample_data(&self) -> Result<()>
Unloads all non-streaming sample data.
Sample data will not be unloaded until all instances of the event are released.
Sourcepub fn get_sample_loading_state(&self) -> Result<LoadingState>
pub fn get_sample_loading_state(&self) -> Result<LoadingState>
Retrieves the sample data loading state.
If the event is invalid, then the returned state is LoadingState::Unloaded
and this function returns FMOD_RESULT::FMOD_ERR_INVALID_HANDLE
.
Source§impl EventDescription
impl EventDescription
Sourcepub fn get_user_property(&self, name: &Utf8CStr) -> Result<UserProperty>
pub fn get_user_property(&self, name: &Utf8CStr) -> Result<UserProperty>
Retrieves a user property by name.
Sourcepub fn get_user_property_by_index(&self, index: c_int) -> Result<UserProperty>
pub fn get_user_property_by_index(&self, index: c_int) -> Result<UserProperty>
Retrieves a user property by index.
May be used in combination with EventDescription::user_property_count
to enumerate event user properties.
Sourcepub fn user_property_count(&self) -> Result<c_int>
pub fn user_property_count(&self) -> Result<c_int>
Retrieves the number of user properties attached to the event.
Source§impl EventDescription
impl EventDescription
Sourcepub unsafe fn from_ffi(value: *mut FMOD_STUDIO_EVENTDESCRIPTION) -> Self
pub unsafe fn from_ffi(value: *mut FMOD_STUDIO_EVENTDESCRIPTION) -> Self
§Safety
value
must be a valid pointer either aquired from Self::as_ptr
or FMOD.
§Panics
Panics if value
is null.
Sourcepub fn as_ptr(self) -> *mut FMOD_STUDIO_EVENTDESCRIPTION
pub fn as_ptr(self) -> *mut FMOD_STUDIO_EVENTDESCRIPTION
Converts self
into its raw representation.
Trait Implementations§
Source§impl Clone for EventDescription
impl Clone for EventDescription
Source§fn clone(&self) -> EventDescription
fn clone(&self) -> EventDescription
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for EventDescription
impl Debug for EventDescription
Source§impl From<EventDescription> for *mut FMOD_STUDIO_EVENTDESCRIPTION
impl From<EventDescription> for *mut FMOD_STUDIO_EVENTDESCRIPTION
Source§fn from(value: EventDescription) -> Self
fn from(value: EventDescription) -> Self
Source§impl Hash for EventDescription
impl Hash for EventDescription
Source§impl PartialEq for EventDescription
impl PartialEq for EventDescription
impl Copy for EventDescription
impl Eq for EventDescription
impl Send for EventDescription
thread-unsafe
only.impl StructuralPartialEq for EventDescription
impl Sync for EventDescription
thread-unsafe
only.