diff --git a/crates/tek_sequencer/src/arranger.rs b/crates/tek_sequencer/src/arranger.rs index b02e2265..1b1d65a2 100644 --- a/crates/tek_sequencer/src/arranger.rs +++ b/crates/tek_sequencer/src/arranger.rs @@ -160,6 +160,7 @@ impl Arranger { } self.show_phrase(); self.focus(ArrangerFocus::PhraseEditor); + self.editor.entered = true; } /// Rename the selected track, scene, or clip pub fn rename_selected (&mut self) { diff --git a/crates/tek_sequencer/src/arranger_cmd.rs b/crates/tek_sequencer/src/arranger_cmd.rs index fd377dd2..dd187f04 100644 --- a/crates/tek_sequencer/src/arranger_cmd.rs +++ b/crates/tek_sequencer/src/arranger_cmd.rs @@ -27,9 +27,10 @@ impl Arranger { fn handle_focused (&mut self, from: &TuiInput) -> Perhaps { match self.focused() { ArrangerFocus::Transport => self.transport.handle(from), - ArrangerFocus::Arrangement => self.handle_arrangement(from), ArrangerFocus::PhrasePool => self.handle_pool(from), ArrangerFocus::PhraseEditor => self.editor.handle(from), + ArrangerFocus::Arrangement => self.handle_arrangement(from) + .and_then(|result|{self.show_phrase();Ok(result)}), } } /// Helper for phrase event passthru when phrase pool is focused diff --git a/crates/tek_sequencer/src/arranger_tui.rs b/crates/tek_sequencer/src/arranger_tui.rs index 8051a82a..32081bb5 100644 --- a/crates/tek_sequencer/src/arranger_tui.rs +++ b/crates/tek_sequencer/src/arranger_tui.rs @@ -134,8 +134,8 @@ impl<'a> Content for VerticalArranger<'a, Tui> { let scenes = state.scenes.as_ref(); let bg = state.color; let clip_bg = Color::Rgb(40, 50, 30); - let border_hi = Color::Rgb(100, 110, 40); - let border_lo = Color::Rgb(70, 80, 50); + //let border_hi = Color::Rgb(100, 110, 40); + //let border_lo = Color::Rgb(70, 80, 50); //let border_bg = Color::Rgb(40, 50, 30); //let border_fg = if self.0.focused { border_hi } else { border_lo }; //let border = Lozenge(Style::default().bg(border_bg).fg(border_fg)); @@ -334,9 +334,7 @@ impl<'a> Content for HorizontalArranger<'a, Tui> { focused.then_some(Background(Color::Rgb(40, 50, 30))), row!( // name - CustomWidget::new(|_|{ - todo!() - }, |_: &mut TuiOutput|{ + CustomWidget::new(|_|{todo!()}, |_: &mut TuiOutput|{ todo!() //let Self(tracks, selected) = self; //let yellow = Some(Style::default().yellow().bold().not_dim()); @@ -360,9 +358,7 @@ impl<'a> Content for HorizontalArranger<'a, Tui> { //Ok(Some(area)) }), // monitor - CustomWidget::new(|_|{ - todo!() - }, |_: &mut TuiOutput|{ + CustomWidget::new(|_|{todo!()}, |_: &mut TuiOutput|{ todo!() //let Self(tracks) = self; //let mut area = to.area(); @@ -387,9 +383,7 @@ impl<'a> Content for HorizontalArranger<'a, Tui> { //Ok(Some(area)) }), // record - CustomWidget::new(|_|{ - todo!() - }, |_: &mut TuiOutput|{ + CustomWidget::new(|_|{todo!()}, |_: &mut TuiOutput|{ todo!() //let Self(tracks) = self; //let mut area = to.area(); @@ -414,9 +408,7 @@ impl<'a> Content for HorizontalArranger<'a, Tui> { //Ok(Some(area)) }), // overdub - CustomWidget::new(|_|{ - todo!() - }, |_: &mut TuiOutput|{ + CustomWidget::new(|_|{todo!()}, |_: &mut TuiOutput|{ todo!() //let Self(tracks) = self; //let mut area = to.area(); @@ -444,9 +436,7 @@ impl<'a> Content for HorizontalArranger<'a, Tui> { //Ok(Some(area)) }), // erase - CustomWidget::new(|_|{ - todo!() - }, |_: &mut TuiOutput|{ + CustomWidget::new(|_|{todo!()}, |_: &mut TuiOutput|{ todo!() //let Self(tracks) = self; //let mut area = to.area(); @@ -469,9 +459,7 @@ impl<'a> Content for HorizontalArranger<'a, Tui> { //Ok(Some(area)) }), // gain - CustomWidget::new(|_|{ - todo!() - }, |_: &mut TuiOutput|{ + CustomWidget::new(|_|{todo!()}, |_: &mut TuiOutput|{ todo!() //let Self(tracks) = self; //let mut area = to.area(); @@ -494,9 +482,7 @@ impl<'a> Content for HorizontalArranger<'a, Tui> { //Ok(Some(area)) }), // scenes - CustomWidget::new(|_|{ - todo!() - }, |to: &mut TuiOutput|{ + CustomWidget::new(|_|{todo!()}, |to: &mut TuiOutput|{ let Arrangement { scenes, selected, .. } = self.0; let area = to.area(); let mut x2 = 0; diff --git a/crates/tek_sequencer/src/sequencer_tui.rs b/crates/tek_sequencer/src/sequencer_tui.rs index 7e37b70a..d15e3264 100644 --- a/crates/tek_sequencer/src/sequencer_tui.rs +++ b/crates/tek_sequencer/src/sequencer_tui.rs @@ -96,7 +96,7 @@ impl Content for PhraseEditor { }) }).fill_x(); let cursor = CustomWidget::new(|to|Ok(Some(to)), move|to: &mut TuiOutput|{ - Ok(if *entered { + Ok(if *focused && *entered { let area = to.area(); if let (Some(time), Some(note)) = (time_point, note_point) { let x1 = area.x() + (time / time_scale) as u16; @@ -104,7 +104,7 @@ impl Content for PhraseEditor { let y = area.y() + note.saturating_sub(note_start) as u16 / 2; let c = if note % 2 == 0 { "▀" } else { "▄" }; for x in x1..x2 { - to.blit(&c, x, y, Some(Style::default().fg(color))); + to.blit(&c, x, y, Some(Style::default().fg(Color::Rgb(0,255,0)))); } } })