mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 04:06:45 +01:00
wip: decruft
This commit is contained in:
parent
78e5469b32
commit
55a8b67bfb
7 changed files with 125 additions and 180 deletions
|
|
@ -186,12 +186,15 @@ pub fn render (state: &Launcher, buf: &mut Buffer, mut area: Rect) -> Usually<Re
|
|||
//area.width = 80; // DOS mode
|
||||
//area.height = 25;
|
||||
let Rect { x, y, width, height } = area;
|
||||
crate::device::transport::draw_play_stop(buf, x + 1, y, &state.playing);
|
||||
crate::device::transport::draw_rec(buf, x + 12, y, state.recording);
|
||||
crate::device::transport::draw_mon(buf, x + 19, y, state.monitoring);
|
||||
crate::device::transport::draw_dub(buf, x + 26, y, state.overdub);
|
||||
crate::device::transport::draw_bpm(buf, x + 33, y, state.timebase.bpm());
|
||||
crate::device::transport::draw_timer(buf, x + width - 1, y, &state.timebase, state.position);
|
||||
{
|
||||
use crate::device::transport::*;
|
||||
draw_play_stop(buf, x + 1, y, &state.playing);
|
||||
draw_rec(buf, x + 12, y, state.recording);
|
||||
draw_mon(buf, x + 19, y, state.monitoring);
|
||||
draw_dub(buf, x + 26, y, state.overdub);
|
||||
draw_bpm(buf, x + 33, y, state.timebase.bpm());
|
||||
draw_timer(buf, x + width - 1, y, &state.timebase, state.position);
|
||||
}
|
||||
let mut y = y + 1;
|
||||
y = y + LauncherGrid::new(
|
||||
state, buf, Rect { x, y, width, height: height / 3 }, state.view.is_tracks()
|
||||
|
|
@ -223,38 +226,25 @@ fn draw_section_sequencer (state: &Launcher, buf: &mut Buffer, area: Rect) -> Us
|
|||
}
|
||||
let track = track.unwrap().1;
|
||||
let sequencer = track.sequencer.state();
|
||||
crate::device::sequencer::horizontal::timer(
|
||||
buf, x+5, y,
|
||||
sequencer.time_axis.0,
|
||||
sequencer.time_axis.0 + area.width,
|
||||
0
|
||||
);
|
||||
crate::device::sequencer::horizontal::keys(
|
||||
buf, Rect { x, y: y + 1, width, height },
|
||||
sequencer.note_axis.1
|
||||
)?;
|
||||
if let Some(id) = state.phrase_id() {
|
||||
if let Some(phrase) = sequencer.phrases.get(id) {
|
||||
crate::device::sequencer::horizontal::lanes(
|
||||
buf, x, y + 1,
|
||||
&phrase,
|
||||
sequencer.timebase.ppq() as u32,
|
||||
sequencer.time_zoom as u32,
|
||||
sequencer.time_axis.0 as u32,
|
||||
sequencer.time_axis.0 as u32 + area.width as u32,
|
||||
sequencer.note_axis.0 as u32,
|
||||
sequencer.note_axis.1 as u32,
|
||||
);
|
||||
{
|
||||
use crate::device::sequencer::horizontal::*;
|
||||
timer(buf, x+5, y, sequencer.time_start, sequencer.time_start + area.width as usize, 0);
|
||||
keys(buf, Rect { x, y: y + 1, width, height }, sequencer.note_start)?;
|
||||
if let Some(Some(phrase)) = state.phrase_id().map(|id|sequencer.phrases.get(id)) {
|
||||
let ppq = sequencer.timebase.ppq() as u32;
|
||||
let zoom = sequencer.time_zoom as u32;
|
||||
let t0 = sequencer.time_start as u32;
|
||||
let t1 = t0 + area.width as u32;
|
||||
let n0 = sequencer.note_start as u32;
|
||||
let n1 = n0 + area.height as u32;
|
||||
lanes(buf, x, y + 1, &phrase, ppq, zoom, t0, t1, n0, n1);
|
||||
}
|
||||
let cursor_style = match view {
|
||||
LauncherView::Sequencer => Style::default().green().not_dim(),
|
||||
_ => Style::default().green().dim(),
|
||||
};
|
||||
cursor(buf, x, y + 1, cursor_style, sequencer.time_cursor, sequencer.note_cursor);
|
||||
}
|
||||
let cursor_style = match view {
|
||||
LauncherView::Sequencer => Style::default().green().not_dim(),
|
||||
_ => Style::default().green().dim(),
|
||||
};
|
||||
crate::device::sequencer::horizontal::cursor(buf, x, y + 1, cursor_style,
|
||||
sequencer.time_cursor,
|
||||
sequencer.note_cursor
|
||||
);
|
||||
Ok(area)
|
||||
}
|
||||
fn draw_section_chains (state: &Launcher, buf: &mut Buffer, area: Rect) -> Usually<Rect> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue