wip: display in/out matrix

This commit is contained in:
🪞👃🪞 2025-01-25 13:27:24 +01:00
parent 451b33b9bc
commit 923568d7f9
2 changed files with 22 additions and 30 deletions

View file

@ -205,16 +205,14 @@ impl Tek {
let bg = if self.selected().track() == Some(t+1) { track.color.light.rgb } else { track.color.base.rgb };
let bg2 = if t > 0 { self.tracks()[t - 1].color.base.rgb } else { Reset };
Bsp::s(
Self::wrap(bg, fg, Tui::bold(true, row!(
Self::wrap(bg, fg, Tui::bold(true, Bsp::e(
Tui::fg_bg(if rec { White } else { track.color.darkest.rgb }, bg, "Recrd"),
Tui::fg_bg(if mon { White } else { track.color.darkest.rgb }, bg, "Monit"),
))),
Self::wrap(bg, fg, row!(
Map::new(||self.midi_outs.iter(), move|output, index|map_south(index as u16, 1u16, Self::wrap(bg, fg, Bsp::e(
Tui::fg_bg(if rec { White } else { track.color.darkest.rgb }, bg, "R▞▞▞▞"),
Tui::fg_bg(if mon { White } else { track.color.darkest.rgb }, bg, "M▞▞▞▞"),
))
)
});
)))))});
self.view_row(w, h as u16, header, cells)
}
fn view_outputs (&self) -> impl Content<TuiOut> + use<'_> {
@ -233,16 +231,12 @@ impl Tek {
let bg = if self.selected().track() == Some(t+1) { track.color.light.rgb } else { track.color.base.rgb };
let bg2 = if t > 0 { self.tracks()[t - 1].color.base.rgb } else { Reset };
Bsp::s(
Self::wrap(bg, fg, Tui::bold(true, row!(
Self::wrap(bg, fg, Tui::bold(true, Bsp::e(
Tui::fg_bg(if mute { White } else { track.color.darkest.rgb }, bg, "Play "),
Tui::fg_bg(if solo { White } else { track.color.darkest.rgb }, bg, "Solo "),
))),
Self::wrap(bg, fg, row!(
Tui::fg_bg(if solo { White } else { track.color.darkest.rgb }, bg, "Solo "),))),
Map::new(||self.midi_outs.iter(), move|output, index|map_south(index as u16, 1u16, Self::wrap(bg, fg, Bsp::e(
Tui::fg_bg(if mute { White } else { track.color.darkest.rgb }, bg, "P▞▞▞▞"),
Tui::fg_bg(if solo { White } else { track.color.darkest.rgb }, bg, "S▞▞▞▞"),
))
)
});
Tui::fg_bg(if solo { White } else { track.color.darkest.rgb }, bg, "S▞▞▞▞"))))))});
self.view_row(self.w(), h as u16, header, cells)
}
fn wrap (bg: Color, fg: Color, content: impl Content<TuiOut>) -> impl Content<TuiOut> {
@ -325,30 +319,28 @@ impl Tek {
.unwrap_or(ItemPalette::G[32])) })) }),
move|(_, scene, y1, y2, last), s| {
let height = (1 + y2 - y1) as u16;
let mut fg = Tui::g(64);
let mut bg = ItemPalette::G[32];
if let Some(clip) = &scene.clips[t] {
let (fg, bg) = if let Some(clip) = &scene.clips[t] {
let clip = clip.read().unwrap();
fg = clip.color.lightest.rgb;
bg = clip.color
(clip.color.lightest.rgb, clip.color)
} else {
(Tui::g(96), ItemPalette::G[32])
};
let selected = same_track && selected_scene == Some(s+1);
let neighbor = same_track && selected_scene == Some(s);
let active = editing && selected;
let content = move||{
let clip = scene.clips[t].clone();
let icon = "";
let name = clip.map(|c|c.read().unwrap().name.clone());
Bsp::a(
Fill::xy(Align::nw(Tui::fg(fg, Bsp::e(icon, Bsp::e(Tui::bold(true, name), " "))))),
When(active, &self.editor)
)
};
map_south(y1 as u16, height, Fixed::y(height, Phat {
width: 0,
height: 0,
selected,
content: content(),
content: {
let clip = scene.clips[t].clone();
let icon = "";
let name = clip.map(|c|c.read().unwrap().name.clone());
Bsp::a(
Fill::xy(Align::nw(Tui::fg(fg, Bsp::e(icon, Bsp::e(Tui::bold(true, name), " "))))),
When(active, &self.editor)
)
},
colors: colors(
&bg, last, selected, neighbor, s == self.scenes.len().saturating_sub(1)
),

View file

@ -1,5 +1,5 @@
(bsp/s (max/y 1 :toolbar)
(fill/x (align/c (bsp/a (fill/xy (align/e :pool))
(bsp/a (fill/xy (align/n (bsp/s :tracks :inputs)))
(bsp/a (fill/x (fixed/y :outs-y (align/s :outputs)))
(bsp/a (fill/xy (align/n (bsp/s :tracks :outputs)))
(bsp/a (fill/x (fixed/y :outs-y (align/s :inputs)))
(bsp/s :scenes :scene-add)))))))