mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 19:56:42 +01:00
JackClient -> JackConnection
This commit is contained in:
parent
c3f9aa7549
commit
411d4bc91d
23 changed files with 55 additions and 51 deletions
|
|
@ -33,7 +33,7 @@ pub struct GrooveboxCli {
|
|||
}
|
||||
impl GrooveboxCli {
|
||||
fn run (&self) -> Usually<()> {
|
||||
Tui::run(JackClient::new("tek_groovebox")?.activate_with(|jack|{
|
||||
Tui::run(JackConnection::new("tek_groovebox")?.activate_with(|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)?;
|
||||
|
|
@ -44,11 +44,10 @@ impl GrooveboxCli {
|
|||
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, |state|{
|
||||
let ::jack::contrib::TimebaseInfo { state, new_pos, nframes, mut position } = state;
|
||||
app.clock().playhead.update_from_sample(position.frame() as f64);
|
||||
position.bbt = Some(app.clock().bbt());
|
||||
position
|
||||
jack.read().unwrap().client().register_timebase_callback(false, |mut state|{
|
||||
app.clock().playhead.update_from_sample(state.position.frame() as f64);
|
||||
state.position.bbt = Some(app.clock().bbt());
|
||||
state.position
|
||||
})?
|
||||
}
|
||||
Ok(app)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue