Skip to main content

Commands

Struct Commands 

Source
pub struct Commands<'a> { /* private fields */ }
Expand description

Commands applied at one moment: see MixerHandle::now and MixerHandle::at.

Implementations§

Source§

impl Commands<'_>

Source

pub fn set_effects(self, bus: BusId, effects: &[Effect]) -> Result<()>

Source

pub fn set_effect( self, bus: BusId, slot: usize, effect: Effect, fade: Fade, ) -> Result<()>

Source§

impl Commands<'_>

Source

pub fn set_routing(self, settings: &[BusRouting]) -> Result<RoutingId>

Source§

impl Commands<'_>

Source

pub fn play(self, sound: impl Into<Sound>, play: &Play) -> Result<VoiceId>

Starts a voice and returns its id. Fails if the sound has more than two channels, a loop region is outside it, or the command queue is full.

Source

pub fn stop(self, voice: VoiceId, fade: Fade) -> Result<()>

Stops a voice, fading it out first. Unknown or ended voices are ignored.

Source

pub fn stop_all(self, fade: Fade) -> Result<()>

Source

pub fn set_gain(self, voice: VoiceId, gain: f32, fade: Fade) -> Result<()>

Source

pub fn set_pan(self, voice: VoiceId, pan: f32, fade: Fade) -> Result<()>

Pans a voice, from -1 (left) to 1 (right).

Source

pub fn set_rate(self, voice: VoiceId, rate: f32, fade: Fade) -> Result<()>

Changes a voice’s playback rate, which changes speed and pitch together, over the fade. 1/16..=8.

Source

pub fn set_pitch(self, voice: VoiceId, semitones: f32, fade: Fade) -> Result<()>

Changes a voice’s pitch offset in semitones (fractions are cents) over the fade. -48..=48.

Source

pub fn set_position( self, voice: VoiceId, position: [f32; 2], fade: Fade, ) -> Result<()>

Source

pub fn pause(self, voice: VoiceId, fade: Fade) -> Result<()>

Source

pub fn set_emitter( self, voice: VoiceId, emitter: Emitter, fade: Fade, ) -> Result<()>

Enable/update permanent point-source mode, using the listener at application time. Stereo collapses immediately; fade only ramps spatial parameters.

Source

pub fn set_listener(self, listener: Listener, fade: Fade) -> Result<()>

Update every spatial voice, including paused voices and fading tails.

Source

pub fn resume(self, voice: VoiceId, fade: Fade) -> Result<()>

Source

pub fn pause_bus(self, bus: BusId, fade: Fade) -> Result<()>

Source

pub fn resume_bus(self, bus: BusId, fade: Fade) -> Result<()>

Source

pub fn set_bus_gain(self, bus: BusId, gain: f32, fade: Fade) -> Result<()>

Sets a bus’s gain; BusId::MASTER sets the master gain.

Auto Trait Implementations§

§

impl<'a> !UnwindSafe for Commands<'a>

§

impl<'a> Freeze for Commands<'a>

§

impl<'a> RefUnwindSafe for Commands<'a>

§

impl<'a> Send for Commands<'a>

§

impl<'a> Sync for Commands<'a>

§

impl<'a> Unpin for Commands<'a>

§

impl<'a> UnsafeUnpin for Commands<'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>,

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.