mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 11:46:41 +01:00
This commit is contained in:
parent
34070de5f7
commit
1fc37a5679
4 changed files with 29 additions and 41 deletions
|
|
@ -1,33 +1,31 @@
|
|||
use crate::*;
|
||||
|
||||
type Add<'a> = &'a dyn FnMut(&dyn Render<TuiOut>);
|
||||
|
||||
impl Arrangement {
|
||||
pub fn view_inputs <'a> (&'a self, _theme: ItemTheme) -> impl Content<TuiOut> + 'a {
|
||||
pub fn view_inputs (&self, _theme: ItemTheme) -> impl Content<TuiOut> + '_ {
|
||||
Stack::south(move|add|{
|
||||
add(&Fixed::y(1,
|
||||
Bsp::e(Fixed::x(20, Align::w(button_3("i", "nput ", format!("{}", self.midi_ins.len()), false))),
|
||||
Bsp::w(Fixed::x(4, button_2("I", "+", false)),
|
||||
Stack::east(move|add|{
|
||||
for (_index, track, _x1, _x2) in self.tracks_with_sizes() {
|
||||
add(&Tui::bg(track.color.dark.rgb, Align::w(Fixed::x(track.width as u16, row!(
|
||||
Either(track.sequencer.monitoring, Tui::fg(Green, "mon "), "mon "),
|
||||
Either(track.sequencer.recording, Tui::fg(Red, "rec "), "rec "),
|
||||
Either(track.sequencer.overdub, Tui::fg(Yellow, "dub "), "dub "),
|
||||
)))))
|
||||
}
|
||||
Stack::east(move|add|for (_index, track, _x1, _x2) in self.tracks_with_sizes() {
|
||||
add(&Tui::bg(track.color.dark.rgb, Align::w(Fixed::x(track.width as u16, row!(
|
||||
Either(track.sequencer.monitoring, Tui::fg(Green, "mon "), "mon "),
|
||||
Either(track.sequencer.recording, Tui::fg(Red, "rec "), "rec "),
|
||||
Either(track.sequencer.overdub, Tui::fg(Yellow, "dub "), "dub "),
|
||||
)))))
|
||||
})))));
|
||||
for (_index, port) in self.midi_ins().iter().enumerate() {
|
||||
add(&Fixed::y(1, Bsp::e(
|
||||
Fixed::x(20, Align::w(Bsp::e(" ● ",
|
||||
Tui::bold(true, Tui::fg(Rgb(255,255,255), port.port_name()))))),
|
||||
Bsp::w(Fixed::x(4, ()),
|
||||
Stack::east(move|add|{
|
||||
for (_index, track, _x1, _x2) in self.tracks_with_sizes() {
|
||||
add(&Tui::bg(track.color.darker.rgb, Align::w(Fixed::x(track.width as u16, row!(
|
||||
Either(track.sequencer.monitoring, Tui::fg(Green, " ● "), " · "),
|
||||
Either(track.sequencer.recording, Tui::fg(Red, " ● "), " · "),
|
||||
Either(track.sequencer.overdub, Tui::fg(Yellow, " ● "), " · "),
|
||||
)))))
|
||||
}
|
||||
Stack::east(move|add|for (_index, track, _x1, _x2) in self.tracks_with_sizes() {
|
||||
add(&Tui::bg(track.color.darker.rgb, Align::w(Fixed::x(track.width as u16, row!(
|
||||
Either(track.sequencer.monitoring, Tui::fg(Green, " ● "), " · "),
|
||||
Either(track.sequencer.recording, Tui::fg(Red, " ● "), " · "),
|
||||
Either(track.sequencer.overdub, Tui::fg(Yellow, " ● "), " · "),
|
||||
)))))
|
||||
})))));
|
||||
}
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue