Browse Source

Copy python code to C++, commented out, fill out some more details

Signed-off-by: falkTX <falktx@falktx.com>
pull/1775/head
falkTX 1 year ago
parent
commit
9d6ae34a9c
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
8 changed files with 629 additions and 282 deletions
  1. +9
    -8
      source/frontend/CarlaFrontend.h
  2. +4
    -0
      source/frontend/Makefile
  3. +2
    -1
      source/frontend/dialogs/jackappdialog.cpp
  4. +577
    -241
      source/frontend/pluginlist/pluginlistdialog.cpp
  5. +2
    -5
      source/frontend/pluginlist/pluginlistdialog.hpp
  6. +25
    -25
      source/frontend/pluginlist/pluginlistdialog.py
  7. +2
    -2
      source/frontend/pluginlist/pluginlistrefreshdialog.cpp
  8. +8
    -0
      source/frontend/test.cpp

+ 9
- 8
source/frontend/CarlaFrontend.h View File

@@ -17,7 +17,7 @@

#pragma once

#include "CarlaDefines.h"
#include "CarlaBackend.h"

#ifdef __cplusplus
extern "C" {
@@ -58,16 +58,17 @@ typedef struct {

// --------------------------------------------------------------------------------------------------------------------

CARLA_API
void carla_frontend_createAndExecAboutJuceDialog(void* parent);
CARLA_API void
carla_frontend_createAndExecAboutJuceDialog(void* parent);

CARLA_API JackAppDialogResults* carla_frontend_createAndExecJackAppDialog(void* parent, const char* projectFilename);
CARLA_API const JackAppDialogResults*
carla_frontend_createAndExecJackAppDialog(void* parent, const char* projectFilename);

CARLA_API
PluginListDialogResults* carla_frontend_createAndExecPluginListDialog(void* parent/*, const HostSettings& hostSettings*/);
CARLA_API const PluginListDialogResults*
carla_frontend_createAndExecPluginListDialog(void* parent/*, const HostSettings& hostSettings*/);

CARLA_API
PluginListRefreshDialogResults* carla_frontend_createAndExecPluginListRefreshDialog(void* parent, bool useSystemIcons);
CARLA_API const PluginListRefreshDialogResults*
carla_frontend_createAndExecPluginListRefreshDialog(void* parent, bool useSystemIcons);

// --------------------------------------------------------------------------------------------------------------------



+ 4
- 0
source/frontend/Makefile View File

@@ -180,6 +180,10 @@ ui_%.py: $(RESDIR)/ui/%.ui
resources_rc.py: $(RESDIR)/resources.qrc $(RESDIR)/*/*.png $(RESDIR)/*/*.svg $(RESDIR)/*/*.svgz
$(PYRCC) $< -o $@

test: $(OBJS) $(LIBS) test.cpp
@echo "Linking test"
$(SILENT)$(CXX) $(OBJS) test.cpp $(BUILD_CXX_FLAGS) -Wl,-rpath,$(abspath $(BINDIR)) $(QT5_LINK_FLAGS) -o $@

$(BINDIR)/resources/%: %
-@mkdir -p $(BINDIR)/resources
$(LINK) $(CURDIR)/$* $(BINDIR)/resources/


+ 2
- 1
source/frontend/dialogs/jackappdialog.cpp View File

@@ -249,7 +249,8 @@ void JackAppDialog::slot_saveSettings()

// --------------------------------------------------------------------------------------------------------------------

JackAppDialogResults* carla_frontend_createAndExecJackAppDialog(void* const parent, const char* const projectFilename)
const JackAppDialogResults*
carla_frontend_createAndExecJackAppDialog(void* const parent, const char* const projectFilename)
{
JackAppDialog gui(reinterpret_cast<QWidget*>(parent), projectFilename);



+ 577
- 241
source/frontend/pluginlist/pluginlistdialog.cpp
File diff suppressed because it is too large
View File


+ 2
- 5
source/frontend/pluginlist/pluginlistdialog.hpp View File

@@ -67,7 +67,7 @@ struct PluginInfo {
};

// --------------------------------------------------------------------------------------------------------------------
// Jack Application Dialog
// Plugin List Dialog

class PluginListDialog : public QDialog
{
@@ -80,9 +80,6 @@ public:
explicit PluginListDialog(QWidget* parent, const HostSettings& hostSettings);
~PluginListDialog() override;

// ----------------------------------------------------------------------------------------------------------------
// public methods

// ----------------------------------------------------------------------------------------------------------------
// protected methods

@@ -97,7 +94,7 @@ protected:
// ----------------------------------------------------------------------------------------------------------------
// private slots

private slots:
private Q_SLOTS:
void slot_cellClicked(int row, int column);
void slot_cellDoubleClicked(int row, int column);
void slot_focusSearchFieldAndSelectAll();


+ 25
- 25
source/frontend/pluginlist/pluginlistdialog.py View File

@@ -104,7 +104,7 @@ class PluginListDialog(QDialog):
self.fRealParent = parent
self.fFavoritePlugins = []
self.fFavoritePluginsChanged = False
self.fUseSystemIcons = useSystemIcons
self.fUseSystemIcons = useSystemIcons # TODO cpp

self.fTrYes = self.tr("Yes")
self.fTrNo = self.tr("No")
@@ -468,28 +468,28 @@ class PluginListDialog(QDialog):
if self.ui.ch_cat_all.isChecked():
settings.setValue("PluginDatabase/ShowCategory", "all")
else:
categoryhash = ""
categories = ""
if self.ui.ch_cat_delay.isChecked():
categoryhash += ":delay"
categories += ":delay"
if self.ui.ch_cat_distortion.isChecked():
categoryhash += ":distortion"
categories += ":distortion"
if self.ui.ch_cat_dynamics.isChecked():
categoryhash += ":dynamics"
categories += ":dynamics"
if self.ui.ch_cat_eq.isChecked():
categoryhash += ":eq"
categories += ":eq"
if self.ui.ch_cat_filter.isChecked():
categoryhash += ":filter"
categories += ":filter"
if self.ui.ch_cat_modulator.isChecked():
categoryhash += ":modulator"
categories += ":modulator"
if self.ui.ch_cat_synth.isChecked():
categoryhash += ":synth"
categories += ":synth"
if self.ui.ch_cat_utility.isChecked():
categoryhash += ":utility"
categories += ":utility"
if self.ui.ch_cat_other.isChecked():
categoryhash += ":other"
if categoryhash:
categoryhash += ":"
settings.setValue("PluginDatabase/ShowCategory", categoryhash)
categories += ":other"
if categories:
categories += ":"
settings.setValue("PluginDatabase/ShowCategory", categories)

if self.fFavoritePluginsChanged:
settings.setValue("PluginDatabase/Favorites", self.fFavoritePlugins)
@@ -527,8 +527,8 @@ class PluginListDialog(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:
categories = settings.value("PluginDatabase/ShowCategory", "all", str)
if categories == "all" or len(categories) < 2:
self.ui.ch_cat_all.setChecked(True)
self.ui.ch_cat_delay.setChecked(False)
self.ui.ch_cat_distortion.setChecked(False)
@@ -541,15 +541,15 @@ class PluginListDialog(QDialog):
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)
self.ui.ch_cat_delay.setChecked(":delay:" in categories)
self.ui.ch_cat_distortion.setChecked(":distortion:" in categories)
self.ui.ch_cat_dynamics.setChecked(":dynamics:" in categories)
self.ui.ch_cat_eq.setChecked(":eq:" in categories)
self.ui.ch_cat_filter.setChecked(":filter:" in categories)
self.ui.ch_cat_modulator.setChecked(":modulator:" in categories)
self.ui.ch_cat_synth.setChecked(":synth:" in categories)
self.ui.ch_cat_utility.setChecked(":utility:" in categories)
self.ui.ch_cat_other.setChecked(":other:" in categories)

tableGeometry = settings.value("PluginDatabase/TableGeometry_6", QByteArray(), QByteArray)
horizontalHeader = self.ui.tableWidget.horizontalHeader()


+ 2
- 2
source/frontend/pluginlist/pluginlistrefreshdialog.cpp View File

@@ -572,8 +572,8 @@ void PluginListRefreshDialog::slot_handlePluginThreadFinished()

// --------------------------------------------------------------------------------------------------------------------

PluginListRefreshDialogResults* carla_frontend_createAndExecPluginListRefreshDialog(void* const parent,
const bool useSystemIcons)
const PluginListRefreshDialogResults*
carla_frontend_createAndExecPluginListRefreshDialog(void* const parent, const bool useSystemIcons)
{
PluginListRefreshDialog gui(reinterpret_cast<QWidget*>(parent), useSystemIcons);



+ 8
- 0
source/frontend/test.cpp View File

@@ -0,0 +1,8 @@
#include "CarlaFrontend.h"
#include <QApplication>

int main(int argc, char* argv[])
{
QApplication app(argc, argv);
carla_frontend_createAndExecPluginListDialog(nullptr);
}

Loading…
Cancel
Save