mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 11:46:41 +01:00
add --bpm flag
This commit is contained in:
parent
42e2ef2a50
commit
94491a323a
11 changed files with 78 additions and 57 deletions
|
|
@ -15,6 +15,9 @@ pub struct GrooveboxCli {
|
|||
/// Whether to attempt to become transport master
|
||||
#[arg(short='s', long, default_value_t = true)]
|
||||
sync_follow: bool,
|
||||
/// Default BPM
|
||||
#[arg(short='b', long, default_value = None)]
|
||||
bpm: Option<f64>,
|
||||
/// MIDI outs to connect to MIDI input
|
||||
#[arg(short='i', long)]
|
||||
midi_from: Vec<String>,
|
||||
|
|
@ -46,6 +49,9 @@ impl GrooveboxCli {
|
|||
&[&self.l_from.as_slice(), &self.r_from.as_slice()],
|
||||
&[&self.l_to.as_slice(), &self.r_to.as_slice()],
|
||||
)?;
|
||||
if let Some(bpm) = self.bpm {
|
||||
app.clock().timebase.bpm.set(bpm);
|
||||
}
|
||||
if self.sync_lead {
|
||||
jack.read().unwrap().client().register_timebase_callback(false, |mut state|{
|
||||
app.clock().playhead.update_from_sample(state.position.frame() as f64);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue