From cee62b42e5f1af72455787dd689f172a2a514445 Mon Sep 17 00:00:00 2001 From: falkTX Date: Tue, 25 Feb 2014 21:44:01 +0000 Subject: [PATCH] Update makefile and py code to allow PyQt5 for the frontend --- Makefile | 80 +++++++++++++++++++--------- source/Makefile.mk | 24 ++++++--- source/backend/Makefile.mk | 5 +- source/bridges/Makefile | 5 +- source/carla | 10 +++- source/carla-patchbay | 2 +- source/carla_database.py | 15 ++++-- source/carla_host.py | 14 ++++- source/carla_patchbay.py | 15 +++++- source/carla_rack.py | 14 ++++- source/carla_settings.py | 18 +++++-- source/carla_shared.py | 21 ++++++-- source/carla_skin.py | 14 ++++- source/carla_style.py | 14 ++++- source/carla_widgets.py | 16 ++++-- source/discovery/Makefile | 5 +- source/patchcanvas.py | 37 +++++++++---- source/patchcanvas_theme.py | 15 ++++-- source/widgets/canvaspreviewframe.py | 16 ++++-- source/widgets/digitalpeakmeter.py | 16 ++++-- source/widgets/ledbutton.py | 16 ++++-- source/widgets/paramspinbox.py | 18 +++++-- source/widgets/pixmapbutton.py | 16 ++++-- source/widgets/pixmapdial.py | 19 +++++-- source/widgets/pixmapkeyboard.py | 16 ++++-- 25 files changed, 345 insertions(+), 96 deletions(-) diff --git a/Makefile b/Makefile index 8cc6f7e05..6806cb874 100644 --- a/Makefile +++ b/Makefile @@ -13,15 +13,25 @@ DESTDIR = SED_PREFIX = $(shell echo $(PREFIX) | sed "s/\//\\\\\\\\\//g") -LINK = ln -sf +LINK = ln -sf ifneq ($(MACOS),true) +ifeq ($(DEFAULT_QT),5) +PYUIC ?= pyuic5 +PYRCC ?= pyrcc5 +else PYUIC ?= pyuic4 -w PYRCC ?= pyrcc4 -py3 +endif +else # MACOS +ifeq ($(DEFAULT_QT),5) +PYUIC ?= pyuic5-3.3 +PYRCC ?= pyrcc5-3.3 else PYUIC ?= pyuic4-3.3 -w PYRCC ?= pyrcc4-3.3 -py3 endif +endif # -------------------------------------------------------------- @@ -85,11 +95,19 @@ wine64: # -------------------------------------------------------------- # Resources -RES = source/resources_rc.py +RES = source/carla_config.py source/resources_rc.py RES: $(RES) -source/%_rc.py: resources/%.qrc resources/*/*.png resources/*/*.svg +source/carla_config.py: + @echo "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n" > $@ +ifeq ($(DEFAULT_QT),5) + @echo "config_UseQt5 = True" >> $@ +else + @echo "config_UseQt5 = False" >> $@ +endif + +source/resources_rc.py: resources/resources.qrc resources/*/*.png resources/*/*.svg $(PYRCC) $< -o $@ # -------------------------------------------------------------- @@ -311,7 +329,22 @@ uninstall: # -------------------------------------------------------------- -ifneq ($(HAIKU),true) +USE_COLORS=true +USE_VST3=false + +ifeq ($(HAIKU),true) +USE_COLORS=false +endif + +ifeq ($(MACOS),true) +USE_VST3=true +endif + +ifeq ($(WIN32),true) +USE_VST3=true +endif + +ifeq ($(USE_COLORS),true) ANS_NO=\033[31m NO \033[0m ANS_YES=\033[32m YES \033[0m mS=\033[33m[ @@ -363,6 +396,11 @@ ifeq ($(CARLA_PLUGIN_SUPPORT),true) @echo "DSSI: $(ANS_YES)" @echo "LV2: $(ANS_YES)" @echo "VST: $(ANS_YES)" +ifeq ($(USE_VST3),true) + @echo "VST3: $(ANS_YES) $(mZ)MacOS only$(mE)" +else + @echo "VST3: $(ANS_NO) $(mZ)Windows and MacOS only$(mE)" +endif ifeq ($(MACOS),true) @echo "AU: $(ANS_YES)" else @@ -379,8 +417,7 @@ endif ifeq ($(CARLA_PLUGIN_SUPPORT),true) @echo "$(tS)---> LV2 UI toolkit support: $(tE)" - @echo "External:$(ANS_YES) (direct+bridge)" -ifeq ($(LINUX),true) +# @echo "External:$(ANS_YES) (direct+bridge)" ifeq ($(HAVE_GTK2),true) @echo "Gtk2: $(ANS_YES) (bridge)" else @@ -402,23 +439,16 @@ else @echo "Qt5: $(ANS_NO) $(mS)Qt5 missing$(mE)" endif @echo "X11: $(ANS_YES) (direct+bridge)" -else - @echo "Gtk2: $(ANS_NO) $(mZ)Linux only$(mE)" - @echo "Gtk3: $(ANS_NO) $(mZ)Linux only$(mE)" - @echo "Qt4: $(ANS_NO) $(mZ)Linux only$(mE)" - @echo "Qt5: $(ANS_NO) $(mZ)Linux only$(mE)" - @echo "X11: $(ANS_NO) $(mZ)Linux only$(mE)" -endif -ifeq ($(MACOS),true) - @echo "Cocoa: $(ANS_YES) (direct+bridge)" -else - @echo "Cocoa: $(ANS_NO) $(mZ)MacOS only$(mE)" -endif -ifeq ($(WIN32),true) - @echo "Windows: $(ANS_YES) (direct+bridge)" -else - @echo "Windows: $(ANS_NO) $(mZ)Windows only$(mE)" -endif +# ifeq ($(MACOS),true) +# @echo "Cocoa: $(ANS_YES) (direct+bridge)" +# else +# @echo "Cocoa: $(ANS_NO) $(mZ)MacOS only$(mE)" +# endif +# ifeq ($(WIN32),true) +# @echo "Windows: $(ANS_YES) (direct+bridge)" +# else +# @echo "Windows: $(ANS_NO) $(mZ)Windows only$(mE)" +# endif @echo "" endif @@ -456,7 +486,7 @@ ifeq ($(HAVE_AF_DEPS),true) ifeq ($(HAVE_FFMPEG),true) @echo "AudioFile: $(ANS_YES) (with ffmpeg)" else - @echo "AudioFile: $(ANS_YES) (without ffmpeg) $(mS)ffmpeg/libav missing or too new$(mE)" + @echo "AudioFile: $(ANS_YES) (without ffmpeg) $(mS)ffmpeg/libav missing$(mE)" endif else @echo "AudioFile: $(ANS_NO) $(mS)libsndfile missing$(mE)" @@ -466,7 +496,7 @@ ifeq ($(HAVE_MF_DEPS),true) else @echo "MidiFile: $(ANS_NO) $(mS)LibSMF missing$(mE)" endif -ifeq ($(HAVE_OPENGL),true) +ifeq ($(HAVE_DGL),true) @echo "DISTRHO: $(ANS_YES)" else @echo "DISTRHO: $(ANS_NO) $(mS)OpenGL missing$(mE)" diff --git a/source/Makefile.mk b/source/Makefile.mk index e4c705571..0dab853d1 100644 --- a/source/Makefile.mk +++ b/source/Makefile.mk @@ -117,6 +117,20 @@ BUILD_CXX_FLAGS = $(BASE_FLAGS) $(32BIT_FLAGS) $(CXXFLAGS) LINK_FLAGS = $(32BIT_FLAGS) $(LDFLAGS) endif +# -------------------------------------------------------------- +# Check for qt, set default version (prefer qt4) + +HAVE_QT4 = $(shell pkg-config --exists QtCore QtGui && echo true) +HAVE_QT5 = $(shell pkg-config --exists Qt5Core Qt5Gui Qt5Widgets && echo true) + +ifeq ($(HAVE_QT5),true) +DEFAULT_QT=5 +endif + +ifeq ($(HAVE_QT4),true) +DEFAULT_QT=4 +endif + # -------------------------------------------------------------- # Check for required libs @@ -124,12 +138,10 @@ ifneq ($(shell pkg-config --exists liblo && echo true),true) $(error liblo missing, cannot continue) endif -ifneq ($(shell pkg-config --exists QtCore && echo true),true) -$(error QtCore missing, cannot continue) +ifneq ($(HAVE_QT4),true) +ifneq ($(HAVE_QT5),true) +$(error Qt missing, cannot continue) endif - -ifneq ($(shell pkg-config --exists QtXml && echo true),true) -$(error QtXml missing, cannot continue) endif # -------------------------------------------------------------- @@ -176,8 +188,6 @@ endif HAVE_FFMPEG = $(shell pkg-config --exists libavcodec libavformat libavutil && echo true) HAVE_GTK2 = $(shell pkg-config --exists gtk+-2.0 && echo true) HAVE_GTK3 = $(shell pkg-config --exists gtk+-3.0 && echo true) -HAVE_QT4 = $(shell pkg-config --exists QtCore QtGui && echo true) -HAVE_QT5 = $(shell pkg-config --exists Qt5Core Qt5Gui Qt5Widgets && echo true) HAVE_X11 = $(shell pkg-config --exists x11 && echo true) ifeq ($(LINUX),true) diff --git a/source/backend/Makefile.mk b/source/backend/Makefile.mk index 7f652a0ae..5a5b731b9 100644 --- a/source/backend/Makefile.mk +++ b/source/backend/Makefile.mk @@ -16,7 +16,10 @@ BUILD_CXX_FLAGS += $(LIBLO_FLAGS) BUILD_CXX_FLAGS += -DWANT_NATIVE ifeq ($(CARLA_PLUGIN_SUPPORT),true) -BUILD_CXX_FLAGS += -DWANT_LADSPA -DWANT_DSSI -DWANT_LV2 -DWANT_VST -DWANT_VST3 -DWANT_AU -DWANT_REWIRE +BUILD_CXX_FLAGS += -DWANT_LADSPA -DWANT_DSSI -DWANT_LV2 -DWANT_VST -DWANT_VST3 -DWANT_REWIRE +ifeq ($(MACOS),true) +BUILD_CXX_FLAGS += -DWANT_AU +endif ifeq ($(CARLA_VESTIGE_HEADER),true) BUILD_CXX_FLAGS += -DVESTIGE_HEADER endif diff --git a/source/bridges/Makefile b/source/bridges/Makefile index ab81647b0..9e9bc003e 100644 --- a/source/bridges/Makefile +++ b/source/bridges/Makefile @@ -25,7 +25,10 @@ LINK_PLUGIN_FLAGS = $(LINK_FLAGS) LINK_PLUGIN_FLAGS += $(QTCORE_LIBS) $(QTXML_LIBS) ifeq ($(CARLA_PLUGIN_SUPPORT),true) -BUILD_PLUGIN_FLAGS += -DWANT_LADSPA -DWANT_DSSI -DWANT_LV2 -DWANT_VST -DWANT_VST3 -DWANT_AU -DWANT_REWIRE +BUILD_PLUGIN_FLAGS += -DWANT_LADSPA -DWANT_DSSI -DWANT_LV2 -DWANT_VST -DWANT_VST3 -DWANT_REWIRE +ifeq ($(MACOS),true) +BUILD_CXX_FLAGS += -DWANT_AU +endif ifeq ($(CARLA_VESTIGE_HEADER),true) BUILD_PLUGIN_FLAGS += -DVESTIGE_HEADER endif diff --git a/source/carla b/source/carla index c64d4a319..e2bf29aa8 100755 --- a/source/carla +++ b/source/carla @@ -16,10 +16,18 @@ # # For a full copy of the GNU General Public License see the GPL.txt file +# ------------------------------------------------------------------------------------------------------------ +# Imports (Config) + +from carla_config import * + # ------------------------------------------------------------------------------------------------------------ # Imports (Global) -from PyQt4.QtGui import QLabel, QTabWidget +if config_UseQt5: + from PyQt5.QtWidgets import QLabel, QTabWidget +else: + from PyQt4.QtGui import QLabel, QTabWidget # ------------------------------------------------------------------------------------------------------------ # Imports (Custom Stuff) diff --git a/source/carla-patchbay b/source/carla-patchbay index 434c97f6c..bea037871 100755 --- a/source/carla-patchbay +++ b/source/carla-patchbay @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- # Carla plugin host -# Copyright (C) 2011-2013 Filipe Coelho +# Copyright (C) 2011-2014 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 diff --git a/source/carla_database.py b/source/carla_database.py index 1c43c10b9..dbc542b3d 100755 --- a/source/carla_database.py +++ b/source/carla_database.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- # Carla plugin database code -# Copyright (C) 2011-2013 Filipe Coelho +# Copyright (C) 2011-2014 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 @@ -16,14 +16,23 @@ # # For a full copy of the GNU General Public License see the doc/GPL.txt file. +# ------------------------------------------------------------------------------------------------------------ +# Imports (Config) + +from carla_config import * + # ------------------------------------------------------------------------------------------------------------ # Imports (Global) from copy import deepcopy from subprocess import Popen, PIPE -from PyQt4.QtCore import pyqtSignal, pyqtSlot, Qt, QThread, QSettings -from PyQt4.QtGui import QDialog, QTableWidgetItem +if config_UseQt5: + from PyQt5.QtCore import pyqtSignal, pyqtSlot, Qt, QThread, QSettings + from PyQt5.QtWidgets import QDialog, QTableWidgetItem +else: + from PyQt4.QtCore import pyqtSignal, pyqtSlot, Qt, QThread, QSettings + from PyQt4.QtGui import QDialog, QTableWidgetItem # ------------------------------------------------------------------------------------------------------------ # Imports (Custom) diff --git a/source/carla_host.py b/source/carla_host.py index 312b921b1..346d9a6b6 100644 --- a/source/carla_host.py +++ b/source/carla_host.py @@ -16,11 +16,21 @@ # # For a full copy of the GNU General Public License see the doc/GPL.txt file. +# ------------------------------------------------------------------------------------------------------------ +# Imports (Config) + +from carla_config import * + # ------------------------------------------------------------------------------------------------------------ # Imports (Global) -from PyQt4.QtCore import qCritical, QModelIndex, QTimer -from PyQt4.QtGui import QApplication, QFileSystemModel, QListWidgetItem, QMainWindow, QPalette +if config_UseQt5: + from PyQt5.QtCore import qCritical, QModelIndex, QTimer + from PyQt5.QtGui import QPalette + from PyQt5.QtWidgets import QApplication, QFileSystemModel, QListWidgetItem, QMainWindow +else: + from PyQt4.QtCore import qCritical, QModelIndex, QTimer + from PyQt4.QtGui import QApplication, QFileSystemModel, QListWidgetItem, QMainWindow, QPalette # ------------------------------------------------------------------------------------------------------------ # Imports (Custom) diff --git a/source/carla_patchbay.py b/source/carla_patchbay.py index 50c2168b0..95d09a8ed 100644 --- a/source/carla_patchbay.py +++ b/source/carla_patchbay.py @@ -16,11 +16,22 @@ # # For a full copy of the GNU General Public License see the doc/GPL.txt file. +# ------------------------------------------------------------------------------------------------------------ +# Imports (Config) + +from carla_config import * + # ------------------------------------------------------------------------------------------------------------ # Imports (Global) -from PyQt4.QtCore import QPointF, QTimer -from PyQt4.QtGui import QFrame, QGraphicsView, QGridLayout, QImage, QPrinter, QPrintDialog +if config_UseQt5: + from PyQt5.QtCore import QPointF, QTimer + from PyQt5.QtGui import QImage + from PyQt5.QtPrintSupport import QPrinter, QPrintDialog + from PyQt5.QtWidgets import QFrame, QGraphicsView, QGridLayout +else: + from PyQt4.QtCore import QPointF, QTimer + from PyQt4.QtGui import QFrame, QGraphicsView, QGridLayout, QImage, QPrinter, QPrintDialog # ------------------------------------------------------------------------------------------------------------ # Imports (Custom Stuff) diff --git a/source/carla_rack.py b/source/carla_rack.py index 3bf613222..39cf126eb 100644 --- a/source/carla_rack.py +++ b/source/carla_rack.py @@ -16,11 +16,21 @@ # # For a full copy of the GNU General Public License see the doc/GPL.txt file. +# ------------------------------------------------------------------------------------------------------------ +# Imports (Config) + +from carla_config import * + # ------------------------------------------------------------------------------------------------------------ # Imports (Global) -from PyQt4.QtCore import Qt, QSize, QTimer -from PyQt4.QtGui import QAbstractItemView, QApplication, QHBoxLayout, QLabel, QListWidget, QListWidgetItem, QPixmap, QScrollBar +if config_UseQt5: + from PyQt5.QtCore import Qt, QSize, QTimer + from PyQt5.QtGui import QPixmap + from PyQt5.QtWidgets import QAbstractItemView, QApplication, QHBoxLayout, QLabel, QListWidget, QListWidgetItem, QScrollBar +else: + from PyQt4.QtCore import Qt, QSize, QTimer + from PyQt4.QtGui import QAbstractItemView, QApplication, QHBoxLayout, QLabel, QListWidget, QListWidgetItem, QPixmap, QScrollBar # ------------------------------------------------------------------------------------------------------------ # Imports (Custom Stuff) diff --git a/source/carla_settings.py b/source/carla_settings.py index 78cf9043d..1a8cab756 100755 --- a/source/carla_settings.py +++ b/source/carla_settings.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- # Carla settings code -# Copyright (C) 2011-2013 Filipe Coelho +# Copyright (C) 2011-2014 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 @@ -16,12 +16,22 @@ # # For a full copy of the GNU General Public License see the doc/GPL.txt file. +# ------------------------------------------------------------------------------------------------------------ +# Imports (Config) + +from carla_config import * + # ------------------------------------------------------------------------------------------------------------ # Imports (Global) -from PyQt4.QtCore import pyqtSlot, QByteArray, QDir, QSettings -from PyQt4.QtGui import QColor, QCursor, QFontMetrics, QPainter, QPainterPath -from PyQt4.QtGui import QDialog, QDialogButtonBox, QFrame, QInputDialog, QLineEdit, QMenu, QVBoxLayout, QWidget +if config_UseQt5: + from PyQt5.QtCore import pyqtSlot, QByteArray, QDir, QSettings + from PyQt5.QtGui import QColor, QCursor, QFontMetrics, QPainter, QPainterPath + from PyQt5.QtWidgets import QDialog, QDialogButtonBox, QFrame, QInputDialog, QLineEdit, QMenu, QVBoxLayout, QWidget +else: + from PyQt4.QtCore import pyqtSlot, QByteArray, QDir, QSettings + from PyQt4.QtGui import QColor, QCursor, QFontMetrics, QPainter, QPainterPath + from PyQt4.QtGui import QDialog, QDialogButtonBox, QFrame, QInputDialog, QLineEdit, QMenu, QVBoxLayout, QWidget # ------------------------------------------------------------------------------------------------------------ # Imports (Custom) diff --git a/source/carla_shared.py b/source/carla_shared.py index 24c60379d..c4f9ce794 100644 --- a/source/carla_shared.py +++ b/source/carla_shared.py @@ -16,15 +16,24 @@ # # For a full copy of the GNU General Public License see the doc/GPL.txt file. +# ------------------------------------------------------------------------------------------------------------ +# Imports (Config) + +from carla_config import * + # ------------------------------------------------------------------------------------------------------------ # Imports (Global) import os import sys -from PyQt4.QtCore import qFatal, qWarning, QDir -from PyQt4.QtGui import QIcon -from PyQt4.QtGui import QFileDialog, QMessageBox +if config_UseQt5: + from PyQt5.QtCore import qFatal, qWarning, QDir + from PyQt5.QtGui import QIcon + from PyQt5.QtWidgets import QFileDialog, QMessageBox +else: + from PyQt4.QtCore import qFatal, qWarning, QDir + from PyQt4.QtGui import QFileDialog, QIcon, QMessageBox # ------------------------------------------------------------------------------------------------------------ # Import Signal @@ -46,8 +55,12 @@ from carla_backend import * # Platform specific stuff if MACOS: - from PyQt4.QtGui import qt_mac_set_menubar_icons + if config_UseQt5: + from PyQt5.QtGui import qt_mac_set_menubar_icons + else: + from PyQt4.QtGui import qt_mac_set_menubar_icons qt_mac_set_menubar_icons(False) + elif WINDOWS: WINDIR = os.getenv("WINDIR") diff --git a/source/carla_skin.py b/source/carla_skin.py index f72cd64ea..9d9d72e7d 100644 --- a/source/carla_skin.py +++ b/source/carla_skin.py @@ -16,11 +16,21 @@ # # For a full copy of the GNU General Public License see the doc/GPL.txt file. +# ------------------------------------------------------------------------------------------------------------ +# Imports (Config) + +from carla_config import * + # ------------------------------------------------------------------------------------------------------------ # Imports (Global) -from PyQt4.QtCore import Qt -from PyQt4.QtGui import QFont, QFrame, QPen, QPushButton +if config_UseQt5: + from PyQt5.QtCore import Qt + from PyQt5.QtGui import QFont, QPen + from PyQt5.QtWidgets import QFrame, QPushButton +else: + from PyQt4.QtCore import Qt + from PyQt4.QtGui import QFont, QFrame, QPen, QPushButton # ------------------------------------------------------------------------------------------------------------ # Imports (Custom) diff --git a/source/carla_style.py b/source/carla_style.py index addbb3de8..20019fdb7 100644 --- a/source/carla_style.py +++ b/source/carla_style.py @@ -16,11 +16,21 @@ # # For a full copy of the GNU General Public License see the GPL.txt file +# ------------------------------------------------------------------------------------------------------------ +# Imports (Config) + +from carla_config import * + # ------------------------------------------------------------------------------------------------------------ # Imports (Global) -from PyQt4.QtCore import QSettings -from PyQt4.QtGui import QApplication, QColor, QFont, QPalette +if config_UseQt5: + from PyQt5.QtCore import QSettings + from PyQt5.QtGui import QColor, QFont, QPalette + from PyQt5.QtWidgets import QApplication +else: + from PyQt4.QtCore import QSettings + from PyQt4.QtGui import QApplication, QColor, QFont, QPalette # ------------------------------------------------------------------------------------------------------------ # Imports (Custom) diff --git a/source/carla_widgets.py b/source/carla_widgets.py index a37365f7a..e19c4c3db 100755 --- a/source/carla_widgets.py +++ b/source/carla_widgets.py @@ -16,12 +16,22 @@ # # For a full copy of the GNU General Public License see the doc/GPL.txt file. +# ------------------------------------------------------------------------------------------------------------ +# Imports (Config) + +from carla_config import * + # ------------------------------------------------------------------------------------------------------------ # Imports (Global) -from PyQt4.QtCore import pyqtSignal, pyqtSlot, QByteArray, QSettings -from PyQt4.QtGui import QColor, QCursor, QFontMetrics, QPainter, QPainterPath -from PyQt4.QtGui import QDialog, QInputDialog, QLineEdit, QMenu, QVBoxLayout, QWidget +if config_UseQt5: + from PyQt5.QtCore import pyqtSignal, pyqtSlot, QByteArray, QSettings + from PyQt5.QtGui import QColor, QCursor, QFontMetrics, QPainter, QPainterPath + from PyQt5.QtWidgets import QDialog, QInputDialog, QLineEdit, QMenu, QVBoxLayout, QWidget +else: + from PyQt4.QtCore import pyqtSignal, pyqtSlot, QByteArray, QSettings + from PyQt4.QtGui import QColor, QCursor, QFontMetrics, QPainter, QPainterPath + from PyQt4.QtGui import QDialog, QInputDialog, QLineEdit, QMenu, QVBoxLayout, QWidget # ------------------------------------------------------------------------------------------------------------ # Imports (Custom) diff --git a/source/discovery/Makefile b/source/discovery/Makefile index 437cf25a9..a8397de93 100644 --- a/source/discovery/Makefile +++ b/source/discovery/Makefile @@ -29,7 +29,10 @@ LINK_FLAGS += $(QTCORE_LIBS) BUILD_CXX_FLAGS += -DWANT_NATIVE ifeq ($(CARLA_PLUGIN_SUPPORT),true) -BUILD_CXX_FLAGS += -DWANT_LADSPA -DWANT_DSSI -DWANT_LV2 -DWANT_VST -DWANT_VST3 -DWANT_AU +BUILD_CXX_FLAGS += -DWANT_LADSPA -DWANT_DSSI -DWANT_LV2 -DWANT_VST -DWANT_VST3 +ifeq ($(MACOS),true) +BUILD_CXX_FLAGS += -DWANT_AU +endif ifeq ($(CARLA_VESTIGE_HEADER),true) BUILD_CXX_FLAGS += -DVESTIGE_HEADER endif diff --git a/source/patchcanvas.py b/source/patchcanvas.py index fdb9250b1..dae7e71b4 100644 --- a/source/patchcanvas.py +++ b/source/patchcanvas.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- # PatchBay Canvas engine using QGraphicsView/Scene -# Copyright (C) 2010-2013 Filipe Coelho +# Copyright (C) 2010-2014 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 @@ -16,17 +16,36 @@ # # For a full copy of the GNU General Public License see the doc/GPL.txt file. +# ------------------------------------------------------------------------------------------------------------ +# Imports (Config) + +from carla_config import * + +# ------------------------------------------------------------------------------------------------------------ # Imports (Global) -from PyQt4.QtCore import pyqtSignal, pyqtSlot, qDebug, qCritical, qFatal, qWarning, Qt, QObject -from PyQt4.QtCore import QAbstractAnimation, QLineF, QPointF, QRectF, QSizeF, QSettings, QTimer -from PyQt4.QtGui import QColor, QLinearGradient, QPen, QPolygonF, QPainter, QPainterPath -from PyQt4.QtGui import QCursor, QFont, QFontMetrics -from PyQt4.QtGui import QGraphicsScene, QGraphicsItem, QGraphicsLineItem, QGraphicsPathItem -from PyQt4.QtGui import QGraphicsColorizeEffect, QGraphicsDropShadowEffect -from PyQt4.QtGui import QInputDialog, QLineEdit, QMenu -from PyQt4.QtSvg import QGraphicsSvgItem, QSvgRenderer +if config_UseQt5: + from PyQt5.QtCore import pyqtSignal, pyqtSlot, qDebug, qCritical, qFatal, qWarning, Qt, QObject + from PyQt5.QtCore import QAbstractAnimation, QLineF, QPointF, QRectF, QSizeF, QSettings, QTimer + from PyQt5.QtGui import QColor, QLinearGradient, QPen, QPolygonF, QPainter, QPainterPath + from PyQt5.QtGui import QCursor, QFont, QFontMetrics + from PyQt5.QtSvg import QGraphicsSvgItem, QSvgRenderer + from PyQt5.QtWidgets import QGraphicsScene, QGraphicsItem, QGraphicsLineItem, QGraphicsPathItem + from PyQt5.QtWidgets import QGraphicsColorizeEffect, QGraphicsDropShadowEffect + from PyQt5.QtWidgets import QInputDialog, QLineEdit, QMenu +else: + from PyQt4.QtCore import pyqtSignal, pyqtSlot, qDebug, qCritical, qFatal, qWarning, Qt, QObject + from PyQt4.QtCore import QAbstractAnimation, QLineF, QPointF, QRectF, QSizeF, QSettings, QTimer + from PyQt4.QtGui import QColor, QLinearGradient, QPen, QPolygonF, QPainter, QPainterPath + from PyQt4.QtGui import QCursor, QFont, QFontMetrics + from PyQt4.QtGui import QGraphicsScene, QGraphicsItem, QGraphicsLineItem, QGraphicsPathItem + from PyQt4.QtGui import QGraphicsColorizeEffect, QGraphicsDropShadowEffect + from PyQt4.QtGui import QInputDialog, QLineEdit, QMenu + from PyQt4.QtSvg import QGraphicsSvgItem, QSvgRenderer + +# ------------------------------------------------------------------------------------------------------------ # Imports (Theme) + from patchcanvas_theme import * # ------------------------------------------------------------------------------ diff --git a/source/patchcanvas_theme.py b/source/patchcanvas_theme.py index d149b5665..d6f09778a 100644 --- a/source/patchcanvas_theme.py +++ b/source/patchcanvas_theme.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- # PatchBay Canvas Themes -# Copyright (C) 2010-2012 Filipe Coelho +# Copyright (C) 2010-2014 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 @@ -16,11 +16,20 @@ # # For a full copy of the GNU General Public License see the doc/GPL.txt file. +# ------------------------------------------------------------------------------------------------------------ +# Imports (Config) + +from carla_config import * + # ------------------------------------------------------------------------------------------------------------ # Imports (Global) -from PyQt4.QtCore import Qt -from PyQt4.QtGui import QColor, QFont, QPen, QPixmap +if config_UseQt5: + from PyQt5.QtCore import Qt + from PyQt5.QtGui import QColor, QFont, QPen, QPixmap +else: + from PyQt4.QtCore import Qt + from PyQt4.QtGui import QColor, QFont, QPen, QPixmap # ------------------------------------------------------------------------------------------------------------ # patchcanvas-theme.cpp diff --git a/source/widgets/canvaspreviewframe.py b/source/widgets/canvaspreviewframe.py index 92175656c..6cfb3f5fa 100644 --- a/source/widgets/canvaspreviewframe.py +++ b/source/widgets/canvaspreviewframe.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- # Custom Mini Canvas Preview, a custom Qt4 widget -# Copyright (C) 2011-2013 Filipe Coelho +# Copyright (C) 2011-2014 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 @@ -16,11 +16,21 @@ # # For a full copy of the GNU General Public License see the doc/GPL.txt file. +# ------------------------------------------------------------------------------------------------------------ +# Imports (Config) + +from carla_config import * + # ------------------------------------------------------------------------------------------------------------ # Imports (Global) -from PyQt4.QtCore import pyqtSignal, Qt, QRectF, QTimer -from PyQt4.QtGui import QBrush, QColor, QCursor, QFrame, QPainter, QPen +if config_UseQt5: + from PyQt5.QtCore import pyqtSignal, Qt, QRectF, QTimer + from PyQt5.QtGui import QBrush, QColor, QCursor, QPainter, QPen + from PyQt5.QtWidgets import QFrame +else: + from PyQt4.QtCore import pyqtSignal, Qt, QRectF, QTimer + from PyQt4.QtGui import QBrush, QColor, QCursor, QFrame, QPainter, QPen # ------------------------------------------------------------------------------------------------------------ # Static Variables diff --git a/source/widgets/digitalpeakmeter.py b/source/widgets/digitalpeakmeter.py index 612f15ee3..1e6f51a5c 100644 --- a/source/widgets/digitalpeakmeter.py +++ b/source/widgets/digitalpeakmeter.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- # Digital Peak Meter, a custom Qt4 widget -# Copyright (C) 2011-2013 Filipe Coelho +# Copyright (C) 2011-2014 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 @@ -16,11 +16,21 @@ # # For a full copy of the GNU General Public License see the doc/GPL.txt file. +# ------------------------------------------------------------------------------------------------------------ +# Imports (Config) + +from carla_config import * + # ------------------------------------------------------------------------------------------------------------ # Imports (Global) -from PyQt4.QtCore import qCritical, Qt, QTimer, QSize -from PyQt4.QtGui import QColor, QLinearGradient, QPainter, QWidget +if config_UseQt5: + from PyQt5.QtCore import qCritical, Qt, QTimer, QSize + from PyQt5.QtGui import QColor, QLinearGradient, QPainter + from PyQt5.QtWidgets import QWidget +else: + from PyQt4.QtCore import qCritical, Qt, QTimer, QSize + from PyQt4.QtGui import QColor, QLinearGradient, QPainter, QWidget # ------------------------------------------------------------------------------------------------------------ # Widget Class diff --git a/source/widgets/ledbutton.py b/source/widgets/ledbutton.py index 62c8008eb..a03a12133 100644 --- a/source/widgets/ledbutton.py +++ b/source/widgets/ledbutton.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- # LED Button, a custom Qt4 widget -# Copyright (C) 2011-2013 Filipe Coelho +# Copyright (C) 2011-2014 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 @@ -16,11 +16,21 @@ # # For a full copy of the GNU General Public License see the doc/GPL.txt file. +# ------------------------------------------------------------------------------------------------------------ +# Imports (Config) + +from carla_config import * + # ------------------------------------------------------------------------------------------------------------ # Imports (Global) -from PyQt4.QtCore import qCritical, QRectF -from PyQt4.QtGui import QPainter, QPixmap, QPushButton +if config_UseQt5: + from PyQt5.QtCore import qCritical, QRectF + from PyQt5.QtGui import QPainter, QPixmap + from PyQt5.QtWidgets import QPushButton +else: + from PyQt4.QtCore import qCritical, QRectF + from PyQt4.QtGui import QPainter, QPixmap, QPushButton # ------------------------------------------------------------------------------------------------------------ # Widget Class diff --git a/source/widgets/paramspinbox.py b/source/widgets/paramspinbox.py index 8d9329326..e30a8cb05 100644 --- a/source/widgets/paramspinbox.py +++ b/source/widgets/paramspinbox.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- # Parameter SpinBox, a custom Qt4 widget -# Copyright (C) 2011-2013 Filipe Coelho +# Copyright (C) 2011-2014 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 @@ -17,14 +17,24 @@ # For a full copy of the GNU General Public License see the doc/GPL.txt file. # ------------------------------------------------------------------------------------------------------------ -# Imports (Global) +# Imports (Config) -from PyQt4.QtCore import pyqtSignal, pyqtSlot, Qt, QTimer -from PyQt4.QtGui import QAbstractSpinBox, QApplication, QComboBox, QCursor, QDialog, QMenu, QProgressBar +from carla_config import * + +# ------------------------------------------------------------------------------------------------------------ +# Imports (Global) from math import isnan from random import random +if config_UseQt5: + from PyQt5.QtCore import pyqtSignal, pyqtSlot, Qt, QTimer + from PyQt5.QtGui import QCursor + from PyQt5.QtWidgets import QAbstractSpinBox, QApplication, QComboBox, QDialog, QMenu, QProgressBar +else: + from PyQt4.QtCore import pyqtSignal, pyqtSlot, Qt, QTimer + from PyQt4.QtGui import QAbstractSpinBox, QApplication, QComboBox, QCursor, QDialog, QMenu, QProgressBar + # ------------------------------------------------------------------------------------------------------------ # Imports (Custom) diff --git a/source/widgets/pixmapbutton.py b/source/widgets/pixmapbutton.py index 382d75edf..599f6addc 100644 --- a/source/widgets/pixmapbutton.py +++ b/source/widgets/pixmapbutton.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- # Pixmap Button, a custom Qt4 widget -# Copyright (C) 2013 Filipe Coelho +# Copyright (C) 2013-2014 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 @@ -16,11 +16,21 @@ # # For a full copy of the GNU General Public License see the doc/GPL.txt file. +# ------------------------------------------------------------------------------------------------------------ +# Imports (Config) + +from carla_config import * + # ------------------------------------------------------------------------------------------------------------ # Imports (Global) -from PyQt4.QtCore import QPointF, QRectF -from PyQt4.QtGui import QColor, QFont, QPainter, QPixmap, QPushButton +if config_UseQt5: + from PyQt5.QtCore import QPointF, QRectF + from PyQt5.QtGui import QColor, QFont, QPainter, QPixmap + from PyQt5.QtWidgets import QPushButton +else: + from PyQt4.QtCore import QPointF, QRectF + from PyQt4.QtGui import QColor, QFont, QPainter, QPixmap, QPushButton # ------------------------------------------------------------------------------------------------------------ # Widget Class diff --git a/source/widgets/pixmapdial.py b/source/widgets/pixmapdial.py index 9bb850bd1..94cbf499f 100644 --- a/source/widgets/pixmapdial.py +++ b/source/widgets/pixmapdial.py @@ -17,14 +17,25 @@ # For a full copy of the GNU General Public License see the doc/GPL.txt file. # ------------------------------------------------------------------------------------------------------------ -# Imports (Global) +# Imports (Config) -from PyQt4.QtCore import Qt, QPointF, QRectF, QTimer, QSize -from PyQt4.QtGui import QColor, QConicalGradient, QFont, QFontMetrics -from PyQt4.QtGui import QDial, QLinearGradient, QPainter, QPainterPath, QPen, QPixmap +from carla_config import * + +# ------------------------------------------------------------------------------------------------------------ +# Imports (Global) from math import cos, floor, pi, sin +if config_UseQt5: + from PyQt5.QtCore import Qt, QPointF, QRectF, QTimer, QSize + from PyQt5.QtGui import QColor, QConicalGradient, QFont, QFontMetrics + from PyQt5.QtGui import QLinearGradient, QPainter, QPainterPath, QPen, QPixmap + from PyQt5.QtWidgets import QDial +else: + from PyQt4.QtCore import Qt, QPointF, QRectF, QTimer, QSize + from PyQt4.QtGui import QColor, QConicalGradient, QFont, QFontMetrics + from PyQt4.QtGui import QDial, QLinearGradient, QPainter, QPainterPath, QPen, QPixmap + # ------------------------------------------------------------------------------------------------------------ # Widget Class diff --git a/source/widgets/pixmapkeyboard.py b/source/widgets/pixmapkeyboard.py index 1af50bf65..cca32aaae 100644 --- a/source/widgets/pixmapkeyboard.py +++ b/source/widgets/pixmapkeyboard.py @@ -16,11 +16,21 @@ # # For a full copy of the GNU General Public License see the doc/GPL.txt file. +# ------------------------------------------------------------------------------------------------------------ +# Imports (Config) + +from carla_config import * + # ------------------------------------------------------------------------------------------------------------ # Imports (Global) -from PyQt4.QtCore import pyqtSignal, pyqtSlot, qCritical, Qt, QPointF, QRectF, QTimer, QSize -from PyQt4.QtGui import QColor, QFont, QPainter, QPixmap, QScrollArea, QWidget +if config_UseQt5: + from PyQt5.QtCore import pyqtSignal, pyqtSlot, qCritical, Qt, QPointF, QRectF, QTimer, QSize + from PyQt5.QtGui import QColor, QFont, QPainter, QPixmap + from PyQt5.QtWidgets import QScrollArea, QWidget +else: + from PyQt4.QtCore import pyqtSignal, pyqtSlot, qCritical, Qt, QPointF, QRectF, QTimer, QSize + from PyQt4.QtGui import QColor, QFont, QPainter, QPixmap, QScrollArea, QWidget # ------------------------------------------------------------------------------------------------------------ @@ -473,7 +483,7 @@ class PixmapKeyboardHArea(QScrollArea): if __name__ == '__main__': import sys - from PyQt4.QtGui import QApplication + from PyQt5.QtWidgets import QApplication import resources_rc app = QApplication(sys.argv)