Browse Source

Initial go at category filters

Signed-off-by: falkTX <falktx@falktx.com>
tags/v2.2.0-RC1
falkTX 4 years ago
parent
commit
674bfedf6e
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
3 changed files with 439 additions and 208 deletions
  1. +292
    -202
      resources/ui/carla_database.ui
  2. +122
    -6
      source/frontend/carla_database.py
  3. +25
    -0
      source/frontend/carla_utils.py

+ 292
- 202
resources/ui/carla_database.ui View File

@@ -14,202 +14,6 @@
<string>Carla - Add New</string>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="1" column="0">
<widget class="QToolBox" name="toolBox">
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="p_format">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>164</width>
<height>254</height>
</rect>
</property>
<attribute name="label">
<string>Format</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QCheckBox" name="ch_internal">
<property name="text">
<string>Internal</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="ch_ladspa">
<property name="text">
<string>LADSPA</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="ch_dssi">
<property name="text">
<string>DSSI</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="ch_lv2">
<property name="text">
<string>LV2</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="ch_vst">
<property name="text">
<string>VST2</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="ch_vst3">
<property name="text">
<string>VST3</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="ch_au">
<property name="text">
<string>AU</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="ch_kits">
<property name="text">
<string>Sound Kits</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_5">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="p_type">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>164</width>
<height>164</height>
</rect>
</property>
<attribute name="label">
<string>Type</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QCheckBox" name="ch_effects">
<property name="text">
<string>Effects</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="ch_instruments">
<property name="text">
<string>Instruments</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="ch_midi">
<property name="text">
<string>MIDI Plugins</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="ch_other">
<property name="text">
<string>Other/Misc</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="p_arch">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>164</width>
<height>136</height>
</rect>
</property>
<attribute name="label">
<string>Architecture</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QCheckBox" name="ch_native">
<property name="text">
<string>Native</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="ch_bridged">
<property name="text">
<string>Bridged</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="ch_bridged_wine">
<property name="text">
<string>Bridged (Wine)</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
</item>
<item row="2" column="0">
<spacer name="verticalSpacer_6">
<property name="orientation">
@@ -231,7 +35,7 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="tabBarAutoHide">
<property name="tabBarAutoHide" stdset="0">
<bool>true</bool>
</property>
<widget class="QWidget" name="tw_reqs">
@@ -351,7 +155,7 @@
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLineEdit" name="lineEdit">
<property name="clearButtonEnabled">
<property name="clearButtonEnabled" stdset="0">
<bool>true</bool>
</property>
</widget>
@@ -382,7 +186,7 @@
</item>
<item row="1" column="2" rowspan="3">
<widget class="QTabWidget" name="tab_info">
<property name="tabBarAutoHide">
<property name="tabBarAutoHide" stdset="0">
<bool>true</bool>
</property>
<widget class="QWidget" name="tw_info">
@@ -778,12 +582,12 @@
<attribute name="verticalHeaderVisible">
<bool>false</bool>
</attribute>
<attribute name="verticalHeaderMinimumSectionSize">
<number>12</number>
</attribute>
<attribute name="verticalHeaderDefaultSectionSize">
<number>22</number>
</attribute>
<attribute name="verticalHeaderMinimumSectionSize">
<number>12</number>
</attribute>
<column>
<property name="text">
<string notr="true"/>
@@ -821,6 +625,292 @@
</column>
</widget>
</item>
<item row="1" column="0">
<widget class="QToolBox" name="toolBox">
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="p_format">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>158</width>
<height>237</height>
</rect>
</property>
<attribute name="label">
<string>Format</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QCheckBox" name="ch_internal">
<property name="text">
<string>Internal</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="ch_ladspa">
<property name="text">
<string>LADSPA</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="ch_dssi">
<property name="text">
<string>DSSI</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="ch_lv2">
<property name="text">
<string>LV2</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="ch_vst">
<property name="text">
<string>VST2</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="ch_vst3">
<property name="text">
<string>VST3</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="ch_au">
<property name="text">
<string>AU</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="ch_kits">
<property name="text">
<string>Sound Kits</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_5">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="p_type">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>158</width>
<height>156</height>
</rect>
</property>
<attribute name="label">
<string>Type</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QCheckBox" name="ch_effects">
<property name="text">
<string>Effects</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="ch_instruments">
<property name="text">
<string>Instruments</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="ch_midi">
<property name="text">
<string>MIDI Plugins</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="ch_other">
<property name="text">
<string>Other/Misc</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="p_category">
<attribute name="label">
<string>Category</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QCheckBox" name="ch_cat_all">
<property name="text">
<string>All</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="ch_cat_delay">
<property name="text">
<string>Delay</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="ch_cat_distortion">
<property name="text">
<string>Distortion</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="ch_cat_dynamics">
<property name="text">
<string>Dynamics</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="ch_cat_eq">
<property name="text">
<string>EQ</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="ch_cat_filter">
<property name="text">
<string>Filter</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="ch_cat_modulator">
<property name="text">
<string>Modulator</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="ch_cat_synth">
<property name="text">
<string>Synth</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="ch_cat_utility">
<property name="text">
<string>Utility</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="ch_cat_other">
<property name="text">
<string>Other</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_7">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>23</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="p_arch">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>158</width>
<height>130</height>
</rect>
</property>
<attribute name="label">
<string>Architecture</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QCheckBox" name="ch_native">
<property name="text">
<string>Native</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="ch_bridged">
<property name="text">
<string>Bridged</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="ch_bridged_wine">
<property name="text">
<string>Bridged (Wine)</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
<action name="act_focus_search">
<property name="text">


+ 122
- 6
source/frontend/carla_database.py View File

@@ -34,7 +34,7 @@ import ui_carla_database
import ui_carla_refresh

from carla_shared import *
from carla_utils import getPluginTypeAsString
from carla_utils import getPluginTypeAsString, getPluginCategoryAsString

# ---------------------------------------------------------------------------------------------------------------------
# Try Import LADSPA-RDF
@@ -134,7 +134,7 @@ def findFilenames(filePath, stype):
# ---------------------------------------------------------------------------------------------------------------------
# Plugin Query

PLUGIN_QUERY_API_VERSION = 11
PLUGIN_QUERY_API_VERSION = 12

PyPluginInfo = {
'API': PLUGIN_QUERY_API_VERSION,
@@ -142,6 +142,7 @@ PyPluginInfo = {
'build': BINARY_NONE,
'type': PLUGIN_NONE,
'hints': 0x0,
'category': "",
'filename': "",
'name': "",
'label': "",
@@ -280,6 +281,8 @@ def runCarlaDiscovery(itype, stype, filename, tool, wineSettings=None):
pinfo['label'] = value if value else fakeLabel
elif prop == "maker":
pinfo['maker'] = value
elif prop == "category":
pinfo['category'] = value
elif prop == "uniqueId":
if value.isdigit(): pinfo['uniqueId'] = int(value)
elif prop == "hints":
@@ -332,6 +335,7 @@ def checkPluginCached(desc, ptype):
pinfo['name'] = desc['name']
pinfo['label'] = desc['label']
pinfo['maker'] = desc['maker']
pinfo['category'] = getPluginCategoryAsString(desc['category'])

pinfo['audio.ins'] = desc['audioIns']
pinfo['audio.outs'] = desc['audioOuts']
@@ -456,7 +460,7 @@ class SearchPluginsThread(QThread):
self.fContinueChecking = False

def run(self):
settingsDB = QSafeSettings("falkTX", "CarlaPlugins4")
settingsDB = QSafeSettings("falkTX", "CarlaPlugins5")

self.fContinueChecking = True
self.fCurCount = 0
@@ -1452,7 +1456,7 @@ class PluginDatabaseW(QDialog):
if (WINDOWS and not kIs64bit) or not host.showPluginBridges:
self.ui.ch_native.setChecked(True)
self.ui.ch_native.setEnabled(False)
self.ui.ch_native.setVisible(False)
self.ui.ch_native.setVisible(True)
self.ui.ch_bridged.setChecked(False)
self.ui.ch_bridged.setEnabled(False)
self.ui.ch_bridged.setVisible(False)
@@ -1500,6 +1504,16 @@ class PluginDatabaseW(QDialog):
self.ui.ch_gui.clicked.connect(self.slot_checkFilters)
self.ui.ch_inline_display.clicked.connect(self.slot_checkFilters)
self.ui.ch_stereo.clicked.connect(self.slot_checkFilters)
self.ui.ch_cat_all.clicked.connect(self.slot_checkFiltersCategoryAll)
self.ui.ch_cat_delay.clicked.connect(self.slot_checkFiltersCategorySpecific)
self.ui.ch_cat_distortion.clicked.connect(self.slot_checkFiltersCategorySpecific)
self.ui.ch_cat_dynamics.clicked.connect(self.slot_checkFiltersCategorySpecific)
self.ui.ch_cat_eq.clicked.connect(self.slot_checkFiltersCategorySpecific)
self.ui.ch_cat_filter.clicked.connect(self.slot_checkFiltersCategorySpecific)
self.ui.ch_cat_modulator.clicked.connect(self.slot_checkFiltersCategorySpecific)
self.ui.ch_cat_synth.clicked.connect(self.slot_checkFiltersCategorySpecific)
self.ui.ch_cat_utility.clicked.connect(self.slot_checkFiltersCategorySpecific)
self.ui.ch_cat_other.clicked.connect(self.slot_checkFiltersCategorySpecific)

# ----------------------------------------------------------------------------------------------------
# Post-connect setup
@@ -1617,6 +1631,35 @@ class PluginDatabaseW(QDialog):
def slot_checkFilters(self):
self._checkFilters()

@pyqtSlot(bool)
def slot_checkFiltersCategoryAll(self, clicked):
self.ui.ch_cat_delay.setChecked(not clicked)
self.ui.ch_cat_distortion.setChecked(not clicked)
self.ui.ch_cat_dynamics.setChecked(not clicked)
self.ui.ch_cat_eq.setChecked(not clicked)
self.ui.ch_cat_filter.setChecked(not clicked)
self.ui.ch_cat_modulator.setChecked(not clicked)
self.ui.ch_cat_synth.setChecked(not clicked)
self.ui.ch_cat_utility.setChecked(not clicked)
self.ui.ch_cat_other.setChecked(not clicked)
self._checkFilters()

@pyqtSlot(bool)
def slot_checkFiltersCategorySpecific(self, clicked):
if clicked:
self.ui.ch_cat_all.setChecked(False)
elif not (self.ui.ch_cat_delay.isChecked() or
self.ui.ch_cat_distortion.isChecked() or
self.ui.ch_cat_dynamics.isChecked() or
self.ui.ch_cat_eq.isChecked() or
self.ui.ch_cat_filter.isChecked() or
self.ui.ch_cat_modulator.isChecked() or
self.ui.ch_cat_synth.isChecked() or
self.ui.ch_cat_utility.isChecked() or
self.ui.ch_cat_other.isChecked()):
self.ui.ch_cat_all.setChecked(True)
self._checkFilters()

@pyqtSlot()
def slot_refreshPlugins(self):
if PluginRefreshW(self, self.host).exec_():
@@ -1657,6 +1700,17 @@ class PluginDatabaseW(QDialog):
if self.ui.ch_au.isEnabled():
self.ui.ch_au.setChecked(True)

self.ui.ch_cat_all.setChecked(True)
self.ui.ch_cat_delay.setChecked(False)
self.ui.ch_cat_distortion.setChecked(False)
self.ui.ch_cat_dynamics.setChecked(False)
self.ui.ch_cat_eq.setChecked(False)
self.ui.ch_cat_filter.setChecked(False)
self.ui.ch_cat_modulator.setChecked(False)
self.ui.ch_cat_synth.setChecked(False)
self.ui.ch_cat_utility.setChecked(False)
self.ui.ch_cat_other.setChecked(False)

self.ui.lineEdit.clear()

self.blockSignals(False)
@@ -1693,6 +1747,32 @@ class PluginDatabaseW(QDialog):
settings.setValue("PluginDatabase/ShowStereoOnly", self.ui.ch_stereo.isChecked())
settings.setValue("PluginDatabase/SearchText", self.ui.lineEdit.text())

if self.ui.ch_cat_all.isChecked():
settings.setValue("PluginDatabase/ShowCategory", "all")
else:
categoryhash = ""
if self.ui.ch_cat_delay.isChecked():
categoryhash += ":delay"
if self.ui.ch_cat_distortion.isChecked():
categoryhash += ":distortion"
if self.ui.ch_cat_dynamics.isChecked():
categoryhash += ":dynamics"
if self.ui.ch_cat_eq.isChecked():
categoryhash += ":eq"
if self.ui.ch_cat_filter.isChecked():
categoryhash += ":filter"
if self.ui.ch_cat_modulator.isChecked():
categoryhash += ":modulator"
if self.ui.ch_cat_synth.isChecked():
categoryhash += ":synth"
if self.ui.ch_cat_utility.isChecked():
categoryhash += ":utility"
if self.ui.ch_cat_other.isChecked():
categoryhash += ":other"
if categoryhash:
categoryhash += ":"
settings.setValue("PluginDatabase/ShowCategory", categoryhash)

if self.fFavoritePluginsChanged:
settings.setValue("PluginDatabase/Favorites", self.fFavoritePlugins)

@@ -1727,6 +1807,30 @@ class PluginDatabaseW(QDialog):
self.ui.ch_stereo.setChecked(settings.value("PluginDatabase/ShowStereoOnly", False, bool))
self.ui.lineEdit.setText(settings.value("PluginDatabase/SearchText", "", str))

categoryhash = settings.value("PluginDatabase/ShowCategory", "all", str)
if categoryhash == "all" or len(categoryhash) < 2:
self.ui.ch_cat_all.setChecked(True)
self.ui.ch_cat_delay.setChecked(False)
self.ui.ch_cat_distortion.setChecked(False)
self.ui.ch_cat_dynamics.setChecked(False)
self.ui.ch_cat_eq.setChecked(False)
self.ui.ch_cat_filter.setChecked(False)
self.ui.ch_cat_modulator.setChecked(False)
self.ui.ch_cat_synth.setChecked(False)
self.ui.ch_cat_utility.setChecked(False)
self.ui.ch_cat_other.setChecked(False)
else:
self.ui.ch_cat_all.setChecked(False)
self.ui.ch_cat_delay.setChecked(":delay:" in categoryhash)
self.ui.ch_cat_distortion.setChecked(":distortion:" in categoryhash)
self.ui.ch_cat_dynamics.setChecked(":dynamics:" in categoryhash)
self.ui.ch_cat_eq.setChecked(":eq:" in categoryhash)
self.ui.ch_cat_filter.setChecked(":filter:" in categoryhash)
self.ui.ch_cat_modulator.setChecked(":modulator:" in categoryhash)
self.ui.ch_cat_synth.setChecked(":synth:" in categoryhash)
self.ui.ch_cat_utility.setChecked(":utility:" in categoryhash)
self.ui.ch_cat_other.setChecked(":other:" in categoryhash)

tableGeometry = settings.value("PluginDatabase/TableGeometry_6", QByteArray(), QByteArray)
horizontalHeader = self.ui.tableWidget.horizontalHeader()
if not tableGeometry.isNull():
@@ -1802,6 +1906,7 @@ class PluginDatabaseW(QDialog):
mOuts = plugin['midi.outs']
phints = plugin['hints']
ptype = plugin['type']
categ = plugin['category']
isSynth = bool(phints & PLUGIN_IS_SYNTH)
isEffect = bool(aIns > 0 < aOuts and not isSynth)
isMidi = bool(aIns == 0 and aOuts == 0 and mIns > 0 < mOuts)
@@ -1861,8 +1966,19 @@ class PluginDatabaseW(QDialog):
self.ui.tableWidget.hideRow(i)
elif hideNonFavs and self._createFavoritePluginDict(plugin) not in self.fFavoritePlugins:
self.ui.tableWidget.hideRow(i)
else:
elif (self.ui.ch_cat_all.isChecked() or
(self.ui.ch_cat_delay.isChecked() and categ == "delay") or
(self.ui.ch_cat_distortion.isChecked() and categ == "distortion") or
(self.ui.ch_cat_dynamics.isChecked() and categ == "dynamics") or
(self.ui.ch_cat_eq.isChecked() and categ == "eq") or
(self.ui.ch_cat_filter.isChecked() and categ == "filter") or
(self.ui.ch_cat_modulator.isChecked() and categ == "modulator") or
(self.ui.ch_cat_synth.isChecked() and categ == "synth") or
(self.ui.ch_cat_utility.isChecked() and categ == "utility") or
(self.ui.ch_cat_other.isChecked() and categ == "other")):
self.ui.tableWidget.showRow(i)
else:
self.ui.tableWidget.hideRow(i)

# --------------------------------------------------------------------------------------------------------

@@ -1952,7 +2068,7 @@ class PluginDatabaseW(QDialog):
return pluginCount

def _reAddPlugins(self):
settingsDB = QSafeSettings("falkTX", "CarlaPlugins4")
settingsDB = QSafeSettings("falkTX", "CarlaPlugins5")

for x in range(self.ui.tableWidget.rowCount()):
self.ui.tableWidget.removeRow(0)


+ 25
- 0
source/frontend/carla_utils.py View File

@@ -88,6 +88,31 @@ def getPluginTypeFromString(stype):
print("getPluginTypeFromString(\"%s\") - invalid string type" % stype)
return PLUGIN_NONE

def getPluginCategoryAsString(category):
if category == PLUGIN_CATEGORY_NONE:
return "none"
if category == PLUGIN_CATEGORY_SYNTH:
return "synth"
if category == PLUGIN_CATEGORY_DELAY:
return "delay"
if category == PLUGIN_CATEGORY_EQ:
return "eq"
if category == PLUGIN_CATEGORY_FILTER:
return "filter"
if category == PLUGIN_CATEGORY_DISTORTION:
return "distortion"
if category == PLUGIN_CATEGORY_DYNAMICS:
return "dynamics"
if category == PLUGIN_CATEGORY_MODULATOR:
return "modulator"
if category == PLUGIN_CATEGORY_UTILITY:
return "utility"
if category == PLUGIN_CATEGORY_OTHER:
return "other"

print("CarlaBackend::getPluginCategoryAsString(%i) - invalid category" % category)
return "NONE"

# ------------------------------------------------------------------------------------------------------------
# Carla Utils API (C stuff)



Loading…
Cancel
Save