mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 12:16:42 +01:00
80x25
This commit is contained in:
parent
e13569df93
commit
2432f27e8c
3 changed files with 11 additions and 6 deletions
|
|
@ -13,8 +13,8 @@ impl<'a> LauncherGridView<'a> {
|
||||||
Self { state, buf, area, separator, focused }
|
Self { state, buf, area, separator, focused }
|
||||||
}
|
}
|
||||||
pub fn draw (&mut self) -> Usually<Rect> {
|
pub fn draw (&mut self) -> Usually<Rect> {
|
||||||
self.separator_h(0, false);
|
//self.separator_h(0, false);
|
||||||
self.separator_h(2, false);
|
//self.separator_h(2, false);
|
||||||
self.separator_h((self.state.cursor.1 * 2) as u16, true);
|
self.separator_h((self.state.cursor.1 * 2) as u16, true);
|
||||||
self.separator_h(((self.state.cursor.1 + 1) * 2) as u16, true);
|
self.separator_h(((self.state.cursor.1 + 1) * 2) as u16, true);
|
||||||
draw_box_styled(self.buf, self.area, Some(
|
draw_box_styled(self.buf, self.area, Some(
|
||||||
|
|
|
||||||
|
|
@ -173,6 +173,7 @@ pub fn process (state: &mut Launcher, _: &Client, _: &ProcessScope) -> Control {
|
||||||
}
|
}
|
||||||
pub fn render (state: &Launcher, buf: &mut Buffer, area: Rect) -> Usually<Rect> {
|
pub fn render (state: &Launcher, buf: &mut Buffer, area: Rect) -> Usually<Rect> {
|
||||||
let Rect { x, y, width, height } = area;
|
let Rect { x, y, width, height } = area;
|
||||||
|
let width = 80;
|
||||||
crate::device::sequencer::draw_play_stop(buf, x + 1, y, &state.playing);
|
crate::device::sequencer::draw_play_stop(buf, x + 1, y, &state.playing);
|
||||||
crate::device::sequencer::draw_rec(buf, x + 12, y, state.recording);
|
crate::device::sequencer::draw_rec(buf, x + 12, y, state.recording);
|
||||||
crate::device::sequencer::draw_mon(buf, x + 19, y, state.monitoring);
|
crate::device::sequencer::draw_mon(buf, x + 19, y, state.monitoring);
|
||||||
|
|
@ -184,10 +185,10 @@ pub fn render (state: &Launcher, buf: &mut Buffer, area: Rect) -> Usually<Rect>
|
||||||
//separator.blit(buf, x, y + 41, Some(Style::default().dim()));
|
//separator.blit(buf, x, y + 41, Some(Style::default().dim()));
|
||||||
let mut y = y + 1;
|
let mut y = y + 1;
|
||||||
y = y + LauncherGridView::new(
|
y = y + LauncherGridView::new(
|
||||||
state, buf, Rect { x, y, width, height: 22 }, state.view.is_tracks()
|
state, buf, Rect { x, y, width, height: 8 }, state.view.is_tracks()
|
||||||
).draw()?.height;
|
).draw()?.height;
|
||||||
y = y + draw_section_sequencer(state, buf, Rect { x, y, width, height: 28 })?.height;
|
y = y + draw_section_sequencer(state, buf, Rect { x, y, width, height: 8 })?.height;
|
||||||
y = y + draw_section_chains(state, buf, Rect { x, y, width, height: 21 })?.height;
|
y = y + draw_section_chains(state, buf, Rect { x, y, width, height: 8 })?.height;
|
||||||
if state.show_help {
|
if state.show_help {
|
||||||
let style = Some(Style::default().bold().white().not_dim().on_black().italic());
|
let style = Some(Style::default().bold().white().not_dim().on_black().italic());
|
||||||
let hide = "[Left Right] Track [Up Down] Scene [, .] Value [F1] Toggle help ";
|
let hide = "[Left Right] Track [Up Down] Scene [, .] Value [F1] Toggle help ";
|
||||||
|
|
@ -292,6 +293,10 @@ fn draw_section_chains (state: &Launcher, buf: &mut Buffer, area: Rect) -> Usual
|
||||||
},
|
},
|
||||||
_ => {},
|
_ => {},
|
||||||
};
|
};
|
||||||
|
draw_highlight(buf, &Some(area), match state.view {
|
||||||
|
LauncherView::Chains => Style::default().green().dim(),
|
||||||
|
_ => Style::default().dim()
|
||||||
|
});
|
||||||
if let Some(chain) = &chain {
|
if let Some(chain) = &chain {
|
||||||
if let Some(plugin) = plugins.get(chain.focus) {
|
if let Some(plugin) = plugins.get(chain.focus) {
|
||||||
draw_highlight(buf, &Some(*plugin), match state.view {
|
draw_highlight(buf, &Some(*plugin), match state.view {
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ pub fn timer (buf: &mut Buffer, x: u16, y: u16, beat: usize, steps: usize, time0
|
||||||
pub fn keys (buf: &mut Buffer, area: Rect, note1: u16) -> Usually<Rect> {
|
pub fn keys (buf: &mut Buffer, area: Rect, note1: u16) -> Usually<Rect> {
|
||||||
let bw = Style::default().dim();
|
let bw = Style::default().dim();
|
||||||
let Rect { x, y, width, height } = area;
|
let Rect { x, y, width, height } = area;
|
||||||
let h = 32.max(height.saturating_sub(2)*2)/2;
|
let h = height.saturating_sub(2);
|
||||||
for i in 0..h {
|
for i in 0..h {
|
||||||
let y = y + i;
|
let y = y + i;
|
||||||
buf.set_string(x + 1, y, KEYS_VERTICAL[(i % 6) as usize], bw);
|
buf.set_string(x + 1, y, KEYS_VERTICAL[(i % 6) as usize], bw);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue