mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 04:06:45 +01:00
wip: f64 timebase (sloooo)
This commit is contained in:
parent
c4d8692b71
commit
4055662bbd
12 changed files with 206 additions and 142 deletions
|
|
@ -46,7 +46,7 @@ impl Launcher {
|
|||
) -> Result<DynamicDevice<Self>, Box<dyn Error>> {
|
||||
let (client, _) = Client::new(name, ClientOptions::NO_START_SERVER)?;
|
||||
let transport = client.transport();
|
||||
let ppq = timebase.ppq() as u32;
|
||||
let ppq = timebase.ppq() as usize;
|
||||
DynamicDevice::new(render, handle, process, Self {
|
||||
name: name.into(),
|
||||
view: LauncherView::Chains,
|
||||
|
|
@ -187,7 +187,7 @@ pub fn render (state: &Launcher, buf: &mut Buffer, mut area: Rect) -> Usually<Re
|
|||
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_bpm(buf, x + 33, y, state.timebase.bpm() as usize);
|
||||
draw_timer(buf, x + width - 1, y, &state.timebase, state.position);
|
||||
}
|
||||
let mut y = y + 1;
|
||||
|
|
@ -226,12 +226,12 @@ fn draw_section_sequencer (state: &Launcher, buf: &mut Buffer, area: Rect) -> Us
|
|||
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;
|
||||
let ppq = sequencer.timebase.ppq() as usize;
|
||||
let zoom = sequencer.time_zoom;
|
||||
let t0 = sequencer.time_start;
|
||||
let t1 = t0 + area.width as usize;
|
||||
let n0 = sequencer.note_start;
|
||||
let n1 = n0 + area.height as usize;
|
||||
lanes(buf, x, y + 1, &phrase, ppq, zoom, t0, t1, n0, n1);
|
||||
}
|
||||
let cursor_style = match view {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue