pub struct Silent;Expand description
A device that plays nothing: for a backend with no sound yet, and tests.
Trait Implementations§
Source§impl Audio for Silent
impl Audio for Silent
Source§fn music_playing(&self, _: Millis) -> Option<(&str, f64)>
fn music_playing(&self, _: Millis) -> Option<(&str, f64)>
The music sounding at
now: its cue and the seconds since it really
started (once its file had loaded), or None in silence: nothing
asked for, a track still loading or whose file failed. Of two
tracks sounding (a crossfade), the newest: the old one until the
new one has loaded.Source§fn play(&mut self, _: &AudioFrame<'_>, _: Millis)
fn play(&mut self, _: &AudioFrame<'_>, _: Millis)
Plays one frame’s
frame of audio at now: the volumes first, then
the requests and the music commands in order. It also checks on
what is still loading, so it is called every frame, with nothing to
play too.Source§fn stop_all(&mut self)
fn stop_all(&mut self)
Stops the music, the voice and the sounds started with a handle:
the game has quit.
Source§fn suspend(&mut self)
fn suspend(&mut self)
Holds everything sounding (the sounds started with a handle, the
voice and the music) while the system suspends the game
(
SystemEvent::Suspend); sound
cues played once finish. Pauses, or mutes where the backend can’t
pause. A second call does nothing. Read moreSource§fn resume(&mut self)
fn resume(&mut self)
Brings back what
suspend held, and leaves a
SoundRequest::PauseSounds pause in place. A call while not
suspended does nothing.Source§fn voice_playing(&self, now: Millis) -> Option<&str>
fn voice_playing(&self, now: Millis) -> Option<&str>
The voice clip sounding at
now, by its file
(SoundRequest::Voice), or asked for and still loading: None
once it has ended, and for a clip stopped, replaced, whose file
failed or that loaded too late to be played. A clip held by
suspend still sounds. None by default, for a
device that plays no voices.impl Copy for Silent
Auto Trait Implementations§
impl Freeze for Silent
impl RefUnwindSafe for Silent
impl Send for Silent
impl Sync for Silent
impl Unpin for Silent
impl UnsafeUnpin for Silent
impl UnwindSafe for Silent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more