aboutsummaryrefslogtreecommitdiffstats
path: root/src/jalv_qt.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2024-11-17 09:01:46 -0500
committerDavid Robillard <d@drobilla.net>2024-11-24 19:04:31 -0500
commit4466b8525cd97f5fde392a42f2c730ab46ccb18a (patch)
tree0e019e8ad7e721ee3a29a9efdd0f921d97ba7d86 /src/jalv_qt.cpp
parent57b544a5b036e671a516192dd2b4c2b84c37a3df (diff)
downloadjalv-4466b8525cd97f5fde392a42f2c730ab46ccb18a.tar.gz
jalv-4466b8525cd97f5fde392a42f2c730ab46ccb18a.tar.bz2
jalv-4466b8525cd97f5fde392a42f2c730ab46ccb18a.zip
Move control port buffers to a separate array
Diffstat (limited to 'src/jalv_qt.cpp')
-rw-r--r--src/jalv_qt.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/jalv_qt.cpp b/src/jalv_qt.cpp
index 9f4d28d..2718da8 100644
--- a/src/jalv_qt.cpp
+++ b/src/jalv_qt.cpp
@@ -304,12 +304,12 @@ add_preset_to_menu(Jalv* jalv,
Control::Control(PortContainer portContainer, QWidget* parent)
: QGroupBox(parent)
, _dial(new QDial())
- , _plugin(portContainer.jalv->plugin)
+ , _jalv(portContainer.jalv)
, _port(portContainer.port)
, _label(new QLabel())
{
const JalvNodes* nodes = &portContainer.jalv->nodes;
- const LilvPlugin* plugin = _plugin;
+ const LilvPlugin* plugin = portContainer.jalv->plugin;
const LilvPort* lilvPort = _port->lilv_port;
LilvNode* nmin = nullptr;
@@ -362,7 +362,9 @@ Control::Control(PortContainer portContainer, QWidget* parent)
}
// Find and set min, max and default values for port
- const float defaultValue = ndef ? lilv_node_as_float(ndef) : _port->control;
+ const float defaultValue = ndef
+ ? lilv_node_as_float(ndef)
+ : portContainer.jalv->controls_buf[_port->index];
setRange(lilv_node_as_float(nmin), lilv_node_as_float(nmax));
setValue(defaultValue);
@@ -494,7 +496,7 @@ Control::dialChanged(int)
const float value = getValue();
_label->setText(getValueLabel(value));
- _port->control = value;
+ _jalv->controls_buf[_port->index] = value;
}
namespace {