pub struct Bank { /* private fields */ }Implementations§
Source§impl Bank
impl Bank
Sourcepub fn get_path(&self) -> Result<Utf8CString>
pub fn get_path(&self) -> Result<Utf8CString>
Retrieves the path.
pub fn set_raw_userdata(&self, userdata: *mut c_void) -> Result<()>
pub fn get_raw_userdata(&self) -> Result<*mut c_void>
Source§impl Bank
impl Bank
pub fn set_userdata(&self, userdata: Userdata) -> Result<()>
pub fn get_userdata(&self) -> Result<Option<Userdata>>
Source§impl Bank
impl Bank
Sourcepub fn get_loading_state(&self) -> Result<LoadingState>
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 [super::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.
Sourcepub fn load_sample_data(&self) -> Result<()>
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 [super::EventDescription::load_sample_data] for all events in the bank, including referenced events.
Sourcepub fn unload_sample_data(&self) -> Result<()>
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.
Sourcepub fn get_sample_loading_state(&self) -> Result<LoadingState>
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.
Sourcepub fn unload(self) -> Result<()>
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 [super::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
impl Bank
Sourcepub fn get_bus_list(&self) -> Result<Vec<Bus>>
pub fn get_bus_list(&self) -> Result<Vec<Bus>>
Retrieves a list of the buses in the bank.
Sourcepub fn event_count(&self) -> Result<c_int>
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.
Sourcepub fn get_event_list(&self) -> Result<Vec<EventDescription>>
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.
Sourcepub fn string_count(&self) -> Result<c_int>
pub fn string_count(&self) -> Result<c_int>
Retrieves the number of string table entries in the bank.
Sourcepub fn get_string_info(&self, index: c_int) -> Result<(Guid, Utf8CString)>
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.
Sourcepub fn get_vca_list(&self) -> Result<Vec<Vca>>
pub fn get_vca_list(&self) -> Result<Vec<Vca>>
Retrieves a list of the VCAs in the bank.