mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 04:06:45 +01:00
consistent track sections
This commit is contained in:
parent
9462a3f2a4
commit
af958b275d
1 changed files with 11 additions and 11 deletions
|
|
@ -208,7 +208,7 @@ impl Tek {
|
||||||
};
|
};
|
||||||
let header: ThunkBox<_> = io_header!(
|
let header: ThunkBox<_> = io_header!(
|
||||||
self,
|
self,
|
||||||
" I ",
|
" I ",
|
||||||
" midi ins",
|
" midi ins",
|
||||||
self.midi_ins.len(),
|
self.midi_ins.len(),
|
||||||
self.midi_ins().get(0).map(move|input: &JackMidiIn|Bsp::s(
|
self.midi_ins().get(0).map(move|input: &JackMidiIn|Bsp::s(
|
||||||
|
|
@ -221,11 +221,11 @@ impl Tek {
|
||||||
let bg = if self.selected().track() == Some(t+1) { track.color.light.rgb } else { track.color.base.rgb };
|
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 };
|
let bg2 = if t > 0 { self.tracks()[t - 1].color.base.rgb } else { Reset };
|
||||||
Bsp::s(
|
Bsp::s(
|
||||||
Self::wrap(bg, bg2, fg, Tui::bold(true, row!(
|
Self::wrap(bg, fg, Tui::bold(true, row!(
|
||||||
Tui::fg_bg(if rec { White } else { track.color.darkest.rgb }, bg, "Recrd"),
|
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"),
|
Tui::fg_bg(if mon { White } else { track.color.darkest.rgb }, bg, "Monit"),
|
||||||
))),
|
))),
|
||||||
Self::wrap(bg, bg2, fg, row!(
|
Self::wrap(bg, fg, row!(
|
||||||
Tui::fg_bg(if rec { White } else { track.color.darkest.rgb }, bg, "P▞▞▞▞"),
|
Tui::fg_bg(if rec { White } else { track.color.darkest.rgb }, bg, "P▞▞▞▞"),
|
||||||
Tui::fg_bg(if mon { White } else { track.color.darkest.rgb }, bg, "S▞▞▞▞"),
|
Tui::fg_bg(if mon { White } else { track.color.darkest.rgb }, bg, "S▞▞▞▞"),
|
||||||
))
|
))
|
||||||
|
|
@ -240,7 +240,7 @@ impl Tek {
|
||||||
for midi_out in self.midi_outs.iter() { h += midi_out.conn().len() }
|
for midi_out in self.midi_outs.iter() { h += midi_out.conn().len() }
|
||||||
let header: ThunkBox<_> = io_header!(
|
let header: ThunkBox<_> = io_header!(
|
||||||
self,
|
self,
|
||||||
" O ",
|
" O ",
|
||||||
" midi outs",
|
" midi outs",
|
||||||
self.midi_outs.len(),
|
self.midi_outs.len(),
|
||||||
self.midi_outs().get(0).map(move|output: &JackMidiOut|Bsp::s(
|
self.midi_outs().get(0).map(move|output: &JackMidiOut|Bsp::s(
|
||||||
|
|
@ -253,11 +253,11 @@ impl Tek {
|
||||||
let bg = if self.selected().track() == Some(t+1) { track.color.light.rgb } else { track.color.base.rgb };
|
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 };
|
let bg2 = if t > 0 { self.tracks()[t - 1].color.base.rgb } else { Reset };
|
||||||
Bsp::s(
|
Bsp::s(
|
||||||
Self::wrap(bg, bg2, fg, Tui::bold(true, row!(
|
Self::wrap(bg, fg, Tui::bold(true, row!(
|
||||||
Tui::fg_bg(if mute { White } else { track.color.darkest.rgb }, bg, "Play "),
|
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 "),
|
Tui::fg_bg(if solo { White } else { track.color.darkest.rgb }, bg, "Solo "),
|
||||||
))),
|
))),
|
||||||
Self::wrap(bg, bg2, fg, row!(
|
Self::wrap(bg, fg, row!(
|
||||||
Tui::fg_bg(if mute { White } else { track.color.darkest.rgb }, bg, "P▞▞▞▞"),
|
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▞▞▞▞"),
|
||||||
))
|
))
|
||||||
|
|
@ -265,8 +265,8 @@ impl Tek {
|
||||||
});
|
});
|
||||||
self.view_row(self.w(), h as u16, header, cells)
|
self.view_row(self.w(), h as u16, header, cells)
|
||||||
}
|
}
|
||||||
fn wrap (bg: Color, bg2: Color, fg: Color, content: impl Content<TuiOut>) -> impl Content<TuiOut> {
|
fn wrap (bg: Color, fg: Color, content: impl Content<TuiOut>) -> impl Content<TuiOut> {
|
||||||
Bsp::e(Tui::fg_bg(bg, bg2, "▐"), Bsp::w(Tui::fg_bg(bg, Reset, "▌"), Tui::fg_bg(fg, bg, content)))
|
Bsp::e(Tui::fg_bg(bg, Reset, "▐"), Bsp::w(Tui::fg_bg(bg, Reset, "▌"), Tui::fg_bg(fg, bg, content)))
|
||||||
}
|
}
|
||||||
fn view_tracks (&self) -> impl Content<TuiOut> + use<'_> {
|
fn view_tracks (&self) -> impl Content<TuiOut> + use<'_> {
|
||||||
let height = 1;
|
let height = 1;
|
||||||
|
|
@ -277,10 +277,10 @@ impl Tek {
|
||||||
let name = &track.name;
|
let name = &track.name;
|
||||||
let fg = track.color.lightest.rgb;
|
let fg = track.color.lightest.rgb;
|
||||||
let bg = if active { track.color.light.rgb } else { track.color.base.rgb };
|
let bg = if active { track.color.light.rgb } else { track.color.base.rgb };
|
||||||
let bg2 = if t > 0 { self.tracks()[t - 1].color.base.rgb } else { Reset };
|
let bg2 = Reset;//if t > 0 { self.tracks()[t - 1].color.base.rgb } else { Reset };
|
||||||
let bfg = if active { Rgb(255,255,255) } else { Rgb(0,0,0) };
|
let bfg = if active { Rgb(255,255,255) } else { Rgb(0,0,0) };
|
||||||
Outer(active, Style::default().fg(bfg).bg(bg))
|
Outer(active, Style::default().fg(bfg).bg(bg))
|
||||||
.enclose(Self::wrap(bg, bg2, fg, Tui::bold(true, Fill::x(Align::nw(name)))))
|
.enclose(Self::wrap(bg, fg, Tui::bold(true, Fill::x(Align::nw(name)))))
|
||||||
});
|
});
|
||||||
self.view_row(self.w(), height, header, content)
|
self.view_row(self.w(), height, header, content)
|
||||||
}
|
}
|
||||||
|
|
@ -288,7 +288,7 @@ impl Tek {
|
||||||
let data = (self.selected.track().unwrap_or(0), self.tracks().len());
|
let data = (self.selected.track().unwrap_or(0), self.tracks().len());
|
||||||
self.fmtd.write().unwrap().trks.update(Some(data),
|
self.fmtd.write().unwrap().trks.update(Some(data),
|
||||||
rewrite!(buf, "({}/{})", data.0, data.1));
|
rewrite!(buf, "({}/{})", data.0, data.1));
|
||||||
button(" C-t ", Bsp::e(" add track ",
|
button(" T ", Bsp::e(" track ",
|
||||||
self.fmtd.read().unwrap().trks.view.clone()))
|
self.fmtd.read().unwrap().trks.view.clone()))
|
||||||
}
|
}
|
||||||
fn view_scene_add (&self) -> impl Content<TuiOut> + use<'_> {
|
fn view_scene_add (&self) -> impl Content<TuiOut> + use<'_> {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue