Skip to main content

Remote

Struct Remote 

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

The mixer as a game’s thread sees it, when the mixer is on the audio thread: the same operations, none of which waits.

An operation is refused with Full when the queue has no room for it. Sized for what a frame sends, that doesn’t happen.

Implementations§

Source§

impl Remote

Source

pub fn reserve_sound(&mut self) -> Result<SoundId, Full>

A place in the bank, named now, so that a play can follow at once: a backend hands the sound over to Mixer::put_sound by a route of its own, ahead of that play. Full says the bank has none free.

Source

pub fn release_sound(&mut self, sound: SoundId)

Frees a place reserve_sound named.

Source

pub fn reserve_stream(&mut self) -> Result<StreamId, Full>

A stream slot, named now, as reserve_sound names a place in the bank, for Mixer::put_stream.

Source

pub fn release_stream(&mut self, stream: StreamId)

Frees a slot reserve_stream named.

Source

pub fn play(&mut self, sound: SoundId, params: Params) -> Result<VoiceId, Full>

Mixer::play, from here.

Source

pub fn play_stream( &mut self, stream: StreamId, params: Params, ) -> Result<VoiceId, Full>

Mixer::play_stream, from here.

Source

pub fn set_volume(&self, voice: VoiceId, volume: u16) -> Result<(), Full>

Mixer::set_volume, from here.

Source

pub fn fade_to( &self, voice: VoiceId, volume: u16, millis: u64, ) -> Result<(), Full>

Mixer::fade_to, from here.

Source

pub fn set_balance( &self, voice: VoiceId, left: u16, right: u16, ) -> Result<(), Full>

Mixer::set_balance, from here.

Source

pub fn stop(&self, voice: VoiceId) -> Result<(), Full>

Mixer::stop, from here.

Source

pub fn pause(&self, voice: VoiceId) -> Result<(), Full>

Mixer::pause, from here.

Source

pub fn resume(&self, voice: VoiceId) -> Result<(), Full>

Mixer::resume, from here.

Source

pub fn is_playing(&mut self, voice: VoiceId) -> bool

Whether voice is playing, as far as the audio thread has said: it goes on saying so until the mixer has reported the voice over.

Trait Implementations§

Source§

impl Debug for Remote

Source§

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

Formats the value using the given formatter. Read more

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