aboutsummaryrefslogtreecommitdiffstats
path: root/src/state.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/state.c')
-rw-r--r--src/state.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/state.c b/src/state.c
index 8975df9..166cd0e 100644
--- a/src/state.c
+++ b/src/state.c
@@ -147,11 +147,16 @@ set_port_value(const char* port_symbol,
return;
}
- // Send value to plugin
- jalv_ui_write(jalv, port->index, sizeof(fvalue), 0, &fvalue);
+ if (jalv->play_state != JALV_RUNNING) {
+ // Set value on port struct directly
+ port->control = fvalue;
+ } else {
+ // Send value to running plugin
+ jalv_ui_write(jalv, port->index, sizeof(fvalue), 0, &fvalue);
+ }
- // Update UI
if (jalv->has_ui) {
+ // Update UI
char buf[sizeof(ControlChange) + sizeof(fvalue)];
ControlChange* ev = (ControlChange*)buf;
ev->index = port->index;