Struct fmod::core::SoundBuilder

source ·
pub struct SoundBuilder<'a> { /* private fields */ }

Implementations§

source§

impl<'a> SoundBuilder<'a>

source

pub const fn open(filename: &'a Utf8CStr) -> Self

source

pub const unsafe fn open_memory(data: &'a [u8]) -> Self

§Safety

The slice must remain valid until the sound has been loaded. See the Mode docs for more information.

source

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!

source

pub const unsafe fn with_raw_ex_info( self, ex_info: FMOD_CREATESOUNDEXINFO, ) -> Self

§Safety

The FMOD_CREATESOUNDEXINFO must be valid.

source

pub const fn with_file_offset(self, file_offset: c_uint) -> Self

source

pub const fn with_open_raw( self, channel_count: c_int, default_frequency: c_int, format: SoundFormat, ) -> Self

source

pub const fn with_mode(self, mode: Mode) -> Self

source

pub const fn with_decode_buffer_size(self, size: c_uint) -> Self

source

pub const fn with_initial_subsound(self, initial_subsound: c_int) -> Self

source

pub const fn with_subsound_count(self, count: c_int) -> Self

source

pub const fn with_inclusion_list(self, list: &'a [c_int]) -> Self

source

pub const fn with_dls_name(self, dls_name: &'a Utf8CStr) -> Self

source

pub const fn with_encryption_key(self, key: &'a Utf8CStr) -> Self

source

pub fn with_max_polyphony(self, max_polyphony: c_int) -> Self

source

pub const fn with_suggested_sound_type(self, sound_type: SoundType) -> Self

source

pub const fn with_file_buffer_size(self, size: c_int) -> Self

source

pub const fn with_channel_order(self, order: ChannelOrder) -> Self

source

pub fn with_initial_sound_group(self, group: SoundGroup) -> Self

source

pub const fn with_initial_seek_position( self, position: c_uint, unit: TimeUnit, ) -> Self

source

pub fn with_ignore_set_filesystem(self, ignore: bool) -> Self

source

pub const fn with_min_midi_granularity(self, granularity: c_uint) -> Self

source

pub const fn with_non_block_thread_id(self, id: c_int) -> Self

source

pub const fn with_fsb_guid(self, guid: &'a Guid) -> Self

source§

impl<'a> SoundBuilder<'a>

source

pub const fn mode(&self) -> Mode

source

pub const fn raw_ex_info(&self) -> FMOD_CREATESOUNDEXINFO

source

pub const fn raw_name_or_data(&self) -> *const c_char

source

pub fn name_or_url(&self) -> Option<&Utf8CStr>

source

pub fn data(&self) -> Option<&[u8]>

source

pub fn length(&self) -> c_uint

source

pub fn file_offset(&self) -> c_uint

source

pub fn num_channels(&self) -> c_int

source

pub fn default_frequency(&self) -> c_int

source

pub fn format(&self) -> SoundFormat

source

pub fn decode_buffer_size(&self) -> c_uint

source

pub fn initial_subsound(&self) -> c_int

source

pub fn subsound_count(&self) -> c_int

source

pub fn inclusion_list(&self) -> Option<&'a [c_int]>

source

pub fn dls_name(&self) -> Option<&Utf8CStr>

source

pub fn encryption_key(&self) -> Option<&Utf8CStr>

source

pub fn max_polyphony(&self) -> c_int

source

pub fn suggested_sound_type(&self) -> SoundType

source

pub fn file_buffer_size(&self) -> c_int

source

pub fn channel_order(&self) -> ChannelOrder

source

pub fn initial_sound_group(&self) -> SoundGroup

source

pub fn initial_seek_position(&self) -> (c_uint, TimeUnit)

source

pub fn ignore_set_filesystem(&self) -> bool

source

pub fn min_midi_granularity(&self) -> c_uint

source

pub fn non_block_thread_id(&self) -> c_int

source

pub fn fsb_guid(&self) -> Option<Guid>

source§

impl<'a> SoundBuilder<'a>

source

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§

source§

impl<'a> Debug for SoundBuilder<'a>

source§

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

Formats the value using the given formatter. Read more

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> 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> 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, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.