From 73642f9f6bb4c50152dc91763744af979e701a5d Mon Sep 17 00:00:00 2001 From: falkTX Date: Tue, 11 Apr 2023 16:33:11 +0200 Subject: [PATCH] Tweak frontend cpp code to make cmake autouic happy Signed-off-by: falkTX --- source/frontend/CarlaFrontend.h | 76 +++++++++++++++++++ source/frontend/Makefile | 18 +++-- source/frontend/dialogs/aboutjucedialog.cpp | 5 +- source/frontend/dialogs/aboutjucedialog.hpp | 8 -- source/frontend/dialogs/jackappdialog.cpp | 7 +- source/frontend/dialogs/jackappdialog.hpp | 14 ---- .../frontend/pluginlist/pluginlistdialog.cpp | 5 +- .../frontend/pluginlist/pluginlistdialog.hpp | 32 +------- .../pluginlist/pluginlistrefreshdialog.cpp | 3 +- .../pluginlist/pluginlistrefreshdialog.hpp | 13 ---- 10 files changed, 101 insertions(+), 80 deletions(-) create mode 100644 source/frontend/CarlaFrontend.h diff --git a/source/frontend/CarlaFrontend.h b/source/frontend/CarlaFrontend.h new file mode 100644 index 000000000..384c4df6d --- /dev/null +++ b/source/frontend/CarlaFrontend.h @@ -0,0 +1,76 @@ +/* + * Carla Plugin Host + * Copyright (C) 2011-2023 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 + +#include "CarlaDefines.h" + +#ifdef __cplusplus +extern "C" { +#endif + +// -------------------------------------------------------------------------------------------------------------------- + +typedef struct { + const char* command; + const char* name; + const char* labelSetup; +} JackAppDialogResults; + +typedef struct { + uint API; + uint build; + uint type; + uint hints; + const char* category; + const char* filename; + const char* name; + const char* label; + const char* maker; + uint64_t uniqueId; + uint audioIns; + uint audioOuts; + uint cvIns; + uint cvOuts; + uint midiIns; + uint midiOuts; + uint parametersIns; + uint parametersOuts; +} PluginListDialogResults; + +struct PluginListRefreshDialogResults { + char todo; +}; + +// -------------------------------------------------------------------------------------------------------------------- + +CARLA_API +void carla_frontend_createAndExecAboutJuceDialog(void* parent); + +CARLA_API JackAppDialogResults* carla_frontend_createAndExecJackAppDialog(void* parent, const char* projectFilename); + +CARLA_API +PluginListDialogResults* carla_frontend_createAndExecPluginListDialog(void* parent/*, const HostSettings& hostSettings*/); + +CARLA_API +PluginListRefreshDialogResults* carla_frontend_createAndExecPluginListRefreshDialog(void* parent, bool useSystemIcons); + +// -------------------------------------------------------------------------------------------------------------------- + +#ifdef __cplusplus +} +#endif diff --git a/source/frontend/Makefile b/source/frontend/Makefile index 2d8c6b67e..5b9caea0f 100644 --- a/source/frontend/Makefile +++ b/source/frontend/Makefile @@ -20,7 +20,7 @@ endif # --------------------------------------------------------------------------------------------------------------------- -BUILD_CXX_FLAGS += -Iutils +BUILD_CXX_FLAGS += -I. -Iutils BUILD_CXX_FLAGS += -I../backend BUILD_CXX_FLAGS += -I../includes @@ -132,11 +132,14 @@ endif # --------------------------------------------------------------------------------------------------------------------- # UI code -UI_FILES = $(wildcard dialogs/*.ui) -UI_FILES += $(wildcard pluginlist/*.ui) +DIALOG_UI_FILES = $(wildcard dialogs/*.ui) +PLUGINLIST_UI_FILES = $(wildcard pluginlist/*.ui) -UIs = $(UI_FILES:%.ui=%_ui.hpp) -UIs += $(UI_FILES:%.ui=%_ui.py) +UIs = $(DIALOG_UI_FILES:dialogs/%.ui=dialogs/ui_%.h) +UIs += $(PLUGINLIST_UI_FILES:pluginlist/%.ui=pluginlist/ui_%.h) + +UIs += $(DIALOG_UI_FILES:%.ui=%_ui.py) +UIs += $(PLUGINLIST_UI_FILES:%.ui=%_ui.py) # old stuff, not yet converted UIs += \ @@ -162,7 +165,10 @@ all: $(BINDIR)/libcarla_frontend$(LIB_EXT) $(QMs) $(RES) $(UIs) # --------------------------------------------------------------------------------------------------------------------- -%_ui.hpp: %.ui +dialogs/ui_%.h: dialogs/%.ui + $(UIC_QT5) $< -o $@ + +pluginlist/ui_%.h: pluginlist/%.ui $(UIC_QT5) $< -o $@ %_ui.py: %.ui diff --git a/source/frontend/dialogs/aboutjucedialog.cpp b/source/frontend/dialogs/aboutjucedialog.cpp index 688a3e894..1b458d1bc 100644 --- a/source/frontend/dialogs/aboutjucedialog.cpp +++ b/source/frontend/dialogs/aboutjucedialog.cpp @@ -1,6 +1,6 @@ /* * Carla plugin host - * Copyright (C) 2011-2022 Filipe Coelho + * Copyright (C) 2011-2023 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 @@ -27,7 +27,7 @@ # pragma GCC diagnostic ignored "-Wdeprecated-copy" #endif -#include "aboutjucedialog_ui.hpp" +#include "ui_aboutjucedialog.h" #ifdef __clang__ # pragma clang diagnostic pop @@ -35,6 +35,7 @@ # pragma GCC diagnostic pop #endif +#include "CarlaFrontend.h" #include "CarlaUtils.h" // -------------------------------------------------------------------------------------------------------------------- diff --git a/source/frontend/dialogs/aboutjucedialog.hpp b/source/frontend/dialogs/aboutjucedialog.hpp index 3c5ed329d..653aa94ee 100644 --- a/source/frontend/dialogs/aboutjucedialog.hpp +++ b/source/frontend/dialogs/aboutjucedialog.hpp @@ -53,11 +53,3 @@ public: }; // -------------------------------------------------------------------------------------------------------------------- - -extern "C" { - -CARLA_API void carla_frontend_createAndExecAboutJuceDialog(void* parent); - -} - -// -------------------------------------------------------------------------------------------------------------------- diff --git a/source/frontend/dialogs/jackappdialog.cpp b/source/frontend/dialogs/jackappdialog.cpp index 9af9fc4ee..ce4d75103 100644 --- a/source/frontend/dialogs/jackappdialog.cpp +++ b/source/frontend/dialogs/jackappdialog.cpp @@ -1,6 +1,6 @@ /* * Carla plugin host - * Copyright (C) 2011-2022 Filipe Coelho + * Copyright (C) 2011-2023 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 @@ -27,7 +27,7 @@ # pragma GCC diagnostic ignored "-Wdeprecated-copy" #endif -#include "jackappdialog_ui.hpp" +#include "ui_jackappdialog.h" #include #include #include @@ -40,6 +40,7 @@ #include "qsafesettings.hpp" +#include "CarlaFrontend.h" #include "CarlaLibJackHints.h" #include "CarlaString.hpp" @@ -93,7 +94,7 @@ JackAppDialog::JackAppDialog(QWidget* const parent, const char* const projectFil // ------------------------------------------------------------------------------------------------------------- // Set-up connections - connect(this, &QDialog::finished, + connect(this, &QDialog::finished, this, &JackAppDialog::slot_saveSettings); connect(self.ui.cb_session_mgr, static_cast(&QComboBox::currentIndexChanged), this, &JackAppDialog::slot_sessionManagerChanged); diff --git a/source/frontend/dialogs/jackappdialog.hpp b/source/frontend/dialogs/jackappdialog.hpp index 8d7731823..0a52a5d2b 100644 --- a/source/frontend/dialogs/jackappdialog.hpp +++ b/source/frontend/dialogs/jackappdialog.hpp @@ -78,17 +78,3 @@ private slots: }; // -------------------------------------------------------------------------------------------------------------------- - -extern "C" { - -struct JackAppDialogResults { - const char* command; - const char* name; - const char* labelSetup; -}; - -CARLA_API JackAppDialogResults* carla_frontend_createAndExecJackAppDialog(void* parent, const char* projectFilename); - -} - -// -------------------------------------------------------------------------------------------------------------------- diff --git a/source/frontend/pluginlist/pluginlistdialog.cpp b/source/frontend/pluginlist/pluginlistdialog.cpp index 3f5a51f99..6b22c9ce7 100644 --- a/source/frontend/pluginlist/pluginlistdialog.cpp +++ b/source/frontend/pluginlist/pluginlistdialog.cpp @@ -1,6 +1,6 @@ /* * Carla plugin host - * Copyright (C) 2011-2022 Filipe Coelho + * Copyright (C) 2011-2023 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 @@ -27,7 +27,7 @@ # pragma GCC diagnostic ignored "-Wdeprecated-copy" #endif -#include "pluginlistdialog_ui.hpp" +#include "ui_pluginlistdialog.h" #include #ifdef __clang__ @@ -40,6 +40,7 @@ #include "qsafesettings.hpp" #include "CarlaBackendUtils.hpp" +#include "CarlaFrontend.h" #include "CarlaUtils.h" #include "CarlaString.hpp" diff --git a/source/frontend/pluginlist/pluginlistdialog.hpp b/source/frontend/pluginlist/pluginlistdialog.hpp index 86631f246..cacb1dc16 100644 --- a/source/frontend/pluginlist/pluginlistdialog.hpp +++ b/source/frontend/pluginlist/pluginlistdialog.hpp @@ -1,6 +1,6 @@ /* * Carla plugin host - * Copyright (C) 2011-2022 Filipe Coelho + * Copyright (C) 2011-2023 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 @@ -112,33 +112,3 @@ private slots: }; // -------------------------------------------------------------------------------------------------------------------- - -extern "C" { - -struct PluginListDialogResults { - uint API; - uint build; - uint type; - uint hints; - const char* category; - const char* filename; - const char* name; - const char* label; - const char* maker; - uint64_t uniqueId; - uint audioIns; - uint audioOuts; - uint cvIns; - uint cvOuts; - uint midiIns; - uint midiOuts; - uint parametersIns; - uint parametersOuts; -}; - -CARLA_API -PluginListDialogResults* carla_frontend_createAndExecPluginListDialog(void* parent/*, const HostSettings& hostSettings*/); - -} - -// -------------------------------------------------------------------------------------------------------------------- diff --git a/source/frontend/pluginlist/pluginlistrefreshdialog.cpp b/source/frontend/pluginlist/pluginlistrefreshdialog.cpp index cecd6cd74..1b4cec2d2 100644 --- a/source/frontend/pluginlist/pluginlistrefreshdialog.cpp +++ b/source/frontend/pluginlist/pluginlistrefreshdialog.cpp @@ -27,7 +27,7 @@ # pragma GCC diagnostic ignored "-Wdeprecated-copy" #endif -#include "pluginlistrefreshdialog_ui.hpp" +#include "ui_pluginlistrefreshdialog.h" #include #include @@ -39,6 +39,7 @@ #include "qsafesettings.hpp" +#include "CarlaFrontend.h" #include "CarlaUtils.h" #include diff --git a/source/frontend/pluginlist/pluginlistrefreshdialog.hpp b/source/frontend/pluginlist/pluginlistrefreshdialog.hpp index 28c11ccc0..0afdd3027 100644 --- a/source/frontend/pluginlist/pluginlistrefreshdialog.hpp +++ b/source/frontend/pluginlist/pluginlistrefreshdialog.hpp @@ -79,16 +79,3 @@ private slots: }; // -------------------------------------------------------------------------------------------------------------------- - -extern "C" { - -struct PluginListRefreshDialogResults { - char todo; -}; - -CARLA_API -PluginListRefreshDialogResults* carla_frontend_createAndExecPluginListRefreshDialog(void* parent, bool useSystemIcons); - -} - -// --------------------------------------------------------------------------------------------------------------------