wip: more clocks

This commit is contained in:
🪞👃🪞 2024-12-09 22:57:03 +01:00
parent 26a9efaa86
commit cda0708642
3 changed files with 46 additions and 39 deletions

View file

@ -110,9 +110,15 @@ impl Audio for ArrangerTui {
render!(|self: ArrangerTui|{
let arranger_focused = self.arranger_focused();
let border = Lozenge(Style::default().bg(TuiTheme::border_bg()).fg(TuiTheme::border_fg(arranger_focused)));
col_up!([
col!([
lay!([
Tui::fill_x(Lozenge(Style::default())),
Tui::outset_xy(1, 1, row!([
WorldClock::from(self),
" ",
PlayClock::from(self),
]))
]),
col!([
Tui::fixed_y(self.splits[0], lay!([
border.wrap(Tui::grow_y(1, Layers::new(move |add|{
@ -332,7 +338,7 @@ render!(|self: ArrangerStatus|{
};
//let commands = commands.iter().reduce(String::new(), |s, (a, b, c)| format!("{s} {a}{b}{c}"));
Tui::bg(status_bar_bg, Tui::fill_x(Tui::to_east(mode, commands)))
Tui::bg(status_bar_bg, Tui::fill_x(row!([mode, commands])))
});
@ -630,13 +636,9 @@ render!(|self: ArrangerVerticalContent<'a>|Tui::fixed_y(
col!((scene, pulses) in self.scenes.iter().zip(self.rows.iter().map(|row|row.0)) => {
let height = 1.max((pulses / PPQ) as u16);
let playing = scene.is_playing(self.tracks);
Tui::fixed_y(
height,
Tui::to_east(
Tui::to_east(
Tui::fixed_y(height, row!([
if playing { "" } else { " " },
Tui::bold(true, scene.name.read().unwrap().as_str())
),
Tui::bold(true, scene.name.read().unwrap().as_str()),
row!((track, w) in self.cols.iter().map(|col|col.0).enumerate() => {
Tui::fixed_xy(w as u16, height, Layers::new(move |add|{
let mut bg = TuiTheme::border_bg();
@ -659,8 +661,7 @@ render!(|self: ArrangerVerticalContent<'a>|Tui::fixed_y(
//add(&Background(bg))
Ok(())
}))
})
)
})])
)
})
));

View file

@ -90,8 +90,14 @@ render!(|self: SequencerTui|{
//col_up!([
//Tui::max_y(2, SequencerStatusBar::from(self)),
col!([
lay!([
Tui::fill_x(Lozenge(Style::default())),
Tui::outset_xy(1, 1, row!([
WorldClock::from(self),
" ",
PlayClock::from(self),
]))
]),
Tui::min_y(20, row!([
Tui::min_x(20, col!([
Tui::fixed_y(4, PhraseSelector::play_phrase(

View file

@ -123,13 +123,13 @@ render!(|self: PhraseView<'a>|{
add(&Tui::fill_xy(Tui::at_se(Tui::pull_x(1, Tui::fg(title_color, lower_right)))))?;
Ok(())
});
let content = Tui::bg(Color::Rgb(40, 50, 30), Tui::fill_x(Tui::to_east(
let content = Tui::bg(Color::Rgb(40, 50, 30), Tui::fill_x(row!([
Tui::push_y(1, Tui::fill_y(Widget::new(|to:[u16;2]|Ok(Some(to.clip_w(2))), keys))),
Tui::fill_x(lay!([
Tui::push_y(1, Tui::fill_x(Widget::new(|to|Ok(Some(to)), notes))),
Tui::push_y(1, Widget::new(|to|Ok(Some(to)), cursor))
])),
)));
])));
lay!([
indicators,
content