| @@ -467,6 +467,8 @@ ifeq ($(HAVE_PYQT),true) | |||
| install -d $(DESTDIR)$(DATADIR)/icons/hicolor/scalable/apps | |||
| install -d $(DESTDIR)$(DATADIR)/mime/packages | |||
| install -d $(DESTDIR)$(DATADIR)/carla/resources/translations | |||
| install -d $(DESTDIR)$(DATADIR)/carla/common | |||
| install -d $(DESTDIR)$(DATADIR)/carla/dialogs | |||
| install -d $(DESTDIR)$(DATADIR)/carla/modgui | |||
| install -d $(DESTDIR)$(DATADIR)/carla/patchcanvas | |||
| install -d $(DESTDIR)$(DATADIR)/carla/pluginlist | |||
| @@ -620,6 +622,14 @@ endif | |||
| source/frontend/*.py \ | |||
| $(DESTDIR)$(DATADIR)/carla/ | |||
| install -m 644 \ | |||
| source/frontend/common/*.py \ | |||
| $(DESTDIR)$(DATADIR)/carla/common/ | |||
| install -m 644 \ | |||
| source/frontend/dialogs/*.py \ | |||
| $(DESTDIR)$(DATADIR)/carla/dialogs/ | |||
| install -m 644 \ | |||
| source/frontend/modgui/*.py \ | |||
| $(DESTDIR)$(DATADIR)/carla/modgui/ | |||
| @@ -704,6 +714,8 @@ endif | |||
| install -m 644 resources/scalable/carla-control.svg $(DESTDIR)$(DATADIR)/icons/hicolor/scalable/apps | |||
| # Install resources (re-use python files) | |||
| $(LINK) ../common $(DESTDIR)$(DATADIR)/carla/resources | |||
| $(LINK) ../dialogs $(DESTDIR)$(DATADIR)/carla/resources | |||
| $(LINK) ../modgui $(DESTDIR)$(DATADIR)/carla/resources | |||
| $(LINK) ../patchcanvas $(DESTDIR)$(DATADIR)/carla/resources | |||
| $(LINK) ../pluginlist $(DESTDIR)$(DATADIR)/carla/resources | |||
| @@ -722,7 +734,6 @@ endif | |||
| $(LINK) ../externalui.py $(DESTDIR)$(DATADIR)/carla/resources | |||
| $(LINK) ../resources_rc.py $(DESTDIR)$(DATADIR)/carla/resources | |||
| $(LINK) ../ui_carla_about.py $(DESTDIR)$(DATADIR)/carla/resources | |||
| $(LINK) ../ui_carla_about_juce.py $(DESTDIR)$(DATADIR)/carla/resources | |||
| $(LINK) ../ui_carla_edit.py $(DESTDIR)$(DATADIR)/carla/resources | |||
| $(LINK) ../ui_carla_host.py $(DESTDIR)$(DATADIR)/carla/resources | |||
| $(LINK) ../ui_carla_parameter.py $(DESTDIR)$(DATADIR)/carla/resources | |||
| @@ -24,6 +24,7 @@ BUILD_CXX_FLAGS += -Iutils | |||
| BUILD_CXX_FLAGS += -I../backend | |||
| BUILD_CXX_FLAGS += -I../includes | |||
| BUILD_CXX_FLAGS += -I../modules | |||
| BUILD_CXX_FLAGS += -I../utils | |||
| # --------------------------------------------------------------------------------------------------------------------- | |||
| @@ -46,6 +47,15 @@ else | |||
| $(error Trying to build frontend without Qt5, cannot continue) | |||
| endif | |||
| QT5_LINK_FLAGS += -L$(BINDIR) -lcarla_utils | |||
| ifeq ($(MACOS),true) | |||
| QT5_LINK_FLAGS += -install_name @rpath/libcarla_frontend.dylib | |||
| # FIXME this does not work: -Wl,-rpath,@loader_path | |||
| else | |||
| QT5_LINK_FLAGS += -Wl,-rpath,'$${ORIGIN}' | |||
| endif | |||
| # --------------------------------------------------------------------------------------------------------------------- | |||
| # Translations | |||
| @@ -57,7 +67,8 @@ QMs = $(patsubst %,translations/carla_%.qm,$(I18N_LANGUAGES)) | |||
| CPP_FILES = \ | |||
| carla_frontend.cpp \ | |||
| pluginlist/jackappdialog.cpp | |||
| dialogs/aboutjucedialog.cpp \ | |||
| dialogs/jackappdialog.cpp | |||
| OBJS = $(CPP_FILES:%=$(OBJDIR)/%.o) | |||
| @@ -89,7 +100,6 @@ RES = \ | |||
| $(BINDIR)/resources/xycontroller-ui \ | |||
| $(BINDIR)/resources/resources_rc.py \ | |||
| $(BINDIR)/resources/ui_carla_about.py \ | |||
| $(BINDIR)/resources/ui_carla_about_juce.py \ | |||
| $(BINDIR)/resources/ui_carla_edit.py \ | |||
| $(BINDIR)/resources/ui_carla_host.py \ | |||
| $(BINDIR)/resources/ui_carla_osc_connect.py \ | |||
| @@ -116,7 +126,8 @@ endif | |||
| # --------------------------------------------------------------------------------------------------------------------- | |||
| # UI code | |||
| UI_FILES = $(wildcard pluginlist/*.ui) | |||
| UI_FILES = $(wildcard dialogs/*.ui) | |||
| UI_FILES += $(wildcard pluginlist/*.ui) | |||
| UIs = $(UI_FILES:%.ui=%_ui.hpp) | |||
| UIs += $(UI_FILES:%.ui=%_ui.py) | |||
| @@ -124,7 +135,6 @@ UIs += $(UI_FILES:%.ui=%_ui.py) | |||
| # old stuff, not yet converted | |||
| UIs += \ | |||
| ui_carla_about.py \ | |||
| ui_carla_about_juce.py \ | |||
| ui_carla_edit.py \ | |||
| ui_carla_host.py \ | |||
| ui_carla_osc_connect.py \ | |||
| @@ -176,6 +186,10 @@ $(BINDIR)/libcarla_frontend$(LIB_EXT): $(OBJS) $(LIBS) | |||
| -@mkdir -p $(BINDIR) | |||
| @echo "Linking libcarla_frontend$(LIB_EXT)" | |||
| $(SILENT)$(CXX) $(OBJS) $(BUILD_CXX_FLAGS) $(QT5_LINK_FLAGS) $(SHARED) -o $@ | |||
| ifeq ($(MACOS),true) | |||
| # FIXME this does not work: -Wl,-rpath,@loader_path | |||
| $(SILENT)install_name_tool -change ../../../bin/libcarla_utils.dylib @loader_path/libcarla_utils.dylib $@ | |||
| endif | |||
| $(OBJDIR)/%.cpp.o: %.cpp $(UIs) | |||
| -@mkdir -p $(shell dirname $@) | |||
| @@ -189,6 +203,7 @@ $(OBJDIR)/%.cpp.o: %.cpp $(UIs) | |||
| clean: | |||
| rm -rf $(BINDIR)/libcarla_frontend$(LIB_EXT) $(UIs) $(RES) $(QMs) __pycache__ *.pyc | |||
| # old files | |||
| rm -f ui_carla_about_juce.py | |||
| rm -f ui_carla_add_jack.py | |||
| rm -f ui_carla_database.py | |||
| rm -f ui_carla_refresh.py | |||
| @@ -198,17 +213,6 @@ debug: | |||
| # --------------------------------------------------------------------------------------------------------------------- | |||
| tests: pluginlist/jackappdialog$(APP_EXT) | |||
| # $(UI_FILES:%.ui=%$(APP_EXT)) | |||
| pluginlist/jackappdialog$(APP_EXT): pluginlist/jackappdialog.cpp pluginlist/jackappdialog.ui pluginlist/jackappdialog_ui.hpp | |||
| $(CXX) $< $(BUILD_CXX_FLAGS) $(QT5_LINK_FLAGS) -o $@ | |||
| pluginlist/pluginlistdialog$(APP_EXT): pluginlist/pluginlistdialog.cpp pluginlist/pluginlistdialog.ui pluginlist/pluginlistdialog_ui.hpp | |||
| $(CXX) $< $(BUILD_CXX_FLAGS) $(QT5_LINK_FLAGS) -o $@ | |||
| # --------------------------------------------------------------------------------------------------------------------- | |||
| lint: | |||
| pylint \ | |||
| --extension-pkg-whitelist=PyQt5 \ | |||
| @@ -20,9 +20,7 @@ | |||
| # Imports (Global) | |||
| from abc import abstractmethod | |||
| from platform import architecture | |||
| from struct import pack | |||
| from sys import platform, maxsize | |||
| # --------------------------------------------------------------------------------------------------------------------- | |||
| # Imports (ctypes) | |||
| @@ -34,10 +32,12 @@ from ctypes import ( | |||
| CDLL, CFUNCTYPE, RTLD_GLOBAL, RTLD_LOCAL, POINTER | |||
| ) | |||
| # --------------------------------------------------------------------------------------------------------------------- | |||
| # 64bit check | |||
| # ------------------------------------------------------------------------------------------------------------ | |||
| # Imports (Custom) | |||
| kIs64bit = bool(architecture()[0] == "64bit" and maxsize > 2**32) | |||
| from common import ( | |||
| kIs64bit, HAIKU, LINUX, MACOS, WINDOWS, VERSION | |||
| ) | |||
| # --------------------------------------------------------------------------------------------------------------------- | |||
| # Define custom types | |||
| @@ -45,35 +45,6 @@ kIs64bit = bool(architecture()[0] == "64bit" and maxsize > 2**32) | |||
| c_enum = c_int | |||
| c_uintptr = c_uint64 if kIs64bit else c_uint32 | |||
| # --------------------------------------------------------------------------------------------------------------------- | |||
| # Set Platform | |||
| if platform == "darwin": | |||
| HAIKU = False | |||
| LINUX = False | |||
| MACOS = True | |||
| WINDOWS = False | |||
| elif "haiku" in platform: | |||
| HAIKU = True | |||
| LINUX = False | |||
| MACOS = False | |||
| WINDOWS = False | |||
| elif "linux" in platform: | |||
| HAIKU = False | |||
| LINUX = True | |||
| MACOS = False | |||
| WINDOWS = False | |||
| elif platform in ("win32", "win64", "cygwin"): | |||
| HAIKU = False | |||
| LINUX = False | |||
| MACOS = False | |||
| WINDOWS = True | |||
| else: | |||
| HAIKU = False | |||
| LINUX = False | |||
| MACOS = False | |||
| WINDOWS = False | |||
| # --------------------------------------------------------------------------------------------------------------------- | |||
| # Convert a ctypes c_char_p into a python string | |||
| @@ -60,11 +60,18 @@ 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_createAndExecJackApplicationW.argtypes = (c_void_p, c_char_p) | |||
| self.lib.carla_frontend_createAndExecJackApplicationW.restype = POINTER(JackApplicationDialogResults) | |||
| # -------------------------------------------------------------------------------------------------------- | |||
| def createAndExecAboutJuceW(self, parent): | |||
| # FIXME cast(c_void_p, voidptr(parent)) | |||
| self.lib.carla_frontend_createAndExecAboutJuceW(None) | |||
| def createAndExecJackApplicationW(self, parent, projectFilename): | |||
| # FIXME cast(c_void_p, voidptr(parent)) | |||
| return structToDictOrNull(self.lib.carla_frontend_createAndExecJackApplicationW(None, projectFilename.encode("utf-8"))) | |||
| @@ -62,7 +62,7 @@ from carla_utils import * | |||
| from carla_widgets import * | |||
| from patchcanvas import patchcanvas | |||
| from pluginlist import PluginDatabaseW, JackApplicationW | |||
| from pluginlist import PluginDatabaseW | |||
| from widgets.digitalpeakmeter import DigitalPeakMeter | |||
| from widgets.pixmapkeyboard import PixmapKeyboardHArea | |||
| @@ -2109,7 +2109,7 @@ class HostWindow(QMainWindow): | |||
| @pyqtSlot() | |||
| def slot_aboutJuce(self): | |||
| JuceAboutW(self.fParentOrSelf).exec_() | |||
| gCarla.felib.createAndExecAboutJuceW(self.fParentOrSelf) | |||
| @pyqtSlot() | |||
| def slot_aboutQt(self): | |||
| @@ -47,7 +47,6 @@ from PyQt5.QtWidgets import QFileDialog, QMessageBox | |||
| # Imports (Custom) | |||
| from carla_backend import ( | |||
| kIs64bit, HAIKU, LINUX, MACOS, WINDOWS, | |||
| MAX_DEFAULT_PARAMETERS, | |||
| ENGINE_PROCESS_MODE_MULTIPLE_CLIENTS, | |||
| ENGINE_PROCESS_MODE_PATCHBAY, | |||
| @@ -55,6 +54,8 @@ from carla_backend import ( | |||
| ENGINE_TRANSPORT_MODE_JACK | |||
| ) | |||
| from common import kIs64bit, HAIKU, LINUX, MACOS, WINDOWS, VERSION | |||
| # ------------------------------------------------------------------------------------------------------------ | |||
| # Config | |||
| @@ -68,11 +69,6 @@ X_DATADIR_X = None | |||
| if WINDOWS: | |||
| WINDIR = os.getenv("WINDIR") | |||
| # ------------------------------------------------------------------------------------------------------------ | |||
| # Set Version | |||
| VERSION = "2.6.0-alpha1" | |||
| # ------------------------------------------------------------------------------------------------------------ | |||
| # Set TMP | |||
| @@ -32,7 +32,6 @@ from PyQt5.QtWidgets import QDialog, QFileDialog, QInputDialog, QMenu, QMessageB | |||
| # Imports (Custom) | |||
| import ui_carla_about | |||
| import ui_carla_about_juce | |||
| import ui_carla_edit | |||
| import ui_carla_parameter | |||
| @@ -239,31 +238,6 @@ class CarlaAboutW(QDialog): | |||
| if MACOS: | |||
| self.setWindowModality(Qt.WindowModal) | |||
| # ------------------------------------------------------------------------------------------------------------ | |||
| # JUCE About dialog | |||
| class JuceAboutW(QDialog): | |||
| def __init__(self, parent): | |||
| QDialog.__init__(self, parent) | |||
| self.ui = ui_carla_about_juce.Ui_JuceAboutW() | |||
| self.ui.setupUi(self) | |||
| self.ui.l_text2.setText(self.tr("This program uses JUCE version %s." % gCarla.utils.get_juce_version())) | |||
| self.adjustSize() | |||
| self.setFixedSize(self.size()) | |||
| flags = self.windowFlags() | |||
| flags &= ~Qt.WindowContextHelpButtonHint | |||
| if WINDOWS: | |||
| flags |= Qt.MSWindowsFixedSizeDialogHint | |||
| self.setWindowFlags(flags) | |||
| if MACOS: | |||
| self.setWindowModality(Qt.WindowModal) | |||
| # ------------------------------------------------------------------------------------------------------------ | |||
| # Plugin Parameter | |||
| @@ -0,0 +1,64 @@ | |||
| #!/usr/bin/env python3 | |||
| # -*- coding: utf-8 -*- | |||
| # Common Carla code | |||
| # Copyright (C) 2011-2022 Filipe Coelho <falktx@falktx.com> | |||
| # | |||
| # 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. | |||
| # --------------------------------------------------------------------------------------------------------------------- | |||
| # Imports (Global) | |||
| from platform import architecture | |||
| from sys import platform, maxsize | |||
| # --------------------------------------------------------------------------------------------------------------------- | |||
| # Set Version | |||
| VERSION = "2.6.0-alpha1" | |||
| # --------------------------------------------------------------------------------------------------------------------- | |||
| # 64bit check | |||
| kIs64bit = bool(architecture()[0] == "64bit" and maxsize > 2**32) | |||
| # --------------------------------------------------------------------------------------------------------------------- | |||
| # Set Platform | |||
| if platform == "darwin": | |||
| HAIKU = False | |||
| LINUX = False | |||
| MACOS = True | |||
| WINDOWS = False | |||
| elif "haiku" in platform: | |||
| HAIKU = True | |||
| LINUX = False | |||
| MACOS = False | |||
| WINDOWS = False | |||
| elif "linux" in platform: | |||
| HAIKU = False | |||
| LINUX = True | |||
| MACOS = False | |||
| WINDOWS = False | |||
| elif platform in ("win32", "win64", "cygwin"): | |||
| HAIKU = False | |||
| LINUX = False | |||
| MACOS = False | |||
| WINDOWS = True | |||
| else: | |||
| HAIKU = False | |||
| LINUX = False | |||
| MACOS = False | |||
| WINDOWS = False | |||
| # --------------------------------------------------------------------------------------------------------------------- | |||
| @@ -0,0 +1,20 @@ | |||
| #!/usr/bin/env python3 | |||
| # -*- coding: utf-8 -*- | |||
| # Carla plugin host | |||
| # Copyright (C) 2011-2022 Filipe Coelho <falktx@falktx.com> | |||
| # | |||
| # 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. | |||
| from .aboutjucedialog import AboutJuceW | |||
| from .jackappdialog import JackApplicationW | |||
| @@ -0,0 +1,96 @@ | |||
| /* | |||
| * Carla plugin host | |||
| * Copyright (C) 2011-2022 Filipe Coelho <falktx@falktx.com> | |||
| * | |||
| * 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 "aboutjucedialog.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 "aboutjucedialog_ui.hpp" | |||
| #ifdef __clang__ | |||
| # pragma clang diagnostic pop | |||
| #elif defined(__GNUC__) && __GNUC__ >= 8 | |||
| # pragma GCC diagnostic pop | |||
| #endif | |||
| #include "CarlaUtils.h" | |||
| // -------------------------------------------------------------------------------------------------------------------- | |||
| // Jack Application Dialog | |||
| struct AboutJuceW::Self { | |||
| Ui_AboutJuceDialog ui; | |||
| Self() {} | |||
| static Self& create() | |||
| { | |||
| Self* const self = new Self(); | |||
| return *self; | |||
| } | |||
| }; | |||
| AboutJuceW::AboutJuceW(QWidget* const parent) | |||
| : QDialog(parent), | |||
| self(Self::create()) | |||
| { | |||
| self.ui.setupUi(this); | |||
| // ------------------------------------------------------------------------------------------------------------- | |||
| // UI setup | |||
| self.ui.l_text2->setText(tr("This program uses JUCE version") + " " + carla_get_juce_version() + "."); | |||
| adjustSize(); | |||
| setFixedSize(size()); | |||
| Qt::WindowFlags flags = windowFlags(); | |||
| flags &= ~Qt::WindowContextHelpButtonHint; | |||
| #ifdef CARLA_OS_WIN | |||
| flags |= Qt::MSWindowsFixedSizeDialogHint; | |||
| #endif | |||
| setWindowFlags(flags); | |||
| #ifdef CARLA_OS_MAC | |||
| if (parent != nullptr) | |||
| setWindowModality(Qt::WindowModal); | |||
| #endif | |||
| } | |||
| AboutJuceW::~AboutJuceW() | |||
| { | |||
| delete &self; | |||
| } | |||
| // -------------------------------------------------------------------------------------------------------------------- | |||
| void carla_frontend_createAndExecAboutJuceW(void* const parent) | |||
| { | |||
| AboutJuceW(reinterpret_cast<QWidget*>(parent)).exec(); | |||
| } | |||
| // -------------------------------------------------------------------------------------------------------------------- | |||
| @@ -0,0 +1,61 @@ | |||
| /* | |||
| * Carla plugin host | |||
| * Copyright (C) 2011-2022 Filipe Coelho <falktx@falktx.com> | |||
| * | |||
| * 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. | |||
| */ | |||
| #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 <QtWidgets/QDialog> | |||
| #ifdef __clang__ | |||
| # pragma clang diagnostic pop | |||
| #elif defined(__GNUC__) && __GNUC__ >= 8 | |||
| # pragma GCC diagnostic pop | |||
| #endif | |||
| #include "CarlaDefines.h" | |||
| // -------------------------------------------------------------------------------------------------------------------- | |||
| // About JUCE dialog | |||
| class AboutJuceW : public QDialog | |||
| { | |||
| struct Self; | |||
| Self& self; | |||
| // ---------------------------------------------------------------------------------------------------------------- | |||
| public: | |||
| explicit AboutJuceW(QWidget* parent); | |||
| ~AboutJuceW() override; | |||
| }; | |||
| // -------------------------------------------------------------------------------------------------------------------- | |||
| extern "C" { | |||
| CARLA_API void carla_frontend_createAndExecAboutJuceW(void* parent); | |||
| } | |||
| // -------------------------------------------------------------------------------------------------------------------- | |||
| @@ -0,0 +1,74 @@ | |||
| #!/usr/bin/env python3 | |||
| # -*- coding: utf-8 -*- | |||
| # Carla plugin host | |||
| # Copyright (C) 2011-2022 Filipe Coelho <falktx@falktx.com> | |||
| # | |||
| # 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. | |||
| # --------------------------------------------------------------------------------------------------------------------- | |||
| # Imports (Global) | |||
| from PyQt5.QtCore import Qt | |||
| from PyQt5.QtWidgets import QDialog | |||
| # --------------------------------------------------------------------------------------------------------------------- | |||
| # Imports (Carla) | |||
| from common import MACOS, WINDOWS | |||
| from carla_shared import gCarla | |||
| # --------------------------------------------------------------------------------------------------------------------- | |||
| # Imports (Local) | |||
| from .aboutjucedialog_ui import Ui_AboutJuceDialog | |||
| # ------------------------------------------------------------------------------------------------------------ | |||
| # About JUCE dialog | |||
| class AboutJuceW(QDialog): | |||
| def __init__(self, parent): | |||
| QDialog.__init__(self, parent) | |||
| self.ui = Ui_AboutJuceDialog() | |||
| self.ui.setupUi(self) | |||
| self.ui.l_text2.setText(self.tr("This program uses JUCE version %s." % gCarla.utils.get_juce_version())) | |||
| self.adjustSize() | |||
| self.setFixedSize(self.size()) | |||
| flags = self.windowFlags() | |||
| flags &= ~Qt.WindowContextHelpButtonHint | |||
| if WINDOWS: | |||
| flags |= Qt.MSWindowsFixedSizeDialogHint | |||
| self.setWindowFlags(flags) | |||
| if MACOS: | |||
| self.setWindowModality(Qt.WindowModal) | |||
| # --------------------------------------------------------------------------------------------------------------------- | |||
| # Testing | |||
| if __name__ == '__main__': | |||
| import sys | |||
| # pylint: disable=ungrouped-imports | |||
| from PyQt5.QtWidgets import QApplication | |||
| # pylint: enable=ungrouped-imports | |||
| _app = QApplication(sys.argv) | |||
| _gui = AboutJuceW(None, "") | |||
| _gui.exec_() | |||
| # --------------------------------------------------------------------------------------------------------------------- | |||
| @@ -1,7 +1,7 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <ui version="4.0"> | |||
| <class>JuceAboutW</class> | |||
| <widget class="QDialog" name="JuceAboutW"> | |||
| <class>AboutJuceDialog</class> | |||
| <widget class="QDialog" name="AboutJuceDialog"> | |||
| <property name="geometry"> | |||
| <rect> | |||
| <x>0</x> | |||
| @@ -154,7 +154,7 @@ Copyright (C) 2022 Raw Material Software Limited.</string> | |||
| <connection> | |||
| <sender>buttonBox</sender> | |||
| <signal>accepted()</signal> | |||
| <receiver>JuceAboutW</receiver> | |||
| <receiver>AboutJuceDialog</receiver> | |||
| <slot>accept()</slot> | |||
| <hints> | |||
| <hint type="sourcelabel"> | |||
| @@ -170,7 +170,7 @@ Copyright (C) 2022 Raw Material Software Limited.</string> | |||
| <connection> | |||
| <sender>buttonBox</sender> | |||
| <signal>rejected()</signal> | |||
| <receiver>JuceAboutW</receiver> | |||
| <receiver>AboutJuceDialog</receiver> | |||
| <slot>reject()</slot> | |||
| <hints> | |||
| <hint type="sourcelabel"> | |||
| @@ -53,7 +53,7 @@ enum { | |||
| }; | |||
| struct JackApplicationW::Self { | |||
| Ui_Dialog ui; | |||
| Ui_JackAppDialog ui; | |||
| const QString fProjectFilename; | |||
| Self(const char* const projectFilename) | |||
| @@ -76,9 +76,15 @@ JackApplicationW::JackApplicationW(QWidget* const parent, const char* const proj | |||
| // UI setup | |||
| self.ui.group_error->setVisible(false); | |||
| adjustSize(); | |||
| setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); | |||
| #ifdef CARLA_OS_MAC | |||
| if (parent != nullptr) | |||
| setWindowModality(Qt::WindowModal); | |||
| #endif | |||
| // ------------------------------------------------------------------------------------------------------------- | |||
| // Load settings | |||
| @@ -33,9 +33,7 @@ | |||
| # pragma GCC diagnostic pop | |||
| #endif | |||
| #include "../utils/qcarlastring.hpp" | |||
| #include "CarlaDefines.h" | |||
| #include "qcarlastring.hpp" | |||
| // -------------------------------------------------------------------------------------------------------------------- | |||
| // Jack Application Dialog | |||
| @@ -32,7 +32,7 @@ from utils import QSafeSettings | |||
| # --------------------------------------------------------------------------------------------------------------------- | |||
| # Imports (Local) | |||
| from .jackappdialog_ui import Ui_Dialog | |||
| from .jackappdialog_ui import Ui_JackAppDialog | |||
| # --------------------------------------------------------------------------------------------------------------------- | |||
| # Imports (API) | |||
| @@ -59,7 +59,7 @@ UI_SESSION_NSM = 2 | |||
| class JackApplicationW(QDialog): | |||
| def __init__(self, parent: QWidget, projectFilename: str): | |||
| QDialog.__init__(self, parent) | |||
| self.ui = Ui_Dialog() | |||
| self.ui = Ui_JackAppDialog() | |||
| self.ui.setupUi(self) | |||
| self.fProjectFilename = projectFilename | |||
| @@ -1,7 +1,7 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <ui version="4.0"> | |||
| <class>Dialog</class> | |||
| <widget class="QDialog" name="Dialog"> | |||
| <class>JackAppDialog</class> | |||
| <widget class="QDialog" name="JackAppDialog"> | |||
| <property name="geometry"> | |||
| <rect> | |||
| <x>0</x> | |||
| @@ -619,7 +619,7 @@ | |||
| <connection> | |||
| <sender>buttonBox</sender> | |||
| <signal>accepted()</signal> | |||
| <receiver>Dialog</receiver> | |||
| <receiver>JackAppDialog</receiver> | |||
| <slot>accept()</slot> | |||
| <hints> | |||
| <hint type="sourcelabel"> | |||
| @@ -635,7 +635,7 @@ | |||
| <connection> | |||
| <sender>buttonBox</sender> | |||
| <signal>rejected()</signal> | |||
| <receiver>Dialog</receiver> | |||
| <receiver>JackAppDialog</receiver> | |||
| <slot>reject()</slot> | |||
| <hints> | |||
| <hint type="sourcelabel"> | |||
| @@ -16,5 +16,4 @@ | |||
| # | |||
| # For a full copy of the GNU General Public License see the doc/GPL.txt file. | |||
| from .jackappdialog import JackApplicationW | |||
| from .pluginlistdialog import PluginDatabaseW | |||
| @@ -35,6 +35,8 @@ | |||
| # pragma GCC diagnostic pop | |||
| #endif | |||
| #include "CarlaDefines.h" | |||
| //--------------------------------------------------------------------------------------------------------------------- | |||
| // Custom QString class with a few extra methods | |||
| @@ -35,6 +35,8 @@ | |||
| # pragma GCC diagnostic pop | |||
| #endif | |||
| #include "CarlaDefines.h" | |||
| //--------------------------------------------------------------------------------------------------------------------- | |||
| // Safer QSettings class, which does not throw if type mismatches | |||