pub enum SwitchQuant {
PatternEnd,
Bar,
Beat,
Immediate,
}Expand description
When a queued pattern change takes effect.
Every one of these is a function of the song position, so the point a switch will happen is known the moment it is queued — which is what lets the UI count down to it rather than saying “soon”.
Variants§
PatternEnd
At the end of the pattern currently playing. The default, because it is the one that keeps the part in phase with itself.
Bar
At the next bar line (4/4).
Beat
At the next beat.
Immediate
At the start of the next callback.
Implementations§
Source§impl SwitchQuant
impl SwitchQuant
pub const ALL: [SwitchQuant; 4]
pub const fn label(self) -> &'static str
pub const fn index(self) -> u8
pub fn from_index(index: u8) -> Self
pub fn stepped(self, delta: i32) -> Self
Sourcepub fn boundary(self, now: i64, pattern_ticks: i64) -> i64
pub fn boundary(self, now: i64, pattern_ticks: i64) -> i64
The first tick at or after now where a switch under this
quantization may happen.
pattern_ticks is the length of the pattern that is playing — the
grid PatternEnd counts in. A tick that is already on the grid is
itself the answer, so a switch queued exactly on a bar line takes
effect on that bar line rather than the next.
Trait Implementations§
Source§impl Clone for SwitchQuant
impl Clone for SwitchQuant
Source§fn clone(&self) -> SwitchQuant
fn clone(&self) -> SwitchQuant
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more