mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-08 04:36:45 +01:00
partially colorize arrangement cursor
This commit is contained in:
parent
b956fabe70
commit
a05671a7f5
2 changed files with 10 additions and 10 deletions
|
|
@ -190,7 +190,6 @@ input_to_command!(ArrangerCommand: <Tui>|state:ArrangerTui,input|{
|
||||||
key_pat!(Char('U')) => { todo!("redo") },
|
key_pat!(Char('U')) => { todo!("redo") },
|
||||||
// TODO: k: toggle on-screen keyboard
|
// TODO: k: toggle on-screen keyboard
|
||||||
key_pat!(Ctrl-Char('k')) => { todo!("keyboard") },
|
key_pat!(Ctrl-Char('k')) => { todo!("keyboard") },
|
||||||
|
|
||||||
// Transport: Play/pause
|
// Transport: Play/pause
|
||||||
key_pat!(Char(' ')) =>
|
key_pat!(Char(' ')) =>
|
||||||
Clock(if state.clock().is_stopped() { Play(None) } else { Pause(None) }),
|
Clock(if state.clock().is_stopped() { Play(None) } else { Pause(None) }),
|
||||||
|
|
|
||||||
|
|
@ -123,12 +123,14 @@ impl<'a> ArrangerVHead<'a> {
|
||||||
pub struct ArrangerVCursor {
|
pub struct ArrangerVCursor {
|
||||||
cols: Vec<(usize, usize)>,
|
cols: Vec<(usize, usize)>,
|
||||||
rows: Vec<(usize, usize)>,
|
rows: Vec<(usize, usize)>,
|
||||||
|
color: ItemPalette,
|
||||||
selected: ArrangerSelection,
|
selected: ArrangerSelection,
|
||||||
scenes_w: u16,
|
scenes_w: u16,
|
||||||
}
|
}
|
||||||
from!(|args:(&ArrangerTui, usize)|ArrangerVCursor = Self {
|
from!(|args:(&ArrangerTui, usize)|ArrangerVCursor = Self {
|
||||||
cols: ArrangerTrack::widths(args.0.tracks()),
|
cols: ArrangerTrack::widths(args.0.tracks()),
|
||||||
rows: ArrangerScene::ppqs(args.0.scenes(), args.1),
|
rows: ArrangerScene::ppqs(args.0.scenes(), args.1),
|
||||||
|
color: args.0.color,
|
||||||
selected: args.0.selected(),
|
selected: args.0.selected(),
|
||||||
scenes_w: SCENES_W_OFFSET + ArrangerScene::longest_name(args.0.scenes()) as u16,
|
scenes_w: SCENES_W_OFFSET + ArrangerScene::longest_name(args.0.scenes()) as u16,
|
||||||
});
|
});
|
||||||
|
|
@ -170,7 +172,7 @@ render!(<Tui>|self: ArrangerVCursor|render(move|to: &mut TuiOutput|{
|
||||||
area
|
area
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
let bg = Color::Rgb(0, 255, 0);
|
let bg = self.color.lighter.rgb;//Color::Rgb(0, 255, 0);
|
||||||
if let Some([x, y, width, height]) = track_area {
|
if let Some([x, y, width, height]) = track_area {
|
||||||
to.fill_fg([x, y, 1, height], bg);
|
to.fill_fg([x, y, 1, height], bg);
|
||||||
to.fill_fg([x + width, y, 1, height], bg);
|
to.fill_fg([x + width, y, 1, height], bg);
|
||||||
|
|
@ -198,8 +200,7 @@ from!(<'a>|args:(&'a ArrangerTui, usize)|ArrangerVClips<'a> = Self {
|
||||||
tracks: &args.0.tracks,
|
tracks: &args.0.tracks,
|
||||||
rows: ArrangerScene::ppqs(args.0.scenes(), args.1),
|
rows: ArrangerScene::ppqs(args.0.scenes(), args.1),
|
||||||
});
|
});
|
||||||
render!(<Tui>|self: ArrangerVClips<'a>|Fixed::h(
|
render!(<Tui>|self: ArrangerVClips<'a>|Fill::wh(
|
||||||
(self.size.h() as u16).saturating_sub(HEADER_H),
|
|
||||||
col!((scene, pulses) in self.scenes.iter().zip(self.rows.iter().map(|row|row.0)) => {
|
col!((scene, pulses) in self.scenes.iter().zip(self.rows.iter().map(|row|row.0)) => {
|
||||||
Self::format_scene(&self.tracks, scene, pulses)
|
Self::format_scene(&self.tracks, scene, pulses)
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue