diff --git a/crates/tek/src/tui/app_sequencer.rs b/crates/tek/src/tui/app_sequencer.rs index c8a70f20..2197f104 100644 --- a/crates/tek/src/tui/app_sequencer.rs +++ b/crates/tek/src/tui/app_sequencer.rs @@ -173,23 +173,22 @@ audio!(|self:SequencerTui,client,scope|{ Control::Continue }); -render!(|self: SequencerTui|lay!([self.size, Tui::split_up(false, 1, - Tui::fill_xy(SequencerStatusBar::from(self)), +render!(|self: SequencerTui|lay!([self.size, Tui::split_up(false, 3, + Tui::fill_xy(col!([ + PhraseEditStatus(&self.editor), + SequencerStatusBar::from(self) + ])), Tui::split_right(false, if self.size.w() > 60 { 20 } else if self.size.w() > 40 { 15 } else { 10 - }, - Tui::fixed_x(20, Tui::split_down(false, 4, col!([ + }, Tui::fixed_x(20, col!([ PhraseSelector::play_phrase(&self.player), PhraseSelector::next_phrase(&self.player), - ]), Tui::split_up(false, 2, - PhraseSelector::edit_phrase(self.editor.phrase()), PhraseListView::from(self), - ))), - col!([ + ])), col!([ Tui::fixed_y(2, TransportView::from(( self, self.player.play_phrase().as_ref().map(|(_,p)|p.as_ref().map(|p|p.read().unwrap().color)).flatten().clone(), diff --git a/crates/tek/src/tui/phrase_editor.rs b/crates/tek/src/tui/phrase_editor.rs index 5caf119e..40bd74ab 100644 --- a/crates/tek/src/tui/phrase_editor.rs +++ b/crates/tek/src/tui/phrase_editor.rs @@ -224,3 +224,32 @@ impl std::fmt::Debug for PhraseEditorModel { .finish() } } + +pub struct PhraseEditStatus<'a>(pub &'a PhraseEditorModel); +render!(|self:PhraseEditStatus<'a>|row!(|add|{ + let (color, name, length) = if let Some(phrase) = self.0.phrase().as_ref().map(|p|p.read().unwrap()) { + (phrase.color, phrase.name.clone(), phrase.length) + } else { + (ItemPalette::from(TuiTheme::g(64)), String::new(), 0) + }; + let bg = color.base.rgb; + let fg = color.lightest.rgb; + let mut field = |name:&str, value:String|add(&Tui::fixed_xy(8, 2, + Tui::bg(bg, Tui::fg(fg, col!([ + name, Tui::bold(true, &value) + ]))))); + + field("Edit", format!("{name}"))?; + field("Length", format!("{length}"))?; + field("TimePt", format!("{}", self.0.time_point()))?; + field("TimeZoom", format!("{}", self.0.time_zoom()))?; + field("TimeLock", format!("{}", self.0.time_lock()))?; + field("TimeStrt", format!("{}", self.0.time_start()))?; + field("NoteLen", format!("{}", self.0.note_len()))?; + field("NoteLo", format!("{}", self.0.note_lo()))?; + field("NoteAxis", format!("{}", self.0.note_axis()))?; + field("NoteHi", format!("{}", self.0.note_hi()))?; + field("NotePt", format!("{}", self.0.note_point()))?; + + Ok(()) +}));