move piano_h to top of crate

This commit is contained in:
🪞👃🪞 2024-12-28 13:45:22 +01:00
parent 12f6b679c7
commit 51971e4c25
11 changed files with 39 additions and 27 deletions

View file

@ -38,30 +38,38 @@ pub enum GrooveboxFocus {
audio!(|self:GrooveboxTui,_client,_process|Control::Continue);
has_clock!(|self:GrooveboxTui|&self.sequencer.clock);
render!(<Tui>|self:GrooveboxTui|Fill::wh(lay!([
&self.size,
Fill::wh(Align::s(Fixed::h(2, GrooveboxStatus::from(self)))),
Tui::shrink_y(2, col!([
Fixed::h(2, row!([
Fixed::wh(5, 2, PlayPause(self.clock().is_rolling())),
Fixed::h(2, TransportView::from((self, self.sequencer.player.play_phrase().as_ref().map(|(_,p)|
p.as_ref().map(|p|p.read().unwrap().color)
).flatten().clone(), true))),
])),
Tui::push_x(20, Fixed::h(1, row!([
PhraseSelector::play_phrase(&self.sequencer.player),
PhraseSelector::next_phrase(&self.sequencer.player),
]))),
row!([
Tui::pull_y(1, Tui::shrink_y(0, Fill::h(Fixed::w(20, &self.sampler)))),
Fill::wh(&self.sequencer),
]),
render!(<Tui>|self:GrooveboxTui|{
let w = self.size.w();
let phrase_w = if w > 60 { 20 } else if w > 40 { 15 } else { 10 };
let pool_w = if self.sequencer.phrases.visible { phrase_w } else { 0 };
let sampler_w = 24;
Fill::wh(lay!([
&self.size,
Fill::wh(Align::s(Fixed::h(2, GrooveboxStatus::from(self)))),
Tui::shrink_y(2, col!([
Fixed::h(2, row!([
Fixed::wh(5, 2, PlayPause(self.clock().is_rolling())),
Fixed::h(2, TransportView::from((self, self.sequencer.player.play_phrase().as_ref().map(|(_,p)|
p.as_ref().map(|p|p.read().unwrap().color)
).flatten().clone(), true))),
])),
Tui::push_x(sampler_w, Fixed::h(1, row!([
PhraseSelector::play_phrase(&self.sequencer.player),
PhraseSelector::next_phrase(&self.sequencer.player),
]))),
row!([
Tui::pull_y(1, Tui::shrink_y(0, Fill::h(Fixed::w(sampler_w, &self.sampler)))),
Tui::split_n(false, 1,
MidiEditStatus(&self.sequencer.editor),
Tui::split_w(false, pool_w,
Tui::pull_y(1, Fill::h(Align::e(PoolView(&self.sequencer.phrases)))),
Fill::wh(&self.sequencer.editor)
)
),
]),
]))
]))
])));
//Bsp::n(
//Fill::wh(lay!([
//])),
//)));
});
pub enum GrooveboxCommand {
Sequencer(SequencerCommand),