Signed-off-by: falkTX <falktx@falktx.com>tags/v2.2.0-RC1
@@ -639,6 +639,20 @@ class HostWindow(QMainWindow): | |||||
else: | else: | ||||
pitem.recreateWidget(newSkin = skin) | pitem.recreateWidget(newSkin = skin) | ||||
def findPluginInPatchbay(self, pluginId): | |||||
if pluginId > self.fPluginCount: | |||||
return | |||||
if self.fExternalPatchbay: | |||||
self.slot_canvasShowInternal() | |||||
if not patchcanvas.focusGroupUsingPluginId(pluginId): | |||||
name = self.host.get_plugin_info(pluginId)['name'] | |||||
if not patchcanvas.focusGroupUsingGroupName(name): | |||||
return | |||||
self.ui.tabWidget.setCurrentIndex(1) | |||||
def switchPlugins(self, pluginIdA, pluginIdB): | def switchPlugins(self, pluginIdA, pluginIdB): | ||||
if pluginIdA == pluginIdB: | if pluginIdA == pluginIdB: | ||||
return | return | ||||
@@ -1038,13 +1038,24 @@ class AbstractPluginSlot(QFrame, PluginEditParentMeta): | |||||
menu = QMenu(self) | menu = QMenu(self) | ||||
# ------------------------------------------------------------- | # ------------------------------------------------------------- | ||||
# Expand/Minimize | |||||
# Expand/Minimize and Tweaks | |||||
actCompact = menu.addAction(self.tr("Expand") if isinstance(self, PluginSlot_Compact) else self.tr("Minimize")) | actCompact = menu.addAction(self.tr("Expand") if isinstance(self, PluginSlot_Compact) else self.tr("Minimize")) | ||||
actColor = menu.addAction(self.tr("Change Color...")) | actColor = menu.addAction(self.tr("Change Color...")) | ||||
actSkin = menu.addAction(self.tr("Change Skin...")) | actSkin = menu.addAction(self.tr("Change Skin...")) | ||||
menu.addSeparator() | menu.addSeparator() | ||||
# ------------------------------------------------------------- | |||||
# Find in patchbay, if possible | |||||
if self.host.processMode in (ENGINE_PROCESS_MODE_MULTIPLE_CLIENTS, | |||||
ENGINE_PROCESS_MODE_PATCHBAY): | |||||
actFindInPatchbay = menu.addAction(self.tr("Find plugin in patchbay")) | |||||
menu.addSeparator() | |||||
else: | |||||
actFindInPatchbay = None | |||||
# ------------------------------------------------------------- | # ------------------------------------------------------------- | ||||
# Move up and down | # Move up and down | ||||
@@ -1169,6 +1180,12 @@ class AbstractPluginSlot(QFrame, PluginEditParentMeta): | |||||
return | return | ||||
gCarla.gui.changePluginSkin(self.fPluginId, skin[0]) | gCarla.gui.changePluginSkin(self.fPluginId, skin[0]) | ||||
# ------------------------------------------------------------- | |||||
# Find in patchbay | |||||
elif actSel == actFindInPatchbay: | |||||
gCarla.gui.findPluginInPatchbay(self.fPluginId) | |||||
# ------------------------------------------------------------- | # ------------------------------------------------------------- | ||||
# Move up and down | # Move up and down | ||||
@@ -698,6 +698,35 @@ def setGroupAsPlugin(group_id, plugin_id, hasUI, hasInlineDisplay): | |||||
# ------------------------------------------------------------------------------------------------------------ | # ------------------------------------------------------------------------------------------------------------ | ||||
def focusGroupUsingPluginId(plugin_id): | |||||
if canvas.debug: | |||||
print("PatchCanvas::focusGroupUsingPluginId(%i)" % (plugin_id,)) | |||||
if plugin_id < 0 or plugin_id >= MAX_PLUGIN_ID_ALLOWED: | |||||
return False | |||||
for group in canvas.group_list: | |||||
if group.plugin_id == plugin_id: | |||||
item = group.widgets[0] | |||||
canvas.scene.clearSelection() | |||||
canvas.scene.getView().centerOn(item) | |||||
item.setSelected(True) | |||||
return True | |||||
def focusGroupUsingGroupName(group_name): | |||||
if canvas.debug: | |||||
print("PatchCanvas::focusGroupUsingGroupName(%s)" % (group_name,)) | |||||
for group in canvas.group_list: | |||||
if group.group_name == group_name: | |||||
item = group.widgets[0] | |||||
canvas.scene.clearSelection() | |||||
canvas.scene.getView().centerOn(item) | |||||
item.setSelected(True) | |||||
return True | |||||
# ------------------------------------------------------------------------------------------------------------ | |||||
def addPort(group_id, port_id, port_name, port_mode, port_type, is_alternate=False): | def addPort(group_id, port_id, port_name, port_mode, port_type, is_alternate=False): | ||||
if canvas.debug: | if canvas.debug: | ||||
print("PatchCanvas::addPort(%i, %i, %s, %s, %s, %s)" % ( | print("PatchCanvas::addPort(%i, %i, %s, %s, %s, %s)" % ( | ||||
@@ -95,6 +95,9 @@ class PatchScene(QGraphicsScene): | |||||
def getScaleFactor(self): | def getScaleFactor(self): | ||||
return self.m_view.transform().m11() | return self.m_view.transform().m11() | ||||
def getView(self): | |||||
return self.m_view | |||||
def fixScaleFactor(self, transform=None): | def fixScaleFactor(self, transform=None): | ||||
fix, set_view = False, False | fix, set_view = False, False | ||||
if not transform: | if not transform: | ||||
@@ -262,8 +262,7 @@ class RackListWidget(QListWidget): | |||||
#return True | #return True | ||||
if MACOS and lfilename.endswith(".vst"): | if MACOS and lfilename.endswith(".vst"): | ||||
return True | return True | ||||
# TODO check vst3 supported feature | |||||
elif lfilename.endswith(".vst3"): | |||||
elif lfilename.endswith(".vst3") and ".vst3" in self.fSupportedExtensions: | |||||
return True | return True | ||||
elif os.path.isfile(filename): | elif os.path.isfile(filename): | ||||