aboutsummaryrefslogtreecommitdiffstats
path: root/src/state.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2024-11-16 18:26:31 -0500
committerDavid Robillard <d@drobilla.net>2024-11-24 19:03:54 -0500
commit06bd42a00bd86f5d487727ff8f08797f9286b27f (patch)
treef0240d6095ebdbb7ddf5ff4f099db45c919b3425 /src/state.c
parentd52d38ccdc9bc38fe5c62eb2458be30b3cf6ca59 (diff)
downloadjalv-06bd42a00bd86f5d487727ff8f08797f9286b27f.tar.gz
jalv-06bd42a00bd86f5d487727ff8f08797f9286b27f.tar.bz2
jalv-06bd42a00bd86f5d487727ff8f08797f9286b27f.zip
Use message mechanism to request plugin state updates
Replaces highly questionable cross-thread use of the request_update flag.
Diffstat (limited to 'src/state.c')
-rw-r--r--src/state.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/state.c b/src/state.c
index e75ab3c..1bfe6ce 100644
--- a/src/state.c
+++ b/src/state.c
@@ -13,6 +13,7 @@
#include "lv2/core/lv2.h"
#include "lv2/state/state.h"
#include "zix/attributes.h"
+#include "zix/ring.h"
#include "zix/sem.h"
#include "zix/status.h"
@@ -193,8 +194,9 @@ jalv_apply_state(Jalv* jalv, const LilvState* state)
state, jalv->instance, set_port_value, jalv, 0, state_features);
if (must_pause) {
- jalv->request_update = true;
- jalv->play_state = JALV_RUNNING;
+ const JalvMessageHeader msg = {STATE_REQUEST, 0U};
+ zix_ring_write(jalv->ui_to_plugin, &msg, sizeof(msg));
+ jalv->play_state = JALV_RUNNING;
}
}