mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 12:16:42 +01:00
wip: enabling standalone arranger
This commit is contained in:
parent
b6da43e93e
commit
7685072e4c
16 changed files with 445 additions and 370 deletions
|
|
@ -1,3 +1,13 @@
|
|||
# `tek_timer`
|
||||
|
||||
This crate implements time sync and JACK transport control.
|
||||
|
||||
* Warning: If transport is set rolling by qjackctl, this program can't pause it
|
||||
* Todo: bpm: shift +/- 0.001
|
||||
* Todo: quant/sync: shift = next/prev value of same type (normal, triplet, dotted)
|
||||
* Or: use shift to switch between inc/dec top/bottom value?
|
||||
* Todo: focus play button
|
||||
* Todo: focus time position
|
||||
* Todo: edit numeric values
|
||||
* Todo: jump to time/bbt markers
|
||||
* Todo: count xruns
|
||||
|
|
|
|||
|
|
@ -71,14 +71,15 @@ impl TransportToolbar {
|
|||
}
|
||||
|
||||
pub fn toggle_play (&mut self) -> Usually<()> {
|
||||
let transport = self.transport.as_ref().unwrap();
|
||||
self.playing = match self.playing.expect("1st frame has not been processed yet") {
|
||||
TransportState::Stopped => {
|
||||
self.transport.as_ref().unwrap().start()?;
|
||||
transport.start()?;
|
||||
Some(TransportState::Starting)
|
||||
},
|
||||
_ => {
|
||||
self.transport.as_ref().unwrap().stop()?;
|
||||
self.transport.as_ref().unwrap().locate(0)?;
|
||||
transport.stop()?;
|
||||
transport.locate(0)?;
|
||||
Some(TransportState::Stopped)
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -73,8 +73,11 @@ render!(TransportToolbar |self, buf, area| {
|
|||
let (bars, beats) = ((beats / 4) + 1, (beats % 4) + 1);
|
||||
let (seconds, msecs) = (usecs / 1000000, usecs / 1000 % 1000);
|
||||
let (minutes, seconds) = (seconds / 60, seconds % 60);
|
||||
let timer = format!("{minutes}:{seconds:02}:{msecs:03} {bars}.{beats}.{pulses:02}");
|
||||
timer.blit(buf, x + width - timer.len() as u16 - 1, y, Some(not_dim))
|
||||
let timer = format!("{bars}.{beats}.{pulses:02}");
|
||||
timer.blit(buf, x + width - timer.len() as u16 - 1, y + 0, Some(not_dim))?;
|
||||
let timer = format!("{minutes}:{seconds:02}:{msecs:03}");
|
||||
timer.blit(buf, x + width - timer.len() as u16 - 1, y + 1, Some(not_dim))?;
|
||||
Ok(area)
|
||||
}
|
||||
|
||||
]).render(buf, area)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue