#[non_exhaustive]pub struct MusicSwitch {
pub out_ms: u32,
pub in_ms: u32,
pub overlap: bool,
}Expand description
How one music track gives way to the next (ADR-0054): the old one
fades out over out_ms, and the new one fades in over in_ms,
starting as the old one begins to fade (overlap, a crossfade) or once
it has stopped. Build it with new,
after_fade or crossfade
(ADR-0039).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.out_ms: u32How long the old track fades out, in milliseconds.
in_ms: u32How long the new track fades in, in milliseconds (0: it starts at full gain).
overlap: boolWhether the new track starts when the old one begins to fade (a crossfade), or after it has stopped.
Implementations§
Source§impl MusicSwitch
impl MusicSwitch
Sourcepub const fn new(out_ms: u32, in_ms: u32, overlap: bool) -> MusicSwitch
pub const fn new(out_ms: u32, in_ms: u32, overlap: bool) -> MusicSwitch
A fade-out of out_ms, a fade-in of in_ms, overlapping or not.
Sourcepub const fn after_fade(out_ms: u32) -> MusicSwitch
pub const fn after_fade(out_ms: u32) -> MusicSwitch
The old track fades out over out_ms, then the new one starts at
full gain: the engine’s switch before crossfades.
Sourcepub const fn crossfade(ms: u32) -> MusicSwitch
pub const fn crossfade(ms: u32) -> MusicSwitch
A crossfade: the new track fades in over ms while the old one
fades out over the same time.
Trait Implementations§
Source§impl Clone for MusicSwitch
impl Clone for MusicSwitch
Source§fn clone(&self) -> MusicSwitch
fn clone(&self) -> MusicSwitch
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more