From bc8d7c9645f9b28eb0e3e8c927ff8a1ec4113fa6 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 12 Oct 2014 23:48:17 +0100 Subject: [PATCH] Send initial state of internal params to carla-plugin --- source/backend/engine/CarlaEngineNative.cpp | 8 ++++++++ source/carla_host.py | 1 - source/modules/native-plugins/resources/carla-plugin | 5 ++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/source/backend/engine/CarlaEngineNative.cpp b/source/backend/engine/CarlaEngineNative.cpp index b9f111656..4e1d611a5 100644 --- a/source/backend/engine/CarlaEngineNative.cpp +++ b/source/backend/engine/CarlaEngineNative.cpp @@ -792,6 +792,14 @@ protected: const uint pluginId(plugin->getId()); + for (int32_t i=PARAMETER_ACTIVE; i>PARAMETER_MAX; --i) + { + std::sprintf(fTmpBuf, "PARAMVAL_%i:%i\n", pluginId, i); + fUiServer.writeMsg(fTmpBuf); + std::sprintf(fTmpBuf, "%f\n", plugin->getInternalParameterValue(i)); + fUiServer.writeMsg(fTmpBuf); + } + uint32_t ins, outs, count; plugin->getParameterCountInfo(ins, outs); count = plugin->getParameterCount(); diff --git a/source/carla_host.py b/source/carla_host.py index 517fb48da..e4496d22d 100644 --- a/source/carla_host.py +++ b/source/carla_host.py @@ -671,7 +671,6 @@ class HostWindow(QMainWindow): self.projectLoadingFinished() - # just in case self.host.remove_all_plugins() self.removeAllPlugins() diff --git a/source/modules/native-plugins/resources/carla-plugin b/source/modules/native-plugins/resources/carla-plugin index 12c3af3d9..8ef839870 100755 --- a/source/modules/native-plugins/resources/carla-plugin +++ b/source/modules/native-plugins/resources/carla-plugin @@ -144,7 +144,10 @@ class CarlaMiniW(ExternalUI, HostWindow): elif msg.startswith("PARAMVAL_"): pluginId, paramId = [int(i) for i in msg.replace("PARAMVAL_", "").split(":")] paramValue = float(self.readlineblock()) - self.host._set_parameterValue(pluginId, paramId, paramValue) + if paramId < 0: + self.host._set_internalValue(pluginId, paramId, paramValue) + else: + self.host._set_parameterValue(pluginId, paramId, paramValue) elif msg.startswith("ENGINE_CALLBACK_"): action = int(msg.replace("ENGINE_CALLBACK_", ""))