diff options
author | David Robillard <d@drobilla.net> | 2024-11-19 16:23:11 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2024-11-24 19:11:24 -0500 |
commit | 9ff22388ddcb5ae22aed51302889098cb246a47c (patch) | |
tree | e7988415293178def76a0e070af8d25e679ee99b /src/jack.c | |
parent | 3a01868bc21ee5b3fd0bb29e4bbd0a015692c374 (diff) | |
download | jalv-9ff22388ddcb5ae22aed51302889098cb246a47c.tar.gz jalv-9ff22388ddcb5ae22aed51302889098cb246a47c.tar.bz2 jalv-9ff22388ddcb5ae22aed51302889098cb246a47c.zip |
Factor out URIDs pointer for brevity
Mostly to reduce the number of changes in refactoring commits to follow.
Diffstat (limited to 'src/jack.c')
-rw-r--r-- | src/jack.c | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -140,10 +140,11 @@ process_transport(Jalv* const jalv, static REALTIME int jack_process_cb(jack_nframes_t nframes, void* data) { - Jalv* const jalv = (Jalv*)data; - jack_client_t* const client = jalv->backend->client; - uint64_t pos_buf[64] = {0U}; - LV2_Atom* const lv2_pos = (LV2_Atom*)pos_buf; + Jalv* const jalv = (Jalv*)data; + const JalvURIDs* const urids = &jalv->urids; + jack_client_t* const client = jalv->backend->client; + uint64_t pos_buf[64] = {0U}; + LV2_Atom* const lv2_pos = (LV2_Atom*)pos_buf; // If execution is paused, emit silence and return if (jalv->run_state == JALV_PAUSED) { @@ -159,7 +160,7 @@ jack_process_cb(jack_nframes_t nframes, void* data) if (xport_changed) { // Build an LV2 position object to report change to plugin lv2_atom_forge_set_buffer(&jalv->forge, (uint8_t*)pos_buf, sizeof(pos_buf)); - forge_position(&jalv->forge, &jalv->urids, state, pos); + forge_position(&jalv->forge, urids, state, pos); } // Prepare port buffers @@ -186,7 +187,7 @@ jack_process_cb(jack_nframes_t nframes, void* data) jack_midi_event_t ev; jack_midi_event_get(&ev, buf, i); lv2_evbuf_write( - &iter, ev.time, 0, jalv->urids.midi_MidiEvent, ev.size, ev.buffer); + &iter, ev.time, 0, urids->midi_MidiEvent, ev.size, ev.buffer); } } } else if (port->type == TYPE_EVENT) { @@ -235,7 +236,7 @@ jack_process_cb(jack_nframes_t nframes, void* data) void* body = NULL; lv2_evbuf_get(i, &frames, &subframes, &type, &size, &body); - if (buf && type == jalv->urids.midi_MidiEvent) { + if (buf && type == urids->midi_MidiEvent) { // Write MIDI event to Jack output jack_midi_event_write(buf, frames, body, size); } |