Browse Source

Reintroduce plugin search for specific formats

Signed-off-by: falkTX <falktx@falktx.com>
main
falkTX 1 week ago
parent
commit
b212a55a01
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
3 changed files with 266 additions and 50 deletions
  1. +83
    -45
      source/frontend/pluginlist/pluginlistdialog.cpp
  2. +34
    -2
      source/frontend/pluginlist/pluginrefreshdialog.hpp
  3. +149
    -3
      source/frontend/pluginlist/pluginrefreshdialog.ui

+ 83
- 45
source/frontend/pluginlist/pluginlistdialog.cpp View File

@@ -1178,7 +1178,9 @@ void PluginListDialog::showEvent(QShowEvent* const event)
p->discovery.dialog->ch_updated->setChecked(true); p->discovery.dialog->ch_updated->setChecked(true);
p->discovery.dialog->ch_invalid->setChecked(false); p->discovery.dialog->ch_invalid->setChecked(false);
p->discovery.dialog->group->setEnabled(false); p->discovery.dialog->group->setEnabled(false);
p->discovery.dialog->group_formats->hide();
p->discovery.dialog->progressBar->setFormat("Starting initial discovery..."); p->discovery.dialog->progressBar->setFormat("Starting initial discovery...");
p->discovery.dialog->adjustSize();


QObject::connect(p->discovery.dialog->b_skip, &QPushButton::clicked, QObject::connect(p->discovery.dialog->b_skip, &QPushButton::clicked,
this, &PluginListDialog::refreshPluginsSkip); this, &PluginListDialog::refreshPluginsSkip);
@@ -1221,73 +1223,109 @@ void PluginListDialog::timerEvent(QTimerEvent* const event)
} }
[[fallthrough]]; [[fallthrough]];
case PLUGIN_INTERNAL: case PLUGIN_INTERNAL:
ui.label->setText(tr("Discovering LADSPA plugins..."));
path = p->paths.ladspa;
p->discovery.ptype = PLUGIN_LADSPA;
break;
if (p->discovery.dialog->ch_ladspa->isChecked() || !p->discovery.dialog->group_formats->isVisible())
{
ui.label->setText(tr("Discovering LADSPA plugins..."));
path = p->paths.ladspa;
p->discovery.ptype = PLUGIN_LADSPA;
break;
}
[[fallthrough]];
case PLUGIN_LADSPA: case PLUGIN_LADSPA:
ui.label->setText(tr("Discovering DSSI plugins..."));
path = p->paths.dssi;
p->discovery.ptype = PLUGIN_DSSI;
break;
if (p->discovery.dialog->ch_dssi->isChecked() || !p->discovery.dialog->group_formats->isVisible())
{
ui.label->setText(tr("Discovering DSSI plugins..."));
path = p->paths.dssi;
p->discovery.ptype = PLUGIN_DSSI;
break;
}
[[fallthrough]];
case PLUGIN_DSSI: case PLUGIN_DSSI:
#endif #endif
if (p->discovery.btype == BINARY_NATIVE && p->paths.lv2.isNotEmpty())
if (p->discovery.dialog->ch_lv2->isChecked() || !p->discovery.dialog->group_formats->isVisible())
{ {
ui.label->setText(tr("Discovering LV2 plugins..."));
path = p->paths.lv2;
p->discovery.ptype = PLUGIN_LV2;
break;
if (p->discovery.btype == BINARY_NATIVE && p->paths.lv2.isNotEmpty())
{
ui.label->setText(tr("Discovering LV2 plugins..."));
path = p->paths.lv2;
p->discovery.ptype = PLUGIN_LV2;
break;
}
} }
[[fallthrough]]; [[fallthrough]];
case PLUGIN_LV2: case PLUGIN_LV2:
ui.label->setText(tr("Discovering VST2 plugins..."));
path = p->paths.vst2;
p->discovery.ptype = PLUGIN_VST2;
break;
if (p->discovery.dialog->ch_vst2->isChecked() || !p->discovery.dialog->group_formats->isVisible())
{
ui.label->setText(tr("Discovering VST2 plugins..."));
path = p->paths.vst2;
p->discovery.ptype = PLUGIN_VST2;
break;
}
[[fallthrough]];
case PLUGIN_VST2: case PLUGIN_VST2:
ui.label->setText(tr("Discovering VST3 plugins..."));
path = p->paths.vst3;
p->discovery.ptype = PLUGIN_VST3;
break;
if (p->discovery.dialog->ch_vst3->isChecked() || !p->discovery.dialog->group_formats->isVisible())
{
ui.label->setText(tr("Discovering VST3 plugins..."));
path = p->paths.vst3;
p->discovery.ptype = PLUGIN_VST3;
break;
}
[[fallthrough]];
case PLUGIN_VST3: case PLUGIN_VST3:
ui.label->setText(tr("Discovering CLAP plugins..."));
path = p->paths.clap;
p->discovery.ptype = PLUGIN_CLAP;
break;
if (p->discovery.dialog->ch_clap->isChecked() || !p->discovery.dialog->group_formats->isVisible())
{
ui.label->setText(tr("Discovering CLAP plugins..."));
path = p->paths.clap;
p->discovery.ptype = PLUGIN_CLAP;
break;
}
[[fallthrough]];
case PLUGIN_CLAP: case PLUGIN_CLAP:
#ifdef CARLA_OS_MAC #ifdef CARLA_OS_MAC
ui.label->setText(tr("Discovering AU plugins..."));
path = p->paths.au;
p->discovery.ptype = PLUGIN_AU;
break;
if (p->discovery.dialog->ch_au->isChecked() || !p->discovery.dialog->group_formats->isVisible())
{
ui.label->setText(tr("Discovering AU plugins..."));
path = p->paths.au;
p->discovery.ptype = PLUGIN_AU;
break;
}
[[fallthrough]];
case PLUGIN_AU: case PLUGIN_AU:
#endif #endif
#ifndef CARLA_FRONTEND_ONLY_EMBEDDABLE_PLUGINS #ifndef CARLA_FRONTEND_ONLY_EMBEDDABLE_PLUGINS
if (p->discovery.btype == BINARY_NATIVE && p->paths.jsfx.isNotEmpty())
if (p->discovery.dialog->ch_jsfx->isChecked() || !p->discovery.dialog->group_formats->isVisible())
{ {
ui.label->setText(tr("Discovering JSFX plugins..."));
path = p->paths.jsfx;
p->discovery.ptype = PLUGIN_JSFX;
break;
if (p->discovery.btype == BINARY_NATIVE && p->paths.jsfx.isNotEmpty())
{
ui.label->setText(tr("Discovering JSFX plugins..."));
path = p->paths.jsfx;
p->discovery.ptype = PLUGIN_JSFX;
break;
}
} }
[[fallthrough]]; [[fallthrough]];
case PLUGIN_JSFX: case PLUGIN_JSFX:
if (p->discovery.btype == BINARY_NATIVE && p->paths.sf2.isNotEmpty())
if (p->discovery.dialog->ch_sf2->isChecked() || !p->discovery.dialog->group_formats->isVisible())
{ {
ui.label->setText(tr("Discovering SF2 kits..."));
path = p->paths.sf2;
p->discovery.ptype = PLUGIN_SF2;
break;
if (p->discovery.btype == BINARY_NATIVE && p->paths.sf2.isNotEmpty())
{
ui.label->setText(tr("Discovering SF2 kits..."));
path = p->paths.sf2;
p->discovery.ptype = PLUGIN_SF2;
break;
}
} }
[[fallthrough]]; [[fallthrough]];
case PLUGIN_SF2: case PLUGIN_SF2:
if (p->discovery.btype == BINARY_NATIVE && p->paths.sfz.isNotEmpty())
if (p->discovery.dialog->ch_sfz->isChecked() || !p->discovery.dialog->group_formats->isVisible())
{ {
ui.label->setText(tr("Discovering SFZ kits..."));
path = p->paths.sfz;
p->discovery.ptype = PLUGIN_SFZ;
break;
if (p->discovery.btype == BINARY_NATIVE && p->paths.sfz.isNotEmpty())
{
ui.label->setText(tr("Discovering SFZ kits..."));
path = p->paths.sfz;
p->discovery.ptype = PLUGIN_SFZ;
break;
}
} }
[[fallthrough]]; [[fallthrough]];
case PLUGIN_SFZ: case PLUGIN_SFZ:
@@ -1306,7 +1344,7 @@ void PluginListDialog::timerEvent(QTimerEvent* const event)
if (p->timerId == 0) if (p->timerId == 0)
break; break;


if (p->discovery.dialog)
if (p->discovery.dialog != nullptr)
p->discovery.dialog->progressBar->setFormat(ui.label->text()); p->discovery.dialog->progressBar->setFormat(ui.label->text());


p->discovery.handle = carla_plugin_discovery_start(p->discovery.tool.toUtf8().constData(), p->discovery.handle = carla_plugin_discovery_start(p->discovery.tool.toUtf8().constData(),


+ 34
- 2
source/frontend/pluginlist/pluginrefreshdialog.hpp View File

@@ -14,8 +14,11 @@
// Plugin Refresh Dialog // Plugin Refresh Dialog


struct PluginRefreshDialog : QDialog, Ui_PluginRefreshDialog { struct PluginRefreshDialog : QDialog, Ui_PluginRefreshDialog {
explicit PluginRefreshDialog(QWidget* const parent)
: QDialog(parent)
const bool _firstInit;

explicit PluginRefreshDialog(QWidget* const parent, bool firstInit = false)
: QDialog(parent),
_firstInit(firstInit)
{ {
setupUi(this); setupUi(this);


@@ -27,6 +30,9 @@ struct PluginRefreshDialog : QDialog, Ui_PluginRefreshDialog {
b_skip->setEnabled(false); b_skip->setEnabled(false);
ch_invalid->setEnabled(false); ch_invalid->setEnabled(false);


if (_firstInit)
return;

// ------------------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------------------
// Load settings // Load settings


@@ -41,6 +47,18 @@ struct PluginRefreshDialog : QDialog, Ui_PluginRefreshDialog {
ch_updated->setChecked(true); ch_updated->setChecked(true);


ch_invalid->setChecked(settings.valueBool("PluginRefreshDialog/CheckInvalid", false)); ch_invalid->setChecked(settings.valueBool("PluginRefreshDialog/CheckInvalid", false));

group_formats->setChecked(settings.valueBool("PluginRefreshDialog/RestrictFormats", false));
ch_ladspa->setChecked(settings.valueBool("PluginRefreshDialog/SearchLADSPA", true));
ch_dssi->setChecked(settings.valueBool("PluginRefreshDialog/SearchDSSI", true));
ch_lv2->setChecked(settings.valueBool("PluginRefreshDialog/SearchLV2", true));
ch_vst2->setChecked(settings.valueBool("PluginRefreshDialog/SearchVST2", true));
ch_vst3->setChecked(settings.valueBool("PluginRefreshDialog/SearchVST3", true));
ch_clap->setChecked(settings.valueBool("PluginRefreshDialog/SearchCLAP", true));
ch_au->setChecked(settings.valueBool("PluginRefreshDialog/SearchAU", true));
ch_jsfx->setChecked(settings.valueBool("PluginRefreshDialog/SearchJSFX", true));
ch_sf2->setChecked(settings.valueBool("PluginRefreshDialog/SearchSF2", true));
ch_sfz->setChecked(settings.valueBool("PluginRefreshDialog/SearchSFZ", true));
} }


// ------------------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------------------
@@ -55,10 +73,24 @@ struct PluginRefreshDialog : QDialog, Ui_PluginRefreshDialog {
private Q_SLOTS: private Q_SLOTS:
void saveSettings() void saveSettings()
{ {
if (_firstInit)
return;

QSafeSettings settings; QSafeSettings settings;
settings.setValue("PluginRefreshDialog/Geometry", saveGeometry()); settings.setValue("PluginRefreshDialog/Geometry", saveGeometry());
settings.setValue("PluginRefreshDialog/RefreshAll", ch_all->isChecked()); settings.setValue("PluginRefreshDialog/RefreshAll", ch_all->isChecked());
settings.setValue("PluginRefreshDialog/CheckInvalid", ch_invalid->isChecked()); settings.setValue("PluginRefreshDialog/CheckInvalid", ch_invalid->isChecked());
settings.setValue("PluginRefreshDialog/RestrictFormats", group_formats->isChecked());
settings.setValue("PluginRefreshDialog/SearchLADSPA", ch_ladspa->isChecked());
settings.setValue("PluginRefreshDialog/SearchDSSI", ch_dssi->isChecked());
settings.setValue("PluginRefreshDialog/SearchLV2", ch_lv2->isChecked());
settings.setValue("PluginRefreshDialog/SearchVST2", ch_vst2->isChecked());
settings.setValue("PluginRefreshDialog/SearchVST3", ch_vst3->isChecked());
settings.setValue("PluginRefreshDialog/SearchCLAP", ch_clap->isChecked());
settings.setValue("PluginRefreshDialog/SearchAU", ch_au->isChecked());
settings.setValue("PluginRefreshDialog/SearchJSFX", ch_jsfx->isChecked());
settings.setValue("PluginRefreshDialog/SearchSF2", ch_sf2->isChecked());
settings.setValue("PluginRefreshDialog/SearchSFZ", ch_sfz->isChecked());
} }
}; };




+ 149
- 3
source/frontend/pluginlist/pluginrefreshdialog.ui View File

@@ -6,14 +6,14 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>873</width>
<height>179</height>
<width>375</width>
<height>430</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>Plugin Refresh</string> <string>Plugin Refresh</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_5">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_3"> <layout class="QHBoxLayout" name="horizontalLayout_3">
<item> <item>
@@ -100,6 +100,152 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item>
<widget class="QGroupBox" name="group_formats">
<property name="title">
<string>Restrict search formats</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="3">
<widget class="QCheckBox" name="ch_jsfx">
<property name="text">
<string>JSFX</string>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QCheckBox" name="ch_au">
<property name="text">
<string>AU</string>
</property>
</widget>
</item>
<item row="0" column="4">
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>120</width>
<height>1</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="3">
<widget class="QCheckBox" name="ch_sf2">
<property name="text">
<string>SF2/3</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="ch_dssi">
<property name="text">
<string>DSSI</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QCheckBox" name="ch_clap">
<property name="text">
<string>CLAP</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="ch_lv2">
<property name="text">
<string>LV2</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QCheckBox" name="ch_vst3">
<property name="text">
<string>VST3</string>
</property>
</widget>
</item>
<item row="0" column="0">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>120</width>
<height>1</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="ch_ladspa">
<property name="text">
<string>LADSPA</string>
</property>
</widget>
</item>
<item row="2" column="3">
<widget class="QCheckBox" name="ch_sfz">
<property name="text">
<string>SFZ</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QCheckBox" name="ch_vst2">
<property name="text">
<string>VST2</string>
</property>
</widget>
</item>
<item row="0" column="2">
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>120</width>
<height>1</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout">
<item> <item>


Loading…
Cancel
Save