Struct fmod::core::SoundBuilder
source · pub struct SoundBuilder<'a> { /* private fields */ }Implementations§
source§impl<'a> SoundBuilder<'a>
impl<'a> SoundBuilder<'a>
pub const fn open(filename: &'a Utf8CStr) -> Self
sourcepub const unsafe fn open_memory(data: &'a [u8]) -> Self
pub const unsafe fn open_memory(data: &'a [u8]) -> Self
sourcepub const unsafe fn open_memory_point(data: &'a [u8]) -> Self
pub const unsafe fn open_memory_point(data: &'a [u8]) -> Self
§Safety
The slice must remain valid until the sound has been released.
Unlike Self::open_memory this function does not copy the data, so it is even more unsafe!
sourcepub const unsafe fn with_raw_ex_info(
self,
ex_info: FMOD_CREATESOUNDEXINFO,
) -> Self
pub const unsafe fn with_raw_ex_info( self, ex_info: FMOD_CREATESOUNDEXINFO, ) -> Self
§Safety
The FMOD_CREATESOUNDEXINFO must be valid.
pub const fn with_file_offset(self, file_offset: c_uint) -> Self
pub const fn with_open_raw( self, channel_count: c_int, default_frequency: c_int, format: SoundFormat, ) -> Self
pub const fn with_mode(self, mode: Mode) -> Self
pub const fn with_decode_buffer_size(self, size: c_uint) -> Self
pub const fn with_initial_subsound(self, initial_subsound: c_int) -> Self
pub const fn with_subsound_count(self, count: c_int) -> Self
pub const fn with_inclusion_list(self, list: &'a [c_int]) -> Self
pub const fn with_dls_name(self, dls_name: &'a Utf8CStr) -> Self
pub const fn with_encryption_key(self, key: &'a Utf8CStr) -> Self
pub fn with_max_polyphony(self, max_polyphony: c_int) -> Self
pub const fn with_suggested_sound_type(self, sound_type: SoundType) -> Self
pub const fn with_file_buffer_size(self, size: c_int) -> Self
pub const fn with_channel_order(self, order: ChannelOrder) -> Self
pub fn with_initial_sound_group(self, group: SoundGroup) -> Self
pub const fn with_initial_seek_position( self, position: c_uint, unit: TimeUnit, ) -> Self
pub fn with_ignore_set_filesystem(self, ignore: bool) -> Self
pub const fn with_min_midi_granularity(self, granularity: c_uint) -> Self
pub const fn with_non_block_thread_id(self, id: c_int) -> Self
pub const fn with_fsb_guid(self, guid: &'a Guid) -> Self
source§impl<'a> SoundBuilder<'a>
impl<'a> SoundBuilder<'a>
pub const fn mode(&self) -> Mode
pub const fn raw_ex_info(&self) -> FMOD_CREATESOUNDEXINFO
pub const fn raw_name_or_data(&self) -> *const c_char
pub fn name_or_url(&self) -> Option<&Utf8CStr>
pub fn data(&self) -> Option<&[u8]>
pub fn length(&self) -> c_uint
pub fn file_offset(&self) -> c_uint
pub fn num_channels(&self) -> c_int
pub fn default_frequency(&self) -> c_int
pub fn format(&self) -> SoundFormat
pub fn decode_buffer_size(&self) -> c_uint
pub fn initial_subsound(&self) -> c_int
pub fn subsound_count(&self) -> c_int
pub fn inclusion_list(&self) -> Option<&'a [c_int]>
pub fn dls_name(&self) -> Option<&Utf8CStr>
pub fn encryption_key(&self) -> Option<&Utf8CStr>
pub fn max_polyphony(&self) -> c_int
pub fn suggested_sound_type(&self) -> SoundType
pub fn file_buffer_size(&self) -> c_int
pub fn channel_order(&self) -> ChannelOrder
pub fn initial_sound_group(&self) -> SoundGroup
pub fn initial_seek_position(&self) -> (c_uint, TimeUnit)
pub fn ignore_set_filesystem(&self) -> bool
pub fn min_midi_granularity(&self) -> c_uint
pub fn non_block_thread_id(&self) -> c_int
pub fn fsb_guid(&self) -> Option<Guid>
source§impl<'a> SoundBuilder<'a>
impl<'a> SoundBuilder<'a>
sourcepub unsafe fn from_ffi(
name_or_data: *const c_char,
mode: FMOD_MODE,
create_sound_ex_info: FMOD_CREATESOUNDEXINFO,
) -> Self
pub unsafe fn from_ffi( name_or_data: *const c_char, mode: FMOD_MODE, create_sound_ex_info: FMOD_CREATESOUNDEXINFO, ) -> Self
§Safety
The mode must match the required fields of the FMOD_CREATESOUNDEXINFO struct.
The FMOD_CREATESOUNDEXINFO struct’s cbsize field must be set to the size of the struct.
If the mode is not Mode::OPEN_MEMORY or Mode::OPEN_MEMORY_POINT name_or_data pointer must be valid for reads of bytes up to and including the nul terminator.
If the mode is Mode::OPEN_MEMORY or Mode::OPEN_MEMORY_POINT the data pointer must be valid for reads of bytes up to FMOD_CREATESOUNDEXINFO::length.
The lifetime of the builder is unbounded and MUST be constrained!
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for SoundBuilder<'a>
impl<'a> RefUnwindSafe for SoundBuilder<'a>
impl<'a> !Send for SoundBuilder<'a>
impl<'a> !Sync for SoundBuilder<'a>
impl<'a> Unpin for SoundBuilder<'a>
impl<'a> UnwindSafe for SoundBuilder<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more