pub struct SequencerState { /* private fields */ }Expand description
A sequencer track’s patterns, and where the player is in them.
Implementations§
Source§impl SequencerState
impl SequencerState
Sourcepub fn new(child: InstrumentType) -> Self
pub fn new(child: InstrumentType) -> Self
A new sequencer for child: eight empty patterns, laid out for a kit
or for a keyboard depending on what it is driving.
pub fn selected_slot(&self) -> u8
pub fn live_slot(&self) -> u8
pub fn queued_slot(&self) -> Option<u8>
pub fn is_playing(&self) -> bool
pub fn switch_quant(&self) -> SwitchQuant
pub fn is_step_recording(&self) -> bool
pub fn lane_cursor(&self) -> usize
pub fn step_cursor(&self) -> usize
Sourcepub fn pattern(&self) -> &PatternBlock
pub fn pattern(&self) -> &PatternBlock
The pattern under the editor.
Sourcepub fn pattern_at(&self, slot: usize) -> &PatternBlock
pub fn pattern_at(&self, slot: usize) -> &PatternBlock
One of the eight, as stored — without the track-level settings. Use
SequencerState::block for what the audio thread should be given.
Sourcepub fn chain(&self) -> &[ChainEntry]
pub fn chain(&self) -> &[ChainEntry]
The chain, as far as it is filled in.
Sourcepub fn is_chained(&self) -> bool
pub fn is_chained(&self) -> bool
Whether a chain is running. A chain owns the slot outright, so queueing one by hand does nothing until the chain is cleared.
Sourcepub fn block(&self, slot: usize) -> PatternBlock
pub fn block(&self, slot: usize) -> PatternBlock
The block for slot as the audio thread should see it: the pattern’s
own data with the track-level settings stamped on.
The only way a block leaves this module, which is what keeps the two sides of the fence agreeing about what “running” and “queued” mean.
Sourcepub fn countdown(&self, position: i64) -> Option<(u8, i64)>
pub fn countdown(&self, position: i64) -> Option<(u8, i64)>
Where a queued switch lands, and how many steps away it is.
The same arithmetic the audio thread does, on the same inputs, so the countdown on screen is not a message that may not have arrived yet.
Sourcepub fn sync_from_audio(&mut self, status: &PatternStatus)
pub fn sync_from_audio(&mut self, status: &PatternStatus)
Take the live slot, the queued slot and the playhead from the audio thread’s own copy. Called once a frame, from whatever draws.
Without it the UI’s idea of which pattern is playing would be a guess that has to survive chain advances and quantized switches; with it, the guess is only ever used before the first callback lands.
Sourcepub fn panel_rows(&self) -> Vec<(&'static str, String)>
pub fn panel_rows(&self) -> Vec<(&'static str, String)>
The pattern-level settings, as a panel: label, value, and whether it is meaningful for what this sequencer is driving.
A placeholder for the sequencer’s own controls until the grid view exists — enough to see what a pattern is set to, and to prove the ops reach it.
Trait Implementations§
Source§impl Clone for SequencerState
impl Clone for SequencerState
Source§fn clone(&self) -> SequencerState
fn clone(&self) -> SequencerState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more