From 55233fbfcff29fa8fd510a815fdeb6eff869ac27 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sat, 6 Sep 2014 05:51:14 +0100 Subject: [PATCH] Cleanup --- source/carla | 4 ---- source/carla_patchbay.py | 22 ---------------------- source/carla_rack.py | 18 ------------------ source/carla_skin.py | 12 ++++++++++++ 4 files changed, 12 insertions(+), 44 deletions(-) diff --git a/source/carla b/source/carla index 05cc491af..237fb5c0d 100755 --- a/source/carla +++ b/source/carla @@ -97,10 +97,6 @@ class CarlaMultiW(QTabWidget): host.PluginAddedCallback.connect(self.fPatchbay.slot_handlePluginAddedCallback) host.PluginRemovedCallback.connect(self.fRack.slot_handlePluginRemovedCallback) host.PluginRemovedCallback.connect(self.fPatchbay.slot_handlePluginRemovedCallback) - host.PluginRenamedCallback.connect(self.fRack.slot_handlePluginRenamedCallback) - host.PluginRenamedCallback.connect(self.fPatchbay.slot_handlePluginRenamedCallback) - host.PluginUnavailableCallback.connect(self.fRack.slot_handlePluginUnavailableCallback) - host.PluginUnavailableCallback.connect(self.fPatchbay.slot_handlePluginUnavailableCallback) host.ReloadAllCallback.connect(self.fRack.slot_handleReloadAllCallback) diff --git a/source/carla_patchbay.py b/source/carla_patchbay.py index 53eded6ee..769c9b228 100644 --- a/source/carla_patchbay.py +++ b/source/carla_patchbay.py @@ -233,8 +233,6 @@ class CarlaPatchbayW(QFrame, PluginEditParentMeta): host.PluginAddedCallback.connect(self.slot_handlePluginAddedCallback) host.PluginRemovedCallback.connect(self.slot_handlePluginRemovedCallback) - host.PluginRenamedCallback.connect(self.slot_handlePluginRenamedCallback) - host.PluginUnavailableCallback.connect(self.slot_handlePluginUnavailableCallback) host.PatchbayClientAddedCallback.connect(self.slot_handlePatchbayClientAddedCallback) host.PatchbayClientRemovedCallback.connect(self.slot_handlePatchbayClientRemovedCallback) host.PatchbayClientRenamedCallback.connect(self.slot_handlePatchbayClientRenamedCallback) @@ -290,26 +288,6 @@ class CarlaPatchbayW(QFrame, PluginEditParentMeta): pitem = self.fPluginList[i] pitem.setPluginId(i) - @pyqtSlot(int, str) - def slot_handlePluginRenamedCallback(self, pluginId, newName): - if pluginId >= self.fPluginCount: - return - - pitem = self.fPluginList[pluginId] - if pitem is None: - return - - pitem.setName(newName) - - @pyqtSlot(int, str) - def slot_handlePluginUnavailableCallback(self, pluginId, errorMsg): - if pluginId >= self.fPluginCount: - return - - pitem = self.fPluginList[pluginId] - if pitem is None: - return - # ----------------------------------------------------------------- def removeAllPlugins(self): diff --git a/source/carla_rack.py b/source/carla_rack.py index 36a4c8d66..89c213a8d 100644 --- a/source/carla_rack.py +++ b/source/carla_rack.py @@ -332,8 +332,6 @@ class CarlaRackW(QFrame): host.PluginAddedCallback.connect(self.slot_handlePluginAddedCallback) host.PluginRemovedCallback.connect(self.slot_handlePluginRemovedCallback) - host.PluginRenamedCallback.connect(self.slot_handlePluginRenamedCallback) - host.PluginUnavailableCallback.connect(self.slot_handlePluginUnavailableCallback) host.ReloadAllCallback.connect(self.slot_handleReloadAllCallback) # ----------------------------------------------------------------- @@ -365,22 +363,6 @@ class CarlaRackW(QFrame): pitem = self.fPluginList[i] pitem.setPluginId(i) - @pyqtSlot(int, str) - def slot_handlePluginRenamedCallback(self, pluginId, newName): - widget = self.getPluginSlotWidget(pluginId) - - if widget is None: - return - - widget.setName(newName) - - @pyqtSlot(int, str) - def slot_handlePluginUnavailableCallback(self, pluginId, errorMsg): - widget = self.getPluginSlotWidget(pluginId) - - if widget is None: - return - # ----------------------------------------------------------------- def removeAllPlugins(self): diff --git a/source/carla_skin.py b/source/carla_skin.py index 8e7c28d74..656355f0f 100644 --- a/source/carla_skin.py +++ b/source/carla_skin.py @@ -161,6 +161,8 @@ class AbstractPluginSlot(QFrame, PluginEditParentMeta): # ------------------------------------------------------------- # Set-up connections + host.PluginRenamedCallback.connect(self.slot_handlePluginRenamedCallback) + host.PluginUnavailableCallback.connect(self.slot_handlePluginUnavailableCallback) host.ParameterValueChangedCallback.connect(self.slot_handleParameterValueChangedCallback) host.ParameterDefaultChangedCallback.connect(self.slot_handleParameterDefaultChangedCallback) host.ParameterMidiChannelChangedCallback.connect(self.slot_handleParameterMidiChannelChangedCallback) @@ -174,6 +176,16 @@ class AbstractPluginSlot(QFrame, PluginEditParentMeta): # ----------------------------------------------------------------- + @pyqtSlot(int, str) + def slot_handlePluginRenamedCallback(self, pluginId, newName): + if self.fPluginId == pluginId: + self.setName(newName) + + @pyqtSlot(int, str) + def slot_handlePluginUnavailableCallback(self, pluginId, errorMsg): + if self.fPluginId == pluginId: + pass + @pyqtSlot(int, int, float) def slot_handleParameterValueChangedCallback(self, pluginId, index, value): if self.fPluginId == pluginId: