Struct SoundGroup

Source
pub struct SoundGroup { /* private fields */ }
Expand description

An interface that manages Sound Groups.

Implementations§

Source§

impl SoundGroup

Source

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

Retrieves the name of the sound group.

Source

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

Releases a soundgroup object and returns all sounds back to the master sound group.

You cannot release the master SoundGroup.

Source

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

Sets the user data.

Source

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

Retrieves user data.

Source

pub fn get_system(&self) -> Result<System>

Retrieves the parent System object.

Source§

impl SoundGroup

Source

pub fn set_max_audible(&self, max_audible: c_int) -> Result<()>

Sets the maximum number of playbacks to be audible at once in a sound group.

If playing instances of sounds in this group equal or exceed number specified here, attepts to play more of the sounds with be met with FMOD_RESULT::FMOD_ERR_MAXAUDIBLE by default. Use SoundGroup::set_max_audible_behavior to change the way the sound playback behaves when too many sounds are playing. Muting, failing and stealing behaviors can be specified. See SoundGroupBehavior.

SoundGroup::get_playing_count can be used to determine how many instances of the sounds in the SoundGroup are currently playing.

Source

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

Retrieves the maximum number of playbacks to be audible at once in a sound group.

Source

pub fn set_max_audible_behavior( &self, behavior: SoundGroupBehavior, ) -> Result<()>

This function changes the way the sound playback behaves when too many sounds are playing in a soundgroup.

Source

pub fn get_max_audible_behavior(&self) -> Result<SoundGroupBehavior>

Retrieves the current max audible behavior.

Source

pub fn set_mute_fade_speed(&self, speed: c_float) -> Result<()>

Sets a mute fade time.

If a mode besides SoundGroupBehavior::Mute is used, the fade speed is ignored.

When more sounds are playing in a SoundGroup than are specified with SoundGroup::set_max_audible, the least important Sound (ie lowest priority / lowest audible volume due to 3D position, volume etc) will fade to silence if SoundGroupBehavior::Mute is used, and any previous sounds that were silent because of this rule will fade in if they are more important.

Source

pub fn get_mute_fade_speed(&self) -> Result<c_float>

Retrieves the current mute fade time.

Source

pub fn set_volume(&self, volume: c_float) -> Result<()>

Sets the volume of the sound group.

Source

pub fn get_volume(&self) -> Result<c_float>

Retrieves the volume of the sound group.

Source§

impl SoundGroup

Source

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

Retrieves the current number of sounds in this sound group.

Source

pub fn get_sound(&self, index: c_int) -> Result<Sound>

Retrieves a sound.

Use SoundGroup::get_sound_count in conjunction with this function to enumerate all sounds in a SoundGroup.

Source

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

Retrieves the number of currently playing Channels for the SoundGroup.

This routine returns the number of Channels playing. If the SoundGroup only has one Sound, and that Sound is playing twice, the figure returned will be two.

Source

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

Stops all sounds within this soundgroup.

Source§

impl SoundGroup

Source

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

Converts self into its raw representation.

Trait Implementations§

Source§

impl Clone for SoundGroup

Source§

fn clone(&self) -> SoundGroup

Returns a copy 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 SoundGroup

Source§

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

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

impl From<SoundGroup> for *mut FMOD_SOUNDGROUP

Source§

fn from(value: SoundGroup) -> Self

Converts to this type from the input type.
Source§

impl Hash for SoundGroup

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 SoundGroup

Source§

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

Source§

impl Eq for SoundGroup

Source§

impl Send for SoundGroup

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

impl StructuralPartialEq for SoundGroup

Source§

impl Sync for SoundGroup

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.