From 4e2702f69eea48b0ce0c50f886c9d5980c8cecc3 Mon Sep 17 00:00:00 2001 From: unspeaker Date: Sun, 11 May 2025 02:06:08 +0300 Subject: [PATCH] pass root clock - and groovebox works! --- crates/cli/tek.rs | 7 ++++--- crates/device/src/sequencer/seq_model.rs | 24 ++++++++++++------------ 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/crates/cli/tek.rs b/crates/cli/tek.rs index b65a8abf..1e303f23 100644 --- a/crates/cli/tek.rs +++ b/crates/cli/tek.rs @@ -111,10 +111,10 @@ impl Cli { _ => todo!("{mode:?}"), }; let config = Configuration::new(&config_path, false)?; + let clock = Clock::new(jack, self.bpm)?; let mut app = App { jack: jack.clone(), color: ItemTheme::random(), - clock: Clock::new(jack, self.bpm)?, pool: match mode { LaunchMode::Sequencer | LaunchMode::Groovebox => clip.as_ref().map(Into::into), LaunchMode::Arranger { .. } => Some(Default::default()), @@ -141,7 +141,7 @@ impl Cli { &name, None, jack, - None, + Some(&clock), clip.as_ref(), midi_froms.as_slice(), midi_tos.as_slice() @@ -152,7 +152,7 @@ impl Cli { &name, None, jack, - None, + Some(&clock), clip.as_ref(), midi_froms.as_slice(), midi_froms.as_slice(), @@ -165,6 +165,7 @@ impl Cli { scenes, selected: Selection::TrackClip { track: 0, scene: 0 }, config, + clock, ..Default::default() }; if let &LaunchMode::Arranger { scenes, tracks, track_width, .. } = mode { diff --git a/crates/device/src/sequencer/seq_model.rs b/crates/device/src/sequencer/seq_model.rs index 60a57b26..298364ac 100644 --- a/crates/device/src/sequencer/seq_model.rs +++ b/crates/device/src/sequencer/seq_model.rs @@ -18,29 +18,29 @@ pub trait HasSequencer { /// Contains state for playing a clip pub struct Sequencer { /// State of clock and playhead - pub clock: Clock, + pub clock: Clock, /// Start time and clip being played - pub play_clip: Option<(Moment, Option>>)>, + pub play_clip: Option<(Moment, Option>>)>, /// Start time and next clip - pub next_clip: Option<(Moment, Option>>)>, + pub next_clip: Option<(Moment, Option>>)>, /// Play input through output. - pub monitoring: bool, + pub monitoring: bool, /// Write input to sequence. - pub recording: bool, + pub recording: bool, /// Overdub input to sequence. - pub overdub: bool, + pub overdub: bool, /// Send all notes off - pub reset: bool, // TODO?: after Some(nframes) + pub reset: bool, // TODO?: after Some(nframes) /// Record from MIDI ports to current sequence. - pub midi_ins: Vec, + pub midi_ins: Vec, /// Play from current sequence to MIDI ports - pub midi_outs: Vec, + pub midi_outs: Vec, /// Notes currently held at input - pub notes_in: Arc>, + pub notes_in: Arc>, /// Notes currently held at output - pub notes_out: Arc>, + pub notes_out: Arc>, /// MIDI output buffer - pub note_buf: Vec, + pub note_buf: Vec, } impl Default for Sequencer {