Bank

Struct Bank 

Source
pub struct Bank { /* private fields */ }
Available on crate feature studio only.
Expand description

Banks made in FMOD Studio contain the metadata and audio sample data required for runtime mixing and playback.

Audio sample data may be packed into the same bank as the event metadata which references it, or it may be packed into separate banks.

Implementations§

Source§

impl Bank

Source

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

Retrieves the GUID.

Source

pub fn get_path(&self) -> Result<Utf8CString>

Retrieves the path.

Source

pub fn is_valid(&self) -> bool

Checks that the Bank reference is valid.

Source

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

Sets the bank’s user data.

This function allows arbitrary user data to be attached to this object.

Source

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

Retrieves the bank’s user data.

This function allows arbitrary user data to be retrieved from this object.

Source§

impl Bank

Source

pub fn get_loading_state(&self) -> Result<LoadingState>

This function may be used to check the loading state of a bank which has been loaded asynchronously using the LoadBankFlags::NONBLOCKING flag, or is pending unload following a call to Bank::unload.

If an asynchronous load failed due to a file error state will contain LoadingState::Error and the return code from this function will be the error code of the bank load function.

Source

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

Use this function to preload sample data ahead of time so that the events in the bank can play immediately when started.

This function is equivalent to calling EventDescription::load_sample_data for all events in the bank, including referenced events.

Source

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

Unloads non-streaming sample data for all events in the bank.

Sample data loading is reference counted and the sample data will remain loaded until unload requests corresponding to all load requests are made, or until the bank is unloaded.

Source

pub fn get_sample_loading_state(&self) -> Result<LoadingState>

Retrieves the loading state of the samples in the bank.

May be used for tracking the status of the Bank::load_sample_data operation.

If Bank::load_sample_data has not been called for the bank then this function will return LoadingState::Unloaded even though sample data may have been loaded by other API calls.

Source

pub fn unload(self) -> Result<()>

Unloads the bank.

This will destroy all objects created from the bank, unload all sample data inside the bank, and invalidate all API handles referring to the bank.

If the bank was loaded from user-managed memory, e.g. by System::load_bank_pointer, then the memory must not be freed until the unload has completed. Poll the loading state using Bank::get_loading_state or use the FMOD_STUDIO_SYSTEM_CALLBACK_BANK_UNLOAD system callback to determine when it is safe to free the memory.

Source§

impl Bank

Source

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

Retrieves the number of buses in the bank.

Source

pub fn get_bus_list(&self) -> Result<Vec<Bus>>

Retrieves a list of the buses in the bank.

Source

pub fn get_bus_list_into(&self, slice: &mut [Option<Bus>]) -> Result<c_int>

Retrieves a list of the instances.

Fills in the provided slice instead of allocating a Vec, like Bank::get_bus_list does. Any instances not filled in are left as None.

Returns how many buses were fetched.

Source

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

Retrives the number of event descriptions in the bank.

This function counts the events which were added to the bank by the sound designer. The bank may contain additional events which are referenced by event instruments but were not added to the bank, and those referenced events are not counted.

Source

pub fn get_event_list(&self) -> Result<Vec<EventDescription>>

Retrieves a list of the event descriptions in the bank.

This function counts the events which were added to the bank by the sound designer. The bank may contain additional events which are referenced by event instruments but were not added to the bank, and those referenced events are not counted.

Source

pub fn get_event_list_into( &self, slice: &mut [Option<EventDescription>], ) -> Result<c_int>

Retrieves a list of the instances.

Fills in the provided slice instead of allocating a Vec, like Bank::get_event_list does. Any instances not filled in are left as None.

Returns how many events were fetched.

Source

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

Retrieves the number of string table entries in the bank.

Source

pub fn get_string_info(&self, index: c_int) -> Result<(Guid, Utf8CString)>

Retrieves a string table entry.

May be used in conjunction with Bank::string_count to enumerate the string table in a bank.

Source

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

Retrieves the number of VCAs in the bank.

Source

pub fn get_vca_list(&self) -> Result<Vec<Vca>>

Retrieves a list of the VCAs in the bank.

Source

pub fn get_vca_list_into(&self, slice: &mut [Option<Vca>]) -> Result<c_int>

Retrieves a list of the instances.

Fills in the provided slice instead of allocating a Vec, like Bank::get_vca_list does. Any instances not filled in are left as None.

Returns how many VCAs were fetched.

Source§

impl Bank

Source

pub unsafe fn from_ffi(value: *mut FMOD_STUDIO_BANK) -> 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_BANK

Converts self into its raw representation.

Trait Implementations§

Source§

impl Clone for Bank

Source§

fn clone(&self) -> Bank

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 Bank

Source§

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

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

impl From<Bank> for *mut FMOD_STUDIO_BANK

Source§

fn from(value: Bank) -> Self

Converts to this type from the input type.
Source§

impl Hash for Bank

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 Bank

Source§

fn eq(&self, other: &Bank) -> 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 Bank

Source§

impl Eq for Bank

Source§

impl Send for Bank

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

impl StructuralPartialEq for Bank

Source§

impl Sync for Bank

Available on non-crate feature thread-unsafe only.

Auto Trait Implementations§

§

impl Freeze for Bank

§

impl RefUnwindSafe for Bank

§

impl Unpin for Bank

§

impl UnwindSafe for Bank

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.