EventDescription

Struct EventDescription 

Source
pub struct EventDescription { /* private fields */ }
Available on crate feature 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

Source

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.

Source

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.

Source

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.

Source

pub fn is_snapshot(&self) -> Result<bool>

Retrieves the event’s snapshot status.

Source

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.

Source

pub fn has_sustain_point(&self) -> Result<bool>

Retrieves whether the event has any sustain points.

Source

pub fn get_min_max_distance(&self) -> Result<(c_float, c_float)>

Retrieves the minimum and maximum distances for 3D attenuation.

Source

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

Source

pub fn set_userdata(&self, userdata: *mut c_void) -> Result<()>

Sets the event user data.

Source

pub fn get_userdata(&self) -> Result<*mut c_void>

Retrieves the event user data.

Source

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

Source

pub fn get_id(&self) -> Result<Guid>

Retrieves the GUID.

Source

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.

Source

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.

Source

pub fn is_valid(&self) -> bool

Checks that the EventDescription reference is valid.

Source§

impl EventDescription

Source

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.

Source

pub fn instance_count(&self) -> Result<c_int>

Retrieves the number of instances.

Source

pub fn get_instance_list(&self) -> Result<Vec<EventInstance>>

Retrieves a list of the instances.

Source

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.

Source

pub fn release_all_instances(&self) -> Result<()>

Releases all instances.

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

Source§

impl EventDescription

Source

pub fn get_parameter_description_by_name( &self, name: &Utf8CStr, ) -> Result<ParameterDescription>

Retrieves an event parameter description by name.

Source

pub fn get_parameter_description_by_id( &self, id: ParameterID, ) -> Result<ParameterDescription>

Retrieves an event parameter description by id.

Source

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.

Source

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.

Source

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.

Source

pub fn get_parameter_label_by_id( &self, id: ParameterID, label_index: c_int, ) -> Result<Utf8CString>

Retrieves an event parameter label by ID.

Source

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

Source

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.

Source

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.

Source

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

Source

pub fn get_user_property(&self, name: &Utf8CStr) -> Result<UserProperty>

Retrieves a user property by name.

Source

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.

Source

pub fn user_property_count(&self) -> Result<c_int>

Retrieves the number of user properties attached to the event.

Source§

impl EventDescription

Source

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.

Source

pub fn as_ptr(self) -> *mut FMOD_STUDIO_EVENTDESCRIPTION

Converts self into its raw representation.

Trait Implementations§

Source§

impl Clone for EventDescription

Source§

fn clone(&self) -> EventDescription

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for EventDescription

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<EventDescription> for *mut FMOD_STUDIO_EVENTDESCRIPTION

Source§

fn from(value: EventDescription) -> Self

Converts to this type from the input type.
Source§

impl Hash for EventDescription

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for EventDescription

Source§

fn eq(&self, other: &EventDescription) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for EventDescription

Source§

impl Eq for EventDescription

Source§

impl Send for EventDescription

Available on non-crate feature thread-unsafe only.
Source§

impl StructuralPartialEq for EventDescription

Source§

impl Sync for EventDescription

Available on non-crate feature thread-unsafe only.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.