aboutsummaryrefslogtreecommitdiffstats
path: root/src/process.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/process.c')
-rw-r--r--src/process.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/process.c b/src/process.c
index 2b5a11e..49e5a1f 100644
--- a/src/process.c
+++ b/src/process.c
@@ -18,19 +18,6 @@
#include <assert.h>
#include <stddef.h>
-int
-jalv_write_get_message(LV2_Evbuf_Iterator* const iter,
- const JalvURIDs* const urids)
-{
- const LV2_Atom_Object get = {
- {sizeof(LV2_Atom_Object_Body), urids->atom_Object},
- {0U, urids->patch_Get},
- };
-
- return lv2_evbuf_write(
- iter, 0, 0, get.atom.type, get.atom.size, LV2_ATOM_BODY_CONST(&get));
-}
-
static int
ring_error(const char* const message)
{
@@ -79,6 +66,21 @@ apply_ui_events(Jalv* const jalv, const uint32_t nframes)
lv2_evbuf_write(
&e, nframes, 0U, atom->type, atom->size, LV2_ATOM_BODY_CONST(atom));
+ } else if (header.type == STATE_REQUEST) {
+ JalvPort* const port = &jalv->ports[jalv->control_in];
+ assert(port->type == TYPE_EVENT);
+ assert(port->flow == FLOW_INPUT);
+ assert(port->evbuf);
+
+ LV2_Evbuf_Iterator iter = lv2_evbuf_end(port->evbuf);
+ const LV2_Atom_Object get = {
+ {sizeof(LV2_Atom_Object_Body), jalv->urids.atom_Object},
+ {0U, jalv->urids.patch_Get},
+ };
+
+ lv2_evbuf_write(
+ &iter, nframes, 0U, get.atom.type, get.atom.size, &get.body);
+
} else {
return ring_error("Unknown message type received from UI ring\n");
}