mirror of
https://codeberg.org/unspeaker/tek.git
synced 2026-09-18 20:56:44 +02:00
parent
f2443a4314
commit
6771b24f79
17 changed files with 105 additions and 96 deletions
|
|
@ -46,10 +46,10 @@ impl Track {
|
|||
pub fn audio_outs (&self) -> &[AudioOutput] {
|
||||
self.devices.last().map(|x|x.audio_outs()).unwrap_or_default()
|
||||
}
|
||||
pub fn per <'a, T: Draw<'a, Tui> + 'a, U: TracksSizes<'a>> (
|
||||
pub fn per <'a, T: Draw<Tui> + 'a, U: TracksSizes<'a>> (
|
||||
tracks: impl Fn() -> U + Send + Sync + 'a,
|
||||
callback: &'a (impl Fn(usize, &'a Track)->T + Send + Sync + 'a)
|
||||
) -> impl Draw<'a, Tui> {
|
||||
) -> impl Draw<Tui> {
|
||||
iter_east(move||tracks().map(|(index, track, x1, x2): (usize, &Track, usize, usize)|{
|
||||
fg_bg(
|
||||
track.color.lightest.term,
|
||||
|
|
@ -343,7 +343,7 @@ pub trait TracksView: HasTracks + ScenesView + HasMidiIns + HasMidiOuts + HasTra
|
|||
}
|
||||
|
||||
/// Draw name of each track
|
||||
fn view_track_names (&self, theme: ItemTheme) -> impl Draw<'_, Tui> {
|
||||
fn view_track_names (&self, theme: ItemTheme) -> impl Draw<Tui> {
|
||||
let selected = self.selection();
|
||||
east(
|
||||
south(
|
||||
|
|
@ -397,7 +397,7 @@ pub trait TracksView: HasTracks + ScenesView + HasMidiIns + HasMidiOuts + HasTra
|
|||
}
|
||||
|
||||
/// Draw outputs per track
|
||||
fn view_track_outputs <'a> (&'a self, theme: ItemTheme, _h: u16) -> impl Draw<'a, Tui> {
|
||||
fn view_track_outputs <'a> (&'a self, theme: ItemTheme, _h: u16) -> impl Draw<Tui> {
|
||||
view_track_row_section(theme,
|
||||
south(button_2("o", "utput", false).align_w().full_w(),
|
||||
draw(|to: &mut Tui|{
|
||||
|
|
@ -432,7 +432,7 @@ pub trait TracksView: HasTracks + ScenesView + HasMidiIns + HasMidiOuts + HasTra
|
|||
}
|
||||
|
||||
/// Draw inputs per track
|
||||
fn view_track_inputs <'a> (&'a self, theme: ItemTheme) -> impl Draw<'a, Tui> {
|
||||
fn view_track_inputs <'a> (&'a self, theme: ItemTheme) -> impl Draw<Tui> {
|
||||
let mut height = 0u16;
|
||||
for track in self.tracks().iter() {
|
||||
height = height.max(track.sequencer.midi_ins.len() as u16);
|
||||
|
|
@ -460,7 +460,7 @@ pub trait TracksView: HasTracks + ScenesView + HasMidiIns + HasMidiOuts + HasTra
|
|||
}).align_w()))
|
||||
}
|
||||
|
||||
fn view_track_devices (&self, theme: ItemTheme) -> impl Draw<'_, Tui> {
|
||||
fn view_track_devices (&self, theme: ItemTheme) -> impl Draw<Tui> {
|
||||
let height = self.tracks_devices_height();
|
||||
let btn1 = button_3("d", "evice", self.track().map(|t|t.devices.len()).unwrap_or(0), false);
|
||||
let btn2 = button_2("D", "+", false);
|
||||
|
|
@ -489,7 +489,7 @@ pub trait TracksView: HasTracks + ScenesView + HasMidiIns + HasMidiOuts + HasTra
|
|||
h as u16
|
||||
}
|
||||
|
||||
fn view_inputs (&self, _theme: ItemTheme) -> impl Draw<'_, Tui> + '_ {
|
||||
fn view_inputs (&self, _theme: ItemTheme) -> impl Draw<Tui> + '_ {
|
||||
let title_1 = button_3("i", "nput ", self.midi_ins().len(), false).align_w().exact_wh(20, 1);
|
||||
let title_2 = button_2("I", "+", false).exact_wh(4, 1);
|
||||
east(title_1, west(title_2, draw(move|to: &mut Tui|{
|
||||
|
|
@ -533,7 +533,7 @@ pub trait TracksView: HasTracks + ScenesView + HasMidiIns + HasMidiOuts + HasTra
|
|||
h as u16
|
||||
}
|
||||
|
||||
fn view_outputs (&self, theme: ItemTheme) -> impl Draw<'_, Tui> {
|
||||
fn view_outputs (&self, theme: ItemTheme) -> impl Draw<Tui> {
|
||||
let height = self.outputs_height();
|
||||
let list = south(
|
||||
button_3(
|
||||
|
|
@ -633,10 +633,10 @@ impl HasTrackScroll for App {
|
|||
|
||||
fn view_track_row_section <'a> (
|
||||
_theme: ItemTheme,
|
||||
button: impl Draw<'a, Tui>,
|
||||
button_add: impl Draw<'a, Tui>,
|
||||
content: impl Draw<'a, Tui>,
|
||||
) -> impl Draw<'a, Tui> {
|
||||
button: impl Draw<Tui>,
|
||||
button_add: impl Draw<Tui>,
|
||||
content: impl Draw<Tui>,
|
||||
) -> impl Draw<Tui> {
|
||||
west(
|
||||
button_add.align_nw().exact_w(4).full_h(),
|
||||
east(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue