aboutsummaryrefslogtreecommitdiffstats
path: root/src/state.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2024-11-15 09:43:43 -0500
committerDavid Robillard <d@drobilla.net>2024-11-24 18:53:10 -0500
commit7c9858897ff6014a6cf36cefbd05f1f4f63817c4 (patch)
tree266ef6241d7d6463816c485a75749bce8818882c /src/state.c
parente517361e4e9d8eae572a89a761a4def3ad8870eb (diff)
downloadjalv-7c9858897ff6014a6cf36cefbd05f1f4f63817c4.tar.gz
jalv-7c9858897ff6014a6cf36cefbd05f1f4f63817c4.tar.bz2
jalv-7c9858897ff6014a6cf36cefbd05f1f4f63817c4.zip
Move ring error handling and logging to a higher level
This removes the dependency on the "global" Jalv object from the low-level message sending functions.
Diffstat (limited to 'src/state.c')
-rw-r--r--src/state.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/state.c b/src/state.c
index 5bc781c..7e25f2d 100644
--- a/src/state.c
+++ b/src/state.c
@@ -13,6 +13,7 @@
#include "lv2/state/state.h"
#include "zix/attributes.h"
#include "zix/sem.h"
+#include "zix/status.h"
#include <stdbool.h>
#include <stdint.h>
@@ -146,17 +147,23 @@ set_port_value(const char* port_symbol,
return;
}
+ ZixStatus st = ZIX_STATUS_SUCCESS;
if (jalv->play_state != JALV_RUNNING) {
// Set value on port struct directly
port->control = fvalue;
} else {
// Send value to plugin (as if from UI)
- jalv_write_control(jalv, jalv->ui_to_plugin, port->index, fvalue);
+ st = jalv_write_control(jalv->ui_to_plugin, port->index, fvalue);
}
if (jalv->has_ui) {
// Update UI (as if from plugin)
- jalv_write_control(jalv, jalv->plugin_to_ui, port->index, fvalue);
+ st = jalv_write_control(jalv->plugin_to_ui, port->index, fvalue);
+ }
+
+ if (st) {
+ jalv_log(
+ JALV_LOG_ERR, "Failed to write control change (%s)\n", zix_strerror(st));
}
}