pub struct AudioCommand {
pub target: AudioTarget,
pub gain: f32,
}Expand description
Runtime-only event sent by GraphicsSystem when a volume setting changes,
read by AudioSystem from its Events<AudioCommand> queue.
Volumes are owned by the audio engine, not the renderer, so a change made in the settings menu is handed across as this event rather than read from disk each frame: the audio system scales its output on the same tick. World authors never declare this type directly.
Fields§
§target: AudioTargetThe output stage whose volume changed.
gain: f32New volume as a linear gain (0.0 = silent, 1.0 = full).
Trait Implementations§
Source§impl Clone for AudioCommand
impl Clone for AudioCommand
Source§fn clone(&self) -> AudioCommand
fn clone(&self) -> AudioCommand
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for AudioCommand
Source§impl Debug for AudioCommand
impl Debug for AudioCommand
Source§impl PartialEq for AudioCommand
impl PartialEq for AudioCommand
impl StructuralPartialEq for AudioCommand
Auto Trait Implementations§
impl Freeze for AudioCommand
impl RefUnwindSafe for AudioCommand
impl Send for AudioCommand
impl Sync for AudioCommand
impl Unpin for AudioCommand
impl UnsafeUnpin for AudioCommand
impl UnwindSafe for AudioCommand
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