| @@ -1696,6 +1696,7 @@ private: | |||||
| carla_stdout("CarlaEngineJack::findPluginIdAndIcon(\"%s\", ...) - found plugin, yes!!!", clientName); | carla_stdout("CarlaEngineJack::findPluginIdAndIcon(\"%s\", ...) - found plugin, yes!!!", clientName); | ||||
| pluginId = static_cast<int>(i); | pluginId = static_cast<int>(i); | ||||
| icon = PATCHBAY_ICON_PLUGIN; | |||||
| if (const char* const pluginIcon = plugin->getIconName()) | if (const char* const pluginIcon = plugin->getIconName()) | ||||
| { | { | ||||
| @@ -121,7 +121,7 @@ class HostWindow(QMainWindow): | |||||
| ReloadParametersCallback = pyqtSignal(int) | ReloadParametersCallback = pyqtSignal(int) | ||||
| ReloadProgramsCallback = pyqtSignal(int) | ReloadProgramsCallback = pyqtSignal(int) | ||||
| ReloadAllCallback = pyqtSignal(int) | ReloadAllCallback = pyqtSignal(int) | ||||
| PatchbayClientAddedCallback = pyqtSignal(int, int, str) | |||||
| PatchbayClientAddedCallback = pyqtSignal(int, int, int, str) | |||||
| PatchbayClientRemovedCallback = pyqtSignal(int) | PatchbayClientRemovedCallback = pyqtSignal(int) | ||||
| PatchbayClientRenamedCallback = pyqtSignal(int, str) | PatchbayClientRenamedCallback = pyqtSignal(int, str) | ||||
| PatchbayClientDataChangedCallback = pyqtSignal(int, int, int) | PatchbayClientDataChangedCallback = pyqtSignal(int, int, int) | ||||
| @@ -1173,7 +1173,7 @@ def engineCallback(ptr, action, pluginId, value1, value2, value3, valueStr): | |||||
| elif action == ENGINE_CALLBACK_RELOAD_ALL: | elif action == ENGINE_CALLBACK_RELOAD_ALL: | ||||
| Carla.gui.ReloadAllCallback.emit(pluginId) | Carla.gui.ReloadAllCallback.emit(pluginId) | ||||
| elif action == ENGINE_CALLBACK_PATCHBAY_CLIENT_ADDED: | elif action == ENGINE_CALLBACK_PATCHBAY_CLIENT_ADDED: | ||||
| Carla.gui.PatchbayClientAddedCallback.emit(pluginId, value1, valueStr) | |||||
| Carla.gui.PatchbayClientAddedCallback.emit(pluginId, value1, value2, valueStr) | |||||
| elif action == ENGINE_CALLBACK_PATCHBAY_CLIENT_REMOVED: | elif action == ENGINE_CALLBACK_PATCHBAY_CLIENT_REMOVED: | ||||
| Carla.gui.PatchbayClientRemovedCallback.emit(pluginId) | Carla.gui.PatchbayClientRemovedCallback.emit(pluginId) | ||||
| elif action == ENGINE_CALLBACK_PATCHBAY_CLIENT_RENAMED: | elif action == ENGINE_CALLBACK_PATCHBAY_CLIENT_RENAMED: | ||||
| @@ -609,8 +609,8 @@ class CarlaPatchbayW(QGraphicsView): | |||||
| # ----------------------------------------------------------------- | # ----------------------------------------------------------------- | ||||
| @pyqtSlot(int, int, str) | |||||
| def slot_handlePatchbayClientAddedCallback(self, clientId, clientIcon, clientName): | |||||
| @pyqtSlot(int, int, int, str) | |||||
| def slot_handlePatchbayClientAddedCallback(self, clientId, clientIcon, pluginId, clientName): | |||||
| pcSplit = patchcanvas.SPLIT_UNDEF | pcSplit = patchcanvas.SPLIT_UNDEF | ||||
| pcIcon = patchcanvas.ICON_APPLICATION | pcIcon = patchcanvas.ICON_APPLICATION | ||||
| @@ -629,6 +629,18 @@ class CarlaPatchbayW(QGraphicsView): | |||||
| QTimer.singleShot(0, self.fMiniCanvasPreview.update) | QTimer.singleShot(0, self.fMiniCanvasPreview.update) | ||||
| if pluginId < 0: | |||||
| return | |||||
| if pluginId >= self.getPluginCount(): | |||||
| print("sorry, can't map this plugin to canvas client", pluginId, self.getPluginCount()) | |||||
| return | |||||
| pitem = self.fPluginList[pluginId] | |||||
| if pitem is None: | |||||
| return | |||||
| patchcanvas.setGroupAsPlugin(clientId, pluginId, bool(pitem.fPluginInfo['hints'] & PLUGIN_HAS_CUSTOM_UI)) | |||||
| @pyqtSlot(int) | @pyqtSlot(int) | ||||
| def slot_handlePatchbayClientRemovedCallback(self, clientId): | def slot_handlePatchbayClientRemovedCallback(self, clientId): | ||||
| #if not self.fEngineStarted: return | #if not self.fEngineStarted: return | ||||
| @@ -658,6 +670,18 @@ class CarlaPatchbayW(QGraphicsView): | |||||
| patchcanvas.setGroupIcon(clientId, pcIcon) | patchcanvas.setGroupIcon(clientId, pcIcon) | ||||
| QTimer.singleShot(0, self.fMiniCanvasPreview.update) | QTimer.singleShot(0, self.fMiniCanvasPreview.update) | ||||
| if pluginId < 0: | |||||
| return | |||||
| if pluginId >= self.getPluginCount(): | |||||
| print("sorry, can't map this plugin to canvas client", pluginId, self.getPluginCount()) | |||||
| return | |||||
| pitem = self.fPluginList[pluginId] | |||||
| if pitem is None: | |||||
| return | |||||
| patchcanvas.setGroupAsPlugin(clientId, pluginId, bool(pitem.fPluginInfo['hints'] & PLUGIN_HAS_CUSTOM_UI)) | |||||
| @pyqtSlot(int, int, int, str) | @pyqtSlot(int, int, int, str) | ||||
| def slot_handlePatchbayPortAddedCallback(self, clientId, portId, portFlags, portName): | def slot_handlePatchbayPortAddedCallback(self, clientId, portId, portFlags, portName): | ||||
| if (portFlags & PATCHBAY_PORT_IS_INPUT): | if (portFlags & PATCHBAY_PORT_IS_INPUT): | ||||
| @@ -257,11 +257,17 @@ def port_type2str(port_type): | |||||
| return "PORT_TYPE_???" | return "PORT_TYPE_???" | ||||
| def icon2str(icon): | def icon2str(icon): | ||||
| if icon == ICON_HARDWARE: | |||||
| return "ICON_HARDWARE" | |||||
| elif ICON_APPLICATION: | |||||
| if icon == ICON_APPLICATION: | |||||
| return "ICON_APPLICATION" | return "ICON_APPLICATION" | ||||
| elif ICON_LADISH_ROOM: | |||||
| elif icon == ICON_HARDWARE: | |||||
| return "ICON_HARDWARE" | |||||
| elif icon == ICON_DISTRHO: | |||||
| return "ICON_DISTRHO" | |||||
| elif icon == ICON_FILE: | |||||
| return "ICON_FILE" | |||||
| elif icon == ICON_PLUGIN: | |||||
| return "ICON_PLUGIN" | |||||
| elif icon == ICON_LADISH_ROOM: | |||||
| return "ICON_LADISH_ROOM" | return "ICON_LADISH_ROOM" | ||||
| else: | else: | ||||
| return "ICON_???" | return "ICON_???" | ||||
| @@ -720,6 +726,22 @@ def setGroupIcon(group_id, icon): | |||||
| qCritical("PatchCanvas::setGroupIcon(%i, %s) - unable to find group to change icon" % (group_id, icon2str(icon))) | qCritical("PatchCanvas::setGroupIcon(%i, %s) - unable to find group to change icon" % (group_id, icon2str(icon))) | ||||
| def setGroupAsPlugin(group_id, plugin_id, hasUi): | |||||
| if canvas.debug: | |||||
| qDebug("PatchCanvas::setGroupAsPlugin(%i, %i, %s)" % (group_id, plugin_id, bool2str(hasUi))) | |||||
| for group in canvas.group_list: | |||||
| if group.group_id == group_id: | |||||
| group.widgets[0].setAsPlugin(plugin_id, hasUi) | |||||
| if group.split and group.widgets[1]: | |||||
| group.widgets[1].setAsPlugin(plugin_id, hasUi) | |||||
| QTimer.singleShot(0, canvas.scene.update) | |||||
| return | |||||
| qCritical("PatchCanvas::setGroupAsPlugin(%i, %i, %s) - unable to find group to set as plugin" % (group_id, plugin_id, bool2str(hasUi))) | |||||
| def addPort(group_id, port_id, port_name, port_mode, port_type): | def addPort(group_id, port_id, port_name, port_mode, port_type): | ||||
| if canvas.debug: | if canvas.debug: | ||||
| qDebug("PatchCanvas::addPort(%i, %i, %s, %s, %s)" % (group_id, port_id, port_name.encode(), port_mode2str(port_mode), port_type2str(port_type))) | qDebug("PatchCanvas::addPort(%i, %i, %s, %s, %s)" % (group_id, port_id, port_name.encode(), port_mode2str(port_mode), port_type2str(port_type))) | ||||
| @@ -2048,6 +2070,9 @@ class CanvasBox(QGraphicsItem): | |||||
| def getPortList(self): | def getPortList(self): | ||||
| return self.m_port_list_ids | return self.m_port_list_ids | ||||
| def setAsPlugin(self, plugin_id, hasUi): | |||||
| print("GOT CANVAS AS PLUGIN!!!") | |||||
| def setIcon(self, icon): | def setIcon(self, icon): | ||||
| if self.icon_svg: | if self.icon_svg: | ||||
| self.icon_svg.setIcon(icon, self.m_group_name) | self.icon_svg.setIcon(icon, self.m_group_name) | ||||