add editbar to arranger

This commit is contained in:
🪞👃🪞 2024-12-21 20:37:02 +01:00
parent 274316ccdd
commit e7fbb359c7
2 changed files with 14 additions and 13 deletions

View file

@ -95,7 +95,7 @@ from_jack!(|jack| ArrangerTui {
}
});
impl ArrangerTui {
fn render_mode (state: &Self) -> impl Render<Tui> {
fn render_mode (state: &Self) -> impl Render<Tui> + use<'_> {
match state.mode {
ArrangerMode::H => todo!("horizontal arranger"),
ArrangerMode::V(factor) => Self::render_mode_v(state, factor),
@ -103,24 +103,25 @@ impl ArrangerTui {
}
}
render!(<Tui>|self: ArrangerTui|{
let arranger = ||lay!(|add|{
let play = Fixed::wh(5, 2, PlayPause(self.clock.is_rolling()));
let transport = TransportView::from((self, Some(ItemPalette::from(TuiTheme::g(96))), true));
let with_transport = |x|col!([row!(![&play, &transport]), &x]);
let pool_size = if self.show_pool { self.splits[1] } else { 0 };
let with_pool = |x|Split::left(false, pool_size, PhraseListView(&self.phrases), x);
let status = SequencerStatus::from(self);
let with_editbar = |x|Tui::split_n(false, 3, PhraseEditStatus(&self.editor), x);
let with_status = |x|Tui::split_n(false, 2, status, x);
let with_size = |x|lay!([&self.size, x]);
let arranger = ||lay!(|add|{
let color = self.color;
add(&Fill::wh(Tui::bg(color.darkest.rgb, ())))?;
add(&Fill::wh(Lozenge(Style::default().fg(color.light.rgb).bg(color.darker.rgb))))?;
add(&Self::render_mode(self))
});
let play = Fixed::wh(5, 2, PlayPause(self.clock.is_rolling()));
let transport = TransportView::from((self, None, true));
let with_transport = |x|col!([row!(![&play, &transport]), &x]);
let pool_size = if self.show_pool { self.splits[1] } else { 0 };
let with_pool = |x|Split::left(false, pool_size, PhraseListView(&self.phrases), x);
let status = SequencerStatus::from(self);
let with_status = |x|Tui::split_n(false, 2, status, x);
let with_size = |x|lay!([&self.size, x]);
with_size(with_status(with_pool(with_transport(col!([
with_size(with_status(with_editbar(with_pool(with_transport(col!([
Fill::w(Fixed::h(20, arranger())),
Fill::w(Fixed::h(25, &self.editor)),
])))))
]))))))
});
audio!(|self: ArrangerTui, client, scope|{
// Start profiling cycle

View file

@ -2,7 +2,7 @@ use crate::*;
const HEADER_H: u16 = 3;
const SCENES_W_OFFSET: u16 = 3;
impl ArrangerTui {
pub fn render_mode_v (state: &ArrangerTui, factor: usize) -> impl Render<Tui> {
pub fn render_mode_v (state: &ArrangerTui, factor: usize) -> impl Render<Tui> + use<'_> {
lay!([
ArrangerVColSep::from(state), ArrangerVRowSep::from((state, factor)),
col!([ArrangerVHead::from(state), ArrangerVBody::from((state, factor))]),