From 680c46c15335caa38d4db753c50f8cf8c0778b40 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 23 Oct 2022 20:53:12 +0100 Subject: [PATCH] A few more C++ frontend details, stub for plugin list dialog Signed-off-by: falkTX --- bin/carla.lv2/resources | 1 - source/frontend/Makefile | 3 +- source/frontend/carla_frontend.py | 32 ++++-- source/frontend/carla_host.py | 15 ++- source/frontend/dialogs/.kdev_include_paths | 6 + source/frontend/dialogs/__init__.py | 4 +- source/frontend/dialogs/aboutjucedialog.cpp | 10 +- source/frontend/dialogs/aboutjucedialog.hpp | 10 +- source/frontend/dialogs/aboutjucedialog.py | 4 +- source/frontend/dialogs/jackappdialog.cpp | 34 +++--- source/frontend/dialogs/jackappdialog.hpp | 12 +- source/frontend/dialogs/jackappdialog.py | 4 +- .../frontend/pluginlist/.kdev_include_paths | 6 + source/frontend/pluginlist/__init__.py | 2 +- .../frontend/pluginlist/pluginlistdialog.cpp | 108 ++++++++++++++++++ .../frontend/pluginlist/pluginlistdialog.hpp | 80 +++++++++++++ .../frontend/pluginlist/pluginlistdialog.py | 8 +- .../frontend/pluginlist/pluginlistdialog.ui | 4 +- 18 files changed, 283 insertions(+), 60 deletions(-) delete mode 120000 bin/carla.lv2/resources create mode 100644 source/frontend/dialogs/.kdev_include_paths create mode 100644 source/frontend/pluginlist/.kdev_include_paths create mode 100644 source/frontend/pluginlist/pluginlistdialog.cpp create mode 100644 source/frontend/pluginlist/pluginlistdialog.hpp diff --git a/bin/carla.lv2/resources b/bin/carla.lv2/resources deleted file mode 120000 index 35a4f7acc..000000000 --- a/bin/carla.lv2/resources +++ /dev/null @@ -1 +0,0 @@ -../resources \ No newline at end of file diff --git a/source/frontend/Makefile b/source/frontend/Makefile index 269157333..7e0fddf72 100644 --- a/source/frontend/Makefile +++ b/source/frontend/Makefile @@ -68,7 +68,8 @@ QMs = $(patsubst %,translations/carla_%.qm,$(I18N_LANGUAGES)) CPP_FILES = \ carla_frontend.cpp \ dialogs/aboutjucedialog.cpp \ - dialogs/jackappdialog.cpp + dialogs/jackappdialog.cpp \ + pluginlist/pluginlistdialog.cpp OBJS = $(CPP_FILES:%=$(OBJDIR)/%.o) diff --git a/source/frontend/carla_frontend.py b/source/frontend/carla_frontend.py index 6a8017ab1..4cc42c8e5 100644 --- a/source/frontend/carla_frontend.py +++ b/source/frontend/carla_frontend.py @@ -23,7 +23,7 @@ # Imports (ctypes) from ctypes import ( - c_char_p, c_void_p, cast, + c_bool, c_char_p, c_int, c_void_p, cast, cdll, Structure, POINTER ) @@ -53,6 +53,14 @@ class JackApplicationDialogResults(Structure): ("labelSetup", c_char_p) ] +class PluginListDialogResults(Structure): + _fields_ = [ + ("btype", c_int), + ("ptype", c_int), + ("binary", c_char_p), + ("label", c_char_p) + ] + # ------------------------------------------------------------------------------------------------------------ # Carla Frontend object using a DLL @@ -60,18 +68,24 @@ class CarlaFrontendLib(): def __init__(self, filename): self.lib = cdll.LoadLibrary(filename) - self.lib.carla_frontend_createAndExecAboutJuceW.argtypes = (c_void_p,) - self.lib.carla_frontend_createAndExecAboutJuceW.restype = None + self.lib.carla_frontend_createAndExecAboutJuceDialog.argtypes = (c_void_p,) + self.lib.carla_frontend_createAndExecAboutJuceDialog.restype = None - self.lib.carla_frontend_createAndExecJackApplicationW.argtypes = (c_void_p, c_char_p) - self.lib.carla_frontend_createAndExecJackApplicationW.restype = POINTER(JackApplicationDialogResults) + self.lib.carla_frontend_createAndExecJackAppDialog.argtypes = (c_void_p, c_char_p) + self.lib.carla_frontend_createAndExecJackAppDialog.restype = POINTER(JackApplicationDialogResults) + + self.lib.carla_frontend_createAndExecPluginListDialog.argtypes = (c_void_p, c_bool) + self.lib.carla_frontend_createAndExecPluginListDialog.restype = POINTER(JackApplicationDialogResults) # -------------------------------------------------------------------------------------------------------- - def createAndExecAboutJuceW(self, parent): - self.lib.carla_frontend_createAndExecAboutJuceW(unwrapinstance(parent)) + def createAndExecAboutJuceDialog(self, parent): + self.lib.carla_frontend_createAndExecAboutJuceDialog(unwrapinstance(parent)) + + def createAndExecJackAppDialog(self, parent, projectFilename): + return structToDictOrNull(self.lib.carla_frontend_createAndExecJackAppDialog(unwrapinstance(parent), projectFilename.encode("utf-8"))) - def createAndExecJackApplicationW(self, parent, projectFilename): - return structToDictOrNull(self.lib.carla_frontend_createAndExecJackApplicationW(unwrapinstance(parent), projectFilename.encode("utf-8"))) + def createAndExecPluginListDialog(self, parent, useSystemIcons): + self.lib.carla_frontend_createAndExecPluginListDialog(unwrapinstance(parent), useSystemIcons) # ------------------------------------------------------------------------------------------------------------ diff --git a/source/frontend/carla_host.py b/source/frontend/carla_host.py index 8d45be9cf..cd82cc0f6 100644 --- a/source/frontend/carla_host.py +++ b/source/frontend/carla_host.py @@ -62,7 +62,7 @@ from carla_utils import * from carla_widgets import * from patchcanvas import patchcanvas -from pluginlist import PluginDatabaseW +from pluginlist import PluginListDialog from widgets.digitalpeakmeter import DigitalPeakMeter from widgets.pixmapkeyboard import PixmapKeyboardHArea @@ -1208,9 +1208,14 @@ class HostWindow(QMainWindow): # Plugins (menu actions) def showAddPluginDialog(self): + #ret = gCarla.felib.createAndExecPluginListDialog(self.fParentOrSelf, + #self.fSavedSettings[CARLA_KEY_MAIN_SYSTEM_ICONS]) + #print(ret) + #return + if self.fPluginDatabaseDialog is None: - self.fPluginDatabaseDialog = PluginDatabaseW(self.fParentOrSelf, self.host, - self.fSavedSettings[CARLA_KEY_MAIN_SYSTEM_ICONS]) + self.fPluginDatabaseDialog = PluginListDialog(self.fParentOrSelf, self.host, + self.fSavedSettings[CARLA_KEY_MAIN_SYSTEM_ICONS]) dialog = self.fPluginDatabaseDialog dialog.hasLoadedLv2Plugins = self.fHasLoadedLv2Plugins @@ -1236,7 +1241,7 @@ class HostWindow(QMainWindow): return (btype, ptype, filename, label, uniqueId, extraPtr) def showAddJackAppDialog(self): - ret = gCarla.felib.createAndExecJackApplicationW(self.fParentOrSelf, self.fProjectFilename) + ret = gCarla.felib.createAndExecJackAppDialog(self.fParentOrSelf, self.fProjectFilename) if not ret: return @@ -2109,7 +2114,7 @@ class HostWindow(QMainWindow): @pyqtSlot() def slot_aboutJuce(self): - gCarla.felib.createAndExecAboutJuceW(self.fParentOrSelf) + gCarla.felib.createAndExecAboutJuceDialog(self.fParentOrSelf) @pyqtSlot() def slot_aboutQt(self): diff --git a/source/frontend/dialogs/.kdev_include_paths b/source/frontend/dialogs/.kdev_include_paths new file mode 100644 index 000000000..88eab768e --- /dev/null +++ b/source/frontend/dialogs/.kdev_include_paths @@ -0,0 +1,6 @@ +/usr/include/x86_64-linux-gnu/qt5 +../utils/ +../../backend/ +../../includes/ +../../modules/ +../../utils/ diff --git a/source/frontend/dialogs/__init__.py b/source/frontend/dialogs/__init__.py index 731e88e5d..d50802445 100644 --- a/source/frontend/dialogs/__init__.py +++ b/source/frontend/dialogs/__init__.py @@ -16,5 +16,5 @@ # # For a full copy of the GNU General Public License see the doc/GPL.txt file. -from .aboutjucedialog import AboutJuceW -from .jackappdialog import JackApplicationW +from .aboutjucedialog import AboutJuceDialog +from .jackappdialog import JackAppDialog diff --git a/source/frontend/dialogs/aboutjucedialog.cpp b/source/frontend/dialogs/aboutjucedialog.cpp index 03b8d0f9c..688a3e894 100644 --- a/source/frontend/dialogs/aboutjucedialog.cpp +++ b/source/frontend/dialogs/aboutjucedialog.cpp @@ -40,7 +40,7 @@ // -------------------------------------------------------------------------------------------------------------------- // Jack Application Dialog -struct AboutJuceW::Self { +struct AboutJuceDialog::Self { Ui_AboutJuceDialog ui; Self() {} @@ -52,7 +52,7 @@ struct AboutJuceW::Self { } }; -AboutJuceW::AboutJuceW(QWidget* const parent) +AboutJuceDialog::AboutJuceDialog(QWidget* const parent) : QDialog(parent), self(Self::create()) { @@ -81,16 +81,16 @@ AboutJuceW::AboutJuceW(QWidget* const parent) #endif } -AboutJuceW::~AboutJuceW() +AboutJuceDialog::~AboutJuceDialog() { delete &self; } // -------------------------------------------------------------------------------------------------------------------- -void carla_frontend_createAndExecAboutJuceW(void* const parent) +void carla_frontend_createAndExecAboutJuceDialog(void* const parent) { - AboutJuceW(reinterpret_cast(parent)).exec(); + AboutJuceDialog(reinterpret_cast(parent)).exec(); } // -------------------------------------------------------------------------------------------------------------------- diff --git a/source/frontend/dialogs/aboutjucedialog.hpp b/source/frontend/dialogs/aboutjucedialog.hpp index 4d9ee200b..3c5ed329d 100644 --- a/source/frontend/dialogs/aboutjucedialog.hpp +++ b/source/frontend/dialogs/aboutjucedialog.hpp @@ -15,6 +15,8 @@ * For a full copy of the GNU General Public License see the doc/GPL.txt file. */ +#pragma once + #ifdef __clang__ # pragma clang diagnostic push # pragma clang diagnostic ignored "-Wdeprecated-copy-with-user-provided-copy" @@ -38,7 +40,7 @@ // -------------------------------------------------------------------------------------------------------------------- // About JUCE dialog -class AboutJuceW : public QDialog +class AboutJuceDialog : public QDialog { struct Self; Self& self; @@ -46,15 +48,15 @@ class AboutJuceW : public QDialog // ---------------------------------------------------------------------------------------------------------------- public: - explicit AboutJuceW(QWidget* parent); - ~AboutJuceW() override; + explicit AboutJuceDialog(QWidget* parent); + ~AboutJuceDialog() override; }; // -------------------------------------------------------------------------------------------------------------------- extern "C" { -CARLA_API void carla_frontend_createAndExecAboutJuceW(void* parent); +CARLA_API void carla_frontend_createAndExecAboutJuceDialog(void* parent); } diff --git a/source/frontend/dialogs/aboutjucedialog.py b/source/frontend/dialogs/aboutjucedialog.py index be203f666..5519e4fe0 100755 --- a/source/frontend/dialogs/aboutjucedialog.py +++ b/source/frontend/dialogs/aboutjucedialog.py @@ -36,7 +36,7 @@ from aboutjucedialog_ui import Ui_AboutJuceDialog # ------------------------------------------------------------------------------------------------------------ # About JUCE dialog -class AboutJuceW(QDialog): +class AboutJuceDialog(QDialog): def __init__(self, parent): QDialog.__init__(self, parent) self.ui = Ui_AboutJuceDialog() @@ -71,7 +71,7 @@ if __name__ == '__main__': # gCarla.utils = CarlaUtils(os.path.dirname(__file__) + "/../../../bin/libcarla_utils.dylib") _app = QApplication(sys.argv) - _gui = AboutJuceW(None) + _gui = AboutJuceDialog(None) _gui.exec_() # --------------------------------------------------------------------------------------------------------------------- diff --git a/source/frontend/dialogs/jackappdialog.cpp b/source/frontend/dialogs/jackappdialog.cpp index 1c47b6529..9af9fc4ee 100644 --- a/source/frontend/dialogs/jackappdialog.cpp +++ b/source/frontend/dialogs/jackappdialog.cpp @@ -52,7 +52,7 @@ enum { UI_SESSION_NSM = 2, }; -struct JackApplicationW::Self { +struct JackAppDialog::Self { Ui_JackAppDialog ui; const QString fProjectFilename; @@ -66,7 +66,7 @@ struct JackApplicationW::Self { } }; -JackApplicationW::JackApplicationW(QWidget* const parent, const char* const projectFilename) +JackAppDialog::JackAppDialog(QWidget* const parent, const char* const projectFilename) : QDialog(parent), self(Self::create(projectFilename)) { @@ -94,14 +94,14 @@ JackApplicationW::JackApplicationW(QWidget* const parent, const char* const proj // Set-up connections connect(this, &QDialog::finished, - this, &JackApplicationW::slot_saveSettings); + this, &JackAppDialog::slot_saveSettings); connect(self.ui.cb_session_mgr, static_cast(&QComboBox::currentIndexChanged), - this, &JackApplicationW::slot_sessionManagerChanged); + this, &JackAppDialog::slot_sessionManagerChanged); connect(self.ui.le_command, &QLineEdit::textChanged, - this, &JackApplicationW::slot_commandChanged); + this, &JackAppDialog::slot_commandChanged); } -JackApplicationW::~JackApplicationW() +JackAppDialog::~JackAppDialog() { delete &self; } @@ -109,7 +109,7 @@ JackApplicationW::~JackApplicationW() // ----------------------------------------------------------------------------------------------------------------- // public methods -JackApplicationW::CommandAndFlags JackApplicationW::getCommandAndFlags() const +JackAppDialog::CommandAndFlags JackAppDialog::getCommandAndFlags() const { const QString command = self.ui.le_command->text(); QString name = self.ui.le_name->text(); @@ -159,7 +159,7 @@ JackApplicationW::CommandAndFlags JackApplicationW::getCommandAndFlags() const // ----------------------------------------------------------------------------------------------------------------- // private methods -void JackApplicationW::checkIfButtonBoxShouldBeEnabled(const int index, const QCarlaString& command) +void JackAppDialog::checkIfButtonBoxShouldBeEnabled(const int index, const QCarlaString& command) { bool enabled = command.isNotEmpty(); QCarlaString showErr; @@ -190,7 +190,7 @@ void JackApplicationW::checkIfButtonBoxShouldBeEnabled(const int index, const QC button->setEnabled(enabled); } -void JackApplicationW::loadSettings() +void JackAppDialog::loadSettings() { const QSafeSettings settings("falkTX", "CarlaAddJackApp"); @@ -221,17 +221,17 @@ void JackApplicationW::loadSettings() // ----------------------------------------------------------------------------------------------------------------- // private slots -void JackApplicationW::slot_commandChanged(const QString& command) +void JackAppDialog::slot_commandChanged(const QString& command) { checkIfButtonBoxShouldBeEnabled(self.ui.cb_session_mgr->currentIndex(), command); } -void JackApplicationW::slot_sessionManagerChanged(const int index) +void JackAppDialog::slot_sessionManagerChanged(const int index) { checkIfButtonBoxShouldBeEnabled(index, self.ui.le_command->text()); } -void JackApplicationW::slot_saveSettings() +void JackAppDialog::slot_saveSettings() { QSafeSettings settings("falkTX", "CarlaAddJackApp"); settings.setValue("Command", self.ui.le_command->text()); @@ -248,18 +248,18 @@ void JackApplicationW::slot_saveSettings() // -------------------------------------------------------------------------------------------------------------------- -JackApplicationDialogResults* carla_frontend_createAndExecJackApplicationW(void* const parent, const char* const projectFilename) +JackAppDialogResults* carla_frontend_createAndExecJackAppDialog(void* const parent, const char* const projectFilename) { - JackApplicationW gui(reinterpret_cast(parent), projectFilename); + JackAppDialog gui(reinterpret_cast(parent), projectFilename); if (gui.exec()) { - static JackApplicationDialogResults ret = {}; + static JackAppDialogResults ret = {}; static CarlaString retCommand; static CarlaString retName; static CarlaString retLabelSetup; - const JackApplicationW::CommandAndFlags cafs = gui.getCommandAndFlags(); + const JackAppDialog::CommandAndFlags cafs = gui.getCommandAndFlags(); retCommand = cafs.command.toUtf8().constData(); retName = cafs.name.toUtf8().constData(); retLabelSetup = cafs.labelSetup.toUtf8().constData(); @@ -284,7 +284,7 @@ int main(int argc, char* argv[]) { QApplication app(argc, argv); - if (JackApplicationDialogResults* const res = carla_frontend_createAndExecJackApplicationW(nullptr, "")) + if (JackAppDialogResults* const res = carla_frontend_createAndExecJackAppDialog(nullptr, "")) { printf("Results:\n"); printf("\tCommand: %s\n", res->command); diff --git a/source/frontend/dialogs/jackappdialog.hpp b/source/frontend/dialogs/jackappdialog.hpp index 0a66eb6ed..8d7731823 100644 --- a/source/frontend/dialogs/jackappdialog.hpp +++ b/source/frontend/dialogs/jackappdialog.hpp @@ -15,6 +15,8 @@ * For a full copy of the GNU General Public License see the doc/GPL.txt file. */ +#pragma once + #ifdef __clang__ # pragma clang diagnostic push # pragma clang diagnostic ignored "-Wdeprecated-copy-with-user-provided-copy" @@ -38,7 +40,7 @@ // -------------------------------------------------------------------------------------------------------------------- // Jack Application Dialog -class JackApplicationW : public QDialog +class JackAppDialog : public QDialog { struct Self; Self& self; @@ -46,8 +48,8 @@ class JackApplicationW : public QDialog // ---------------------------------------------------------------------------------------------------------------- public: - explicit JackApplicationW(QWidget* parent, const char* projectFilename); - ~JackApplicationW() override; + explicit JackAppDialog(QWidget* parent, const char* projectFilename); + ~JackAppDialog() override; // ---------------------------------------------------------------------------------------------------------------- // public methods @@ -79,13 +81,13 @@ private slots: extern "C" { -struct JackApplicationDialogResults { +struct JackAppDialogResults { const char* command; const char* name; const char* labelSetup; }; -CARLA_API JackApplicationDialogResults* carla_frontend_createAndExecJackApplicationW(void* parent, const char* projectFilename); +CARLA_API JackAppDialogResults* carla_frontend_createAndExecJackAppDialog(void* parent, const char* projectFilename); } diff --git a/source/frontend/dialogs/jackappdialog.py b/source/frontend/dialogs/jackappdialog.py index 94f34474c..878ebd830 100755 --- a/source/frontend/dialogs/jackappdialog.py +++ b/source/frontend/dialogs/jackappdialog.py @@ -56,7 +56,7 @@ UI_SESSION_NONE = 0 UI_SESSION_LADISH = 1 UI_SESSION_NSM = 2 -class JackApplicationW(QDialog): +class JackAppDialog(QDialog): def __init__(self, parent: QWidget, projectFilename: str): QDialog.__init__(self, parent) self.ui = Ui_JackAppDialog() @@ -209,7 +209,7 @@ if __name__ == '__main__': # pylint: enable=ungrouped-imports _app = QApplication(sys.argv) - _gui = JackApplicationW(None, "") + _gui = JackAppDialog(None, "") if _gui.exec_(): _command, _name, _labelSetup = _gui.getCommandAndFlags() diff --git a/source/frontend/pluginlist/.kdev_include_paths b/source/frontend/pluginlist/.kdev_include_paths new file mode 100644 index 000000000..88eab768e --- /dev/null +++ b/source/frontend/pluginlist/.kdev_include_paths @@ -0,0 +1,6 @@ +/usr/include/x86_64-linux-gnu/qt5 +../utils/ +../../backend/ +../../includes/ +../../modules/ +../../utils/ diff --git a/source/frontend/pluginlist/__init__.py b/source/frontend/pluginlist/__init__.py index 723340693..0ebb033a3 100644 --- a/source/frontend/pluginlist/__init__.py +++ b/source/frontend/pluginlist/__init__.py @@ -16,4 +16,4 @@ # # For a full copy of the GNU General Public License see the doc/GPL.txt file. -from .pluginlistdialog import PluginDatabaseW +from .pluginlistdialog import PluginListDialog diff --git a/source/frontend/pluginlist/pluginlistdialog.cpp b/source/frontend/pluginlist/pluginlistdialog.cpp new file mode 100644 index 000000000..22498da8e --- /dev/null +++ b/source/frontend/pluginlist/pluginlistdialog.cpp @@ -0,0 +1,108 @@ +/* + * Carla plugin host + * Copyright (C) 2011-2022 Filipe Coelho + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * For a full copy of the GNU General Public License see the doc/GPL.txt file. + */ + +#include "pluginlistdialog.hpp" + +#ifdef __clang__ +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wdeprecated-copy-with-user-provided-copy" +# pragma clang diagnostic ignored "-Wdeprecated-register" +#elif defined(__GNUC__) && __GNUC__ >= 8 +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wclass-memaccess" +# pragma GCC diagnostic ignored "-Wdeprecated-copy" +#endif + +#include "pluginlistdialog_ui.hpp" + +#ifdef __clang__ +# pragma clang diagnostic pop +#elif defined(__GNUC__) && __GNUC__ >= 8 +# pragma GCC diagnostic pop +#endif + +#include "CarlaString.hpp" + +// -------------------------------------------------------------------------------------------------------------------- +// Jack Application Dialog + +struct PluginListDialog::Self { + Ui_PluginListDialog ui; + + Self() {} + + static Self& create() + { + Self* const self = new Self(); + return *self; + } +}; + +PluginListDialog::PluginListDialog(QWidget* const parent, const bool useSystemIcons) + : QDialog(parent), + self(Self::create()) +{ + self.ui.setupUi(this); + + // ------------------------------------------------------------------------------------------------------------- + // UI setup + + // ------------------------------------------------------------------------------------------------------------- + // Load settings + + // ------------------------------------------------------------------------------------------------------------- + // Set-up connections +} + +PluginListDialog::~PluginListDialog() +{ + delete &self; +} + +// ----------------------------------------------------------------------------------------------------------------- +// public methods + +// ----------------------------------------------------------------------------------------------------------------- +// private methods + +// ----------------------------------------------------------------------------------------------------------------- +// private slots + +// -------------------------------------------------------------------------------------------------------------------- + +PluginListDialogResults* carla_frontend_createAndExecPluginListDialog(void* const parent, const bool useSystemIcons) +{ + PluginListDialog gui(reinterpret_cast(parent), useSystemIcons); + + if (gui.exec()) + { + static PluginListDialogResults ret = {}; + static CarlaString retBinary; + static CarlaString retLabel; + + // TODO + + ret.binary = retBinary; + ret.label = retLabel; + + return &ret; + } + + return nullptr; +} + +// -------------------------------------------------------------------------------------------------------------------- diff --git a/source/frontend/pluginlist/pluginlistdialog.hpp b/source/frontend/pluginlist/pluginlistdialog.hpp new file mode 100644 index 000000000..b9192825b --- /dev/null +++ b/source/frontend/pluginlist/pluginlistdialog.hpp @@ -0,0 +1,80 @@ +/* + * Carla plugin host + * Copyright (C) 2011-2022 Filipe Coelho + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * For a full copy of the GNU General Public License see the doc/GPL.txt file. + */ + +#pragma once + +#ifdef __clang__ +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wdeprecated-copy-with-user-provided-copy" +# pragma clang diagnostic ignored "-Wdeprecated-register" +#elif defined(__GNUC__) && __GNUC__ >= 8 +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wclass-memaccess" +# pragma GCC diagnostic ignored "-Wdeprecated-copy" +#endif + +#include + +#ifdef __clang__ +# pragma clang diagnostic pop +#elif defined(__GNUC__) && __GNUC__ >= 8 +# pragma GCC diagnostic pop +#endif + +#include "CarlaDefines.h" + +// -------------------------------------------------------------------------------------------------------------------- +// Jack Application Dialog + +class PluginListDialog : public QDialog +{ + struct Self; + Self& self; + + // ---------------------------------------------------------------------------------------------------------------- + +public: + explicit PluginListDialog(QWidget* parent, bool useSystemIcons); + ~PluginListDialog() override; + + // ---------------------------------------------------------------------------------------------------------------- + // public methods + + // ---------------------------------------------------------------------------------------------------------------- + // private methods + + // ---------------------------------------------------------------------------------------------------------------- + // private slots +}; + +// -------------------------------------------------------------------------------------------------------------------- + +extern "C" { + +struct PluginListDialogResults { + int btype; + int ptype; + const char* binary; + const char* label; + // TODO +}; + +CARLA_API PluginListDialogResults* carla_frontend_createAndExecPluginListDialog(void* parent, bool useSystemIcons); + +} + +// -------------------------------------------------------------------------------------------------------------------- diff --git a/source/frontend/pluginlist/pluginlistdialog.py b/source/frontend/pluginlist/pluginlistdialog.py index 0d76443da..4e29b202c 100755 --- a/source/frontend/pluginlist/pluginlistdialog.py +++ b/source/frontend/pluginlist/pluginlistdialog.py @@ -74,13 +74,13 @@ from utils import QSafeSettings # Imports (Local) from .discovery import PLUGIN_QUERY_API_VERSION, checkPluginCached -from .pluginlistdialog_ui import Ui_PluginDatabaseW +from .pluginlistdialog_ui import Ui_PluginListDialog from .pluginlistrefreshdialog import PluginRefreshW # --------------------------------------------------------------------------------------------------------------------- # Plugin Database Dialog -class PluginDatabaseW(QDialog): +class PluginListDialog(QDialog): TABLEWIDGET_ITEM_FAVORITE = 0 TABLEWIDGET_ITEM_NAME = 1 TABLEWIDGET_ITEM_LABEL = 2 @@ -90,7 +90,7 @@ class PluginDatabaseW(QDialog): def __init__(self, parent: QWidget, host, useSystemIcons: bool): QDialog.__init__(self, parent) self.host = host - self.ui = Ui_PluginDatabaseW() + self.ui = Ui_PluginListDialog() self.ui.setupUi(self) # To be changed by parent @@ -987,7 +987,7 @@ if __name__ == '__main__': _host = _host() _app = QApplication(sys.argv) - _gui = PluginDatabaseW(None, _host, True) + _gui = PluginListDialog(None, _host, True) if _gui.exec_(): print(f"Result: {_gui.fRetPlugin}") diff --git a/source/frontend/pluginlist/pluginlistdialog.ui b/source/frontend/pluginlist/pluginlistdialog.ui index 7ae106a78..5903f45f5 100644 --- a/source/frontend/pluginlist/pluginlistdialog.ui +++ b/source/frontend/pluginlist/pluginlistdialog.ui @@ -1,7 +1,7 @@ - PluginDatabaseW - + PluginListDialog + 0