aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2024-12-19 21:30:59 -0500
committerDavid Robillard <d@drobilla.net>2024-12-19 21:30:59 -0500
commitefad9a58a085a87157e7b9e56739b64acf958bfd (patch)
tree0132f319b3d2727864c9d088763aca58af812395 /src
parentb1c955b1e0e3ae6b4b0c74112ae68a2966a92d35 (diff)
downloadjalv-efad9a58a085a87157e7b9e56739b64acf958bfd.tar.gz
jalv-efad9a58a085a87157e7b9e56739b64acf958bfd.tar.bz2
jalv-efad9a58a085a87157e7b9e56739b64acf958bfd.zip
Send events instead of writing to control port buffers in UI
Diffstat (limited to 'src')
-rw-r--r--src/jalv.c3
-rw-r--r--src/jalv_console.c3
-rw-r--r--src/jalv_qt.cpp3
3 files changed, 6 insertions, 3 deletions
diff --git a/src/jalv.c b/src/jalv.c
index ff90c7f..71e6fd6 100644
--- a/src/jalv.c
+++ b/src/jalv.c
@@ -326,7 +326,8 @@ jalv_set_control(Jalv* jalv,
const void* body)
{
if (control->type == PORT && type == jalv->forge.Float) {
- jalv->process.controls_buf[control->index] = *(const float*)body;
+ const float value = *(const float*)body;
+ jalv_write_control(jalv->process.ui_to_plugin, control->index, value);
} else if (control->type == PROPERTY &&
jalv->process.control_in != UINT32_MAX) {
LV2_Atom_Forge_Frame frame;
diff --git a/src/jalv_console.c b/src/jalv_console.c
index 1f97572..8a1f712 100644
--- a/src/jalv_console.c
+++ b/src/jalv_console.c
@@ -1,6 +1,7 @@
// Copyright 2007-2024 David Robillard <d@drobilla.net>
// SPDX-License-Identifier: ISC
+#include "comm.h"
#include "control.h"
#include "frontend.h"
#include "jalv.h"
@@ -249,7 +250,7 @@ jalv_process_command(Jalv* jalv, const char* cmd)
print_controls(jalv, false, true);
} else if (sscanf(cmd, "set %u %f", &index, &value) == 2) {
if (index < jalv->num_ports) {
- jalv->process.controls_buf[index] = value;
+ jalv_write_control(jalv->process.ui_to_plugin, index, value);
print_control_port(jalv, &jalv->ports[index], value);
} else {
fprintf(stderr, "error: port index out of range\n");
diff --git a/src/jalv_qt.cpp b/src/jalv_qt.cpp
index 9b3b145..7d99118 100644
--- a/src/jalv_qt.cpp
+++ b/src/jalv_qt.cpp
@@ -2,6 +2,7 @@
// SPDX-License-Identifier: ISC
#include "jalv_qt.hpp"
+#include "comm.h"
#include "frontend.h"
#include "jalv.h"
#include "nodes.h"
@@ -499,7 +500,7 @@ Control::dialChanged(int)
const float value = getValue();
_label->setText(getValueLabel(value));
- _jalv->process.controls_buf[_port->index] = value;
+ jalv_write_control(_jalv->process.ui_to_plugin, _port->index, value);
}
namespace {