pub enum AudioEvent {
PaddleHit {
frequency: f32,
duration: f32,
volume: f32,
},
WallBounce {
frequency: f32,
duration: f32,
volume: f32,
},
Goal {
player_scored: bool,
volume: f32,
},
GameStart {
volume: f32,
},
RallyMilestone {
rally_count: u32,
frequency: f32,
volume: f32,
},
SoundToggle {
enabled: bool,
volume: f32,
},
}Expand description
Audio events that JavaScript should play via Web Audio API.
Variants§
PaddleHit
Paddle hit sound (blip with pitch based on hit location)
Fields
WallBounce
Wall bounce sound (lower blip)
Fields
Goal
Goal scored sound (rising tone sequence)
Fields
GameStart
Game start jingle
RallyMilestone
Rally milestone sound (every 5 hits)
Fields
SoundToggle
Sound toggle confirmation (plays when sound is enabled)
Trait Implementations§
Source§impl Clone for AudioEvent
impl Clone for AudioEvent
Source§fn clone(&self) -> AudioEvent
fn clone(&self) -> AudioEvent
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AudioEvent
impl Debug for AudioEvent
Source§impl<'de> Deserialize<'de> for AudioEvent
impl<'de> Deserialize<'de> for AudioEvent
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for AudioEvent
impl PartialEq for AudioEvent
Source§impl Serialize for AudioEvent
impl Serialize for AudioEvent
impl StructuralPartialEq for AudioEvent
Auto Trait Implementations§
impl Freeze for AudioEvent
impl RefUnwindSafe for AudioEvent
impl Send for AudioEvent
impl Sync for AudioEvent
impl Unpin for AudioEvent
impl UnwindSafe for AudioEvent
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more