mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 11:46:41 +01:00
wip: successfully registers transport callback
This commit is contained in:
parent
d926422c67
commit
ae69e87dc9
3 changed files with 16 additions and 7 deletions
|
|
@ -9,6 +9,9 @@ pub struct GrooveboxCli {
|
|||
/// Whether to include a transport toolbar (default: true)
|
||||
#[arg(short, long, default_value_t = true)]
|
||||
transport: bool,
|
||||
/// Whether to attempt to become transport master
|
||||
#[arg(short, long, default_value_t = true)]
|
||||
sync: bool,
|
||||
/// MIDI outs to connect to MIDI input
|
||||
#[arg(short='i', long)]
|
||||
midi_from: Vec<String>,
|
||||
|
|
@ -31,7 +34,7 @@ pub struct GrooveboxCli {
|
|||
impl GrooveboxCli {
|
||||
fn run (&self) -> Usually<()> {
|
||||
Tui::run(JackClient::new("tek_groovebox")?.activate_with(|jack|{
|
||||
let app = tek::GrooveboxTui::try_from(jack)?;
|
||||
let app = tek::GrooveboxTui::try_from(jack)?;
|
||||
jack.read().unwrap().client().connect_ports(&app.player.midi_outs[0], &app.sampler.midi_in)?;
|
||||
jack.connect_midi_from(&app.player.midi_ins[0], &self.midi_from)?;
|
||||
jack.connect_midi_from(&app.sampler.midi_in, &self.midi_from)?;
|
||||
|
|
@ -40,6 +43,12 @@ impl GrooveboxCli {
|
|||
jack.connect_audio_from(&app.sampler.audio_ins[1], &self.r_from)?;
|
||||
jack.connect_audio_to(&app.sampler.audio_outs[0], &self.l_to)?;
|
||||
jack.connect_audio_to(&app.sampler.audio_outs[1], &self.r_to)?;
|
||||
if self.sync {
|
||||
jack.read().unwrap().client().register_timebase_callback(false, |bbt, state, nframes, new_pos|{
|
||||
println!("\r{state:?} {nframes} {new_pos}");
|
||||
// TODO
|
||||
})?
|
||||
}
|
||||
Ok(app)
|
||||
})?)?;
|
||||
Ok(())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue