Browse Source

Add "Find plugin in patchbay" right-click option

Signed-off-by: falkTX <falktx@falktx.com>
tags/v2.2.0-RC1
falkTX 4 years ago
parent
commit
c986c86860
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
5 changed files with 65 additions and 3 deletions
  1. +14
    -0
      source/frontend/carla_host.py
  2. +18
    -1
      source/frontend/carla_skin.py
  3. +29
    -0
      source/frontend/patchcanvas/patchcanvas.py
  4. +3
    -0
      source/frontend/patchcanvas/scene.py
  5. +1
    -2
      source/frontend/widgets/racklistwidget.py

+ 14
- 0
source/frontend/carla_host.py View File

@@ -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


+ 18
- 1
source/frontend/carla_skin.py View File

@@ -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




+ 29
- 0
source/frontend/patchcanvas/patchcanvas.py View File

@@ -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)" % (


+ 3
- 0
source/frontend/patchcanvas/scene.py View File

@@ -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:


+ 1
- 2
source/frontend/widgets/racklistwidget.py View File

@@ -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):


Loading…
Cancel
Save