From 0effad9dba5b0865def87e0ab4be11afe1565335 Mon Sep 17 00:00:00 2001 From: falkTX Date: Wed, 8 May 2013 19:01:41 +0100 Subject: [PATCH] CarlaControl fixing --- source/backend/engine/CarlaEngineOsc.cpp | 2 +- source/carla_control.py | 31 ++++++++++++++++++++++-- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/source/backend/engine/CarlaEngineOsc.cpp b/source/backend/engine/CarlaEngineOsc.cpp index 220731415..773488696 100644 --- a/source/backend/engine/CarlaEngineOsc.cpp +++ b/source/backend/engine/CarlaEngineOsc.cpp @@ -167,13 +167,13 @@ bool isDigit(const char c) int CarlaEngineOsc::handleMessage(const bool isTCP, const char* const path, const int argc, const lo_arg* const* const argv, const char* const types, const lo_message msg) { - carla_debug("CarlaEngineOsc::handleMessage(%s, \"%s\", %i, %p, \"%s\", %p)", bool2str(isTCP), path, argc, argv, types, msg); CARLA_ASSERT(fName.isNotEmpty()); CARLA_ASSERT(fServerPathTCP.isNotEmpty()); CARLA_ASSERT(fServerPathUDP.isNotEmpty()); CARLA_ASSERT(fServerTCP != nullptr); CARLA_ASSERT(fServerUDP != nullptr); CARLA_ASSERT(path != nullptr); + carla_debug("CarlaEngineOsc::handleMessage(%s, \"%s\", %i, %p, \"%s\", %p)", bool2str(isTCP), path, argc, argv, types, msg); if (path == nullptr) { diff --git a/source/carla_control.py b/source/carla_control.py index d835e8243..93f3b1aed 100755 --- a/source/carla_control.py +++ b/source/carla_control.py @@ -655,7 +655,6 @@ class CarlaControlW(QMainWindow): self.connect(self.ui.act_help_about, SIGNAL("triggered()"), SLOT("slot_aboutCarlaControl()")) self.connect(self.ui.act_help_about_qt, SIGNAL("triggered()"), app, SLOT("aboutQt()")) - self.connect(self, SIGNAL("SIGUSR1()"), SLOT("slot_handleSIGUSR1()")) self.connect(self, SIGNAL("SIGTERM()"), SLOT("slot_handleSIGTERM()")) self.connect(self, SIGNAL("AddPluginStart(int, QString)"), SLOT("slot_handleAddPluginStart(int, QString)")) @@ -704,6 +703,11 @@ class CarlaControlW(QMainWindow): self.fIdleTimerFast = self.startTimer(60) self.fIdleTimerSlow = self.startTimer(60*2) + @pyqtSlot() + def slot_handleSIGTERM(self): + print("Got SIGTERM -> Closing now") + self.close() + @pyqtSlot() def slot_fileConnect(self): global lo_target, lo_targetName @@ -757,7 +761,6 @@ class CarlaControlW(QMainWindow): @pyqtSlot(int) def slot_handleAddPluginEnd(self, pluginId): pwidget = PluginWidget(self, pluginId) - pwidget.setRefreshRate(60) self.ui.w_plugins.layout().addWidget(pwidget) @@ -863,6 +866,9 @@ class CarlaControlW(QMainWindow): if parameterId >= 0: Carla.host._set_parameterValueS(pluginId, parameterId, value) + if pluginId >= self.fPluginCount: + return + pwidget = self.fPluginList[pluginId] if pwidget is None: return @@ -873,6 +879,9 @@ class CarlaControlW(QMainWindow): def slot_handleSetDefaultValue(self, pluginId, parameterId, value): Carla.host._set_parameterDefaultValue(pluginId, parameterId, value) + if pluginId >= self.fPluginCount: + return + pwidget = self.fPluginList[pluginId] if pwidget is None: return @@ -883,6 +892,9 @@ class CarlaControlW(QMainWindow): def slot_handleSetParameterMidiCC(self, pluginId, index, cc): Carla.host._set_parameterMidiCC(pluginId, index, cc) + if pluginId >= self.fPluginCount: + return + pwidget = self.fPluginList[pluginId] if pwidget is None: return @@ -893,6 +905,9 @@ class CarlaControlW(QMainWindow): def slot_handleSetParameterMidiChannel(self, pluginId, index, channel): Carla.host._set_parameterMidiChannel(pluginId, index, channel) + if pluginId >= self.fPluginCount: + return + pwidget = self.fPluginList[pluginId] if pwidget is None: return @@ -903,6 +918,9 @@ class CarlaControlW(QMainWindow): def slot_handleSetProgram(self, pluginId, index): Carla.host._set_currentProgram(pluginId, index) + if pluginId >= self.fPluginCount: + return + pwidget = self.fPluginList[pluginId] if pwidget is None: return @@ -921,6 +939,9 @@ class CarlaControlW(QMainWindow): def slot_handleSetMidiProgram(self, pluginId, index): Carla.host._set_currentMidiProgram(pluginId, index) + if pluginId >= self.fPluginCount: + return + pwidget = self.fPluginList[pluginId] if pwidget is None: return @@ -949,6 +970,9 @@ class CarlaControlW(QMainWindow): @pyqtSlot(int, int, int, int) def slot_handleNoteOn(self, pluginId, channel, note, velo): + if pluginId >= self.fPluginCount: + return + pwidget = self.fPluginList[pluginId] if pwidget is None: return @@ -957,6 +981,9 @@ class CarlaControlW(QMainWindow): @pyqtSlot(int, int, int) def slot_handleNoteOff(self, pluginId, channel, note): + if pluginId >= self.fPluginCount: + return + pwidget = self.fPluginList[pluginId] if pwidget is None: return