From 95dd61811e92e5ff75517f412cfb8b0b2c5ad258 Mon Sep 17 00:00:00 2001 From: unspeaker Date: Sat, 23 Nov 2024 15:38:37 +0100 Subject: [PATCH] whew: all 3 mini-apps launch again --- crates/tek_api/src/api_player.rs | 2 +- crates/tek_tui/src/tui_content.rs | 2 +- crates/tek_tui/src/tui_impls.rs | 10 +++++----- crates/tek_tui/src/tui_view.rs | 8 ++++---- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/crates/tek_api/src/api_player.rs b/crates/tek_api/src/api_player.rs index 015d38d6..0fe5c549 100644 --- a/crates/tek_api/src/api_player.rs +++ b/crates/tek_api/src/api_player.rs @@ -13,7 +13,7 @@ pub trait HasPhrase: ClockApi { fn phrase (&self) -> &Option<(Instant, Option>>)>; - fn phrase_mut (&self) + fn phrase_mut (&mut self) -> &mut Option<(Instant, Option>>)>; fn next_phrase (&self) diff --git a/crates/tek_tui/src/tui_content.rs b/crates/tek_tui/src/tui_content.rs index 2ba9ca50..3ac092fd 100644 --- a/crates/tek_tui/src/tui_content.rs +++ b/crates/tek_tui/src/tui_content.rs @@ -80,7 +80,7 @@ impl Content for ArrangerTui { type Engine = Tui; fn content (&self) -> impl Widget { let arranger_focused = self.arranger_focused(); - Split::up( + Split::down( 1, TransportView(self), Split::down( diff --git a/crates/tek_tui/src/tui_impls.rs b/crates/tek_tui/src/tui_impls.rs index 7b295b82..7b036eb1 100644 --- a/crates/tek_tui/src/tui_impls.rs +++ b/crates/tek_tui/src/tui_impls.rs @@ -58,16 +58,16 @@ macro_rules! impl_midi_player { &mut self$(.$field)*.reset } fn phrase (&self) -> &Option<(Instant, Option>>)> { - todo!("phrase") + &self$(.$field)*.play_phrase } - fn phrase_mut (&self) -> &mut Option<(Instant, Option>>)> { - todo!("phrase_mut") + fn phrase_mut (&mut self) -> &mut Option<(Instant, Option>>)> { + &mut self$(.$field)*.play_phrase } fn next_phrase (&self) -> &Option<(Instant, Option>>)> { - todo!("next_phrase") + &self$(.$field)*.next_phrase } fn next_phrase_mut (&mut self) -> &mut Option<(Instant, Option>>)> { - todo!("next_phrase_mut") + &mut self$(.$field)*.next_phrase } } impl MidiInputApi for $Struct { diff --git a/crates/tek_tui/src/tui_view.rs b/crates/tek_tui/src/tui_view.rs index 750312f8..bec8b3b4 100644 --- a/crates/tek_tui/src/tui_view.rs +++ b/crates/tek_tui/src/tui_view.rs @@ -64,7 +64,7 @@ impl ArrangerViewState for ArrangerTui { pub trait PhrasesViewState: Send + Sync { fn phrases_focused (&self) -> bool; fn phrases_entered (&self) -> bool; - fn phrases (&self) -> Vec>>; + fn phrases (&self) -> &Vec>>; fn phrase_index (&self) -> usize; fn phrase_mode (&self) -> &Option; } @@ -77,11 +77,11 @@ macro_rules! impl_phrases_view_state { fn phrases_entered (&$self2) -> bool { $enter } - fn phrases (&self) -> Vec>> { - todo!() + fn phrases (&self) -> &Vec>> { + &self$(.$field)*.phrases } fn phrase_index (&self) -> usize { - todo!() + self$(.$field)*.phrase.load(Ordering::Relaxed) } fn phrase_mode (&self) -> &Option { &self$(.$field)*.mode