diff --git a/crates/tek/src/tui/app_sequencer.rs b/crates/tek/src/tui/app_sequencer.rs index 44cbe082..3c2022dd 100644 --- a/crates/tek/src/tui/app_sequencer.rs +++ b/crates/tek/src/tui/app_sequencer.rs @@ -107,9 +107,10 @@ impl Command for SequencerCommand { impl Command for FocusCommand { fn execute (self, state: &mut SequencerTui) -> Perhaps> { - if let FocusCommand::Set(to) = self { - state.set_focused(to); - } + // Focus commands can be received but are ignored. + //if let FocusCommand::Set(to) = self { + //state.set_focused(to); + //} Ok(None) } } @@ -300,18 +301,6 @@ impl HasPhraseList for SequencerTui { } } -impl HasFocus for SequencerTui { - type Item = SequencerFocus; - /// Get the currently focused item. - fn focused (&self) -> Self::Item { - self.focus - } - /// Get the currently focused item. - fn set_focused (&mut self, to: Self::Item) { - self.focus = to - } -} - impl Into> for SequencerFocus { fn into (self) -> Option { if let Self::Transport(transport) = self { diff --git a/crates/tek/src/tui/app_transport.rs b/crates/tek/src/tui/app_transport.rs index 587b1914..af48ff98 100644 --- a/crates/tek/src/tui/app_transport.rs +++ b/crates/tek/src/tui/app_transport.rs @@ -214,7 +214,7 @@ impl Handle for TransportTui { } } -pub trait TransportControl: HasClock + HasFocus { +pub trait TransportControl: HasClock + { fn transport_focused (&self) -> Option; } diff --git a/crates/tek/src/tui/status_bar.rs b/crates/tek/src/tui/status_bar.rs index 1939baa0..cc8846ad 100644 --- a/crates/tek/src/tui/status_bar.rs +++ b/crates/tek/src/tui/status_bar.rs @@ -50,60 +50,30 @@ impl StatusBar for SequencerStatusBar { impl From<&SequencerTui> for SequencerStatusBar { fn from (state: &SequencerTui) -> Self { - use super::app_transport::TransportFocus::*; - use super::app_sequencer::SequencerFocus::*; let samples = state.clock.chunk.load(Ordering::Relaxed); let rate = state.clock.timebase.sr.get() as f64; let buffer = samples as f64 / rate; let width = state.size.w(); - let default_help = &[("", "⏎", " enter"), ("", "✣", " navigate")]; Self { width, cpu: state.perf.percentage().map(|cpu|format!("│{cpu:.01}%")), size: format!("{}x{}│", width, state.size.h()), res: format!("│{}s│{:.1}kHz│{:.1}ms│", samples, rate / 1000., buffer * 1000.), - mode: match state.focused() { - Transport(PlayPause) => " PLAY/PAUSE ", - Transport(Bpm) => " TEMPO ", - Transport(Sync) => " LAUNCH SYNC ", - Transport(Quant) => " REC QUANT ", - Transport(Clock) => " SEEK ", - //PhrasePlay => " TO PLAY ", - //PhraseNext => " UP NEXT ", - PhraseList => " PHRASES ", - PhraseEditor => " EDIT MIDI ", - }, - help: match state.focused() { - Transport(PlayPause) => &[ - ("", "⏎", " play/pause"), - ("", "✣", " navigate"), - ], - Transport(Bpm) => &[ - ("", ".,", " inc/dec"), - ("", "><", " fine"), - ], - Transport(Sync) => &[ - ("", ".,", " inc/dec"), - ], - Transport(Quant) => &[ - ("", ".,", " inc/dec"), - ], - Transport(Clock) => &[ - ("", ".,", " by beat"), - ("", "<>", " by time"), - ], - PhraseList => &[ - ("", "↕", " pick"), - ("", ".,", " move"), - ("", "⏎", " play"), - ("", "e", " edit"), - ], - PhraseEditor => &[ - ("", "✣", " cursor"), - ("", "Ctrl-✣", " scroll"), - ], - _ => default_help, - } + mode: " SEQUENCER ", + help: &[ + ("", "SPACE", " play/pause"), + ("", "✣", " cursor"), + ("", "Ctrl-✣", " scroll"), + ("", ".,", " length"), + ("", "><", " triplet"), + ("", "[]", " phrase"), + ("", "{}", " order"), + ("en", "q", "ueue"), + ("", "e", "dit"), + ("", "a", "dd note"), + ("", "A", "dd phrase"), + ("", "D", "uplicate phrase"), + ] } } }