From e9957fcd49ddfa45a0ec2c8b06044dbce887bd3c Mon Sep 17 00:00:00 2001 From: unspeaker Date: Wed, 1 Jan 2025 21:49:45 +0100 Subject: [PATCH] all seems to mostly work besides midi editor - here be dragons! --- src/groovebox.rs | 37 ++++++++++++++----------------------- 1 file changed, 14 insertions(+), 23 deletions(-) diff --git a/src/groovebox.rs b/src/groovebox.rs index 3ec67bdc..23776388 100644 --- a/src/groovebox.rs +++ b/src/groovebox.rs @@ -120,35 +120,26 @@ render!(Tui: (self: Groovebox) => { let color = self.player.play_phrase().as_ref() .and_then(|(_,p)|p.as_ref().map(|p|p.read().unwrap().color)) .clone(); - let transport = Fixed::y(3, row!( + let transport = Fixed::y(3, Bsp::e( PlayPause(self.clock().is_rolling()), TransportView::new(self, color, true), )); - let selector = Push::x(sampler_w, Fixed::y(1, row!( + let selector = Fixed::y(1, Bsp::e( PhraseSelector::play_phrase(&self.player), PhraseSelector::next_phrase(&self.player), - ))); + )); + let sampler = Tui::bg(TuiTheme::g(32), Align::w(Fixed::x(sampler_w, Fill::xy(col!( + Meters(self.sampler.input_meter.as_ref()), + GrooveboxSamples(self) + ))))); + let status = EditStatus(&self.sampler, &self.editor, note_pt, "test"); let pool = PoolView(&self.pool); - let with_pool = move|x|Bsp::w(Pull::y(1, Align::e(Fill::y(Fixed::x(pool_w, pool)))), x); - with_pool(Fill::xy(Align::nw(col!(transport, selector)))) - //selector - //let sampler = move|x|Bsp::e( - //Fixed::x(sampler_w, Fill::xy(col!( - //Meters(self.sampler.input_meter.as_ref()), - //GrooveboxSamples(self)))), - //x); - //let status = EditStatus(&self.sampler, &self.editor, note_pt, pool(sampler(&self.editor))); - //status - //Fill::xy(lay!( - //&self.size, - //Fill::xy(Align::s(Fixed::y(2, GrooveboxStatus::from(self)))), - //Shrink::y(2, col!( - //transport, - //selector, - //status - //)) - //)) -}); + let with_pool = move|x|Bsp::w(Align::e(Fill::y(Fixed::x(pool_w, pool))), x); + Fill::xy(Bsp::a(&self.size, + Bsp::s(transport, + Bsp::n(status, + Bsp::n(selector, + with_pool(Fill::xy(sampler)))))))}); struct EditStatus<'a, T: Content>(&'a Sampler, &'a MidiEditor, usize, T); impl<'a, T: Content> Content for EditStatus<'a, T> {