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
impl Remote
Sourcepub fn reserve_sound(&mut self) -> Result<SoundId, Full>
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.
Sourcepub fn release_sound(&mut self, sound: SoundId)
pub fn release_sound(&mut self, sound: SoundId)
Frees a place reserve_sound named.
Sourcepub fn reserve_stream(&mut self) -> Result<StreamId, Full>
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.
Sourcepub fn release_stream(&mut self, stream: StreamId)
pub fn release_stream(&mut self, stream: StreamId)
Frees a slot reserve_stream named.
Sourcepub fn play(&mut self, sound: SoundId, params: Params) -> Result<VoiceId, Full>
pub fn play(&mut self, sound: SoundId, params: Params) -> Result<VoiceId, Full>
Mixer::play, from here.
Sourcepub fn play_stream(
&mut self,
stream: StreamId,
params: Params,
) -> Result<VoiceId, Full>
pub fn play_stream( &mut self, stream: StreamId, params: Params, ) -> Result<VoiceId, Full>
Mixer::play_stream, from here.
Sourcepub fn set_volume(&self, voice: VoiceId, volume: u16) -> Result<(), Full>
pub fn set_volume(&self, voice: VoiceId, volume: u16) -> Result<(), Full>
Mixer::set_volume, from here.
Sourcepub fn fade_to(
&self,
voice: VoiceId,
volume: u16,
millis: u64,
) -> Result<(), Full>
pub fn fade_to( &self, voice: VoiceId, volume: u16, millis: u64, ) -> Result<(), Full>
Mixer::fade_to, from here.
Sourcepub fn set_balance(
&self,
voice: VoiceId,
left: u16,
right: u16,
) -> Result<(), Full>
pub fn set_balance( &self, voice: VoiceId, left: u16, right: u16, ) -> Result<(), Full>
Mixer::set_balance, from here.
Sourcepub fn is_playing(&mut self, voice: VoiceId) -> bool
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.