| @@ -395,3 +395,5 @@ endif | |||
| else | |||
| @echo "ZynAddSubFX:$(ANS_NO) $(mS)fftw-3, mxml or zlib missing$(mE)" | |||
| endif | |||
| # -------------------------------------------------------------- | |||
| @@ -1,6 +1,6 @@ | |||
| #!/usr/bin/make -f | |||
| # Makefile for carla backend and standalone # | |||
| # ----------------------------------------- # | |||
| # Makefile for carla backend # | |||
| # -------------------------- # | |||
| # Created by falkTX | |||
| # | |||
| @@ -9,17 +9,17 @@ include ../Makefile.mk | |||
| # -------------------------------------------------------------- | |||
| all: | |||
| # $(MAKE) -C control | |||
| $(MAKE) -C engine | |||
| $(MAKE) -C plugin | |||
| $(MAKE) -C native | |||
| $(MAKE) -C standalone | |||
| # -------------------------------------------------------------- | |||
| clean: | |||
| # $(MAKE) clean -C control | |||
| $(MAKE) clean -C engine | |||
| $(MAKE) clean -C plugin | |||
| $(MAKE) clean -C native | |||
| $(MAKE) clean -C standalone | |||
| # -------------------------------------------------------------- | |||
| @@ -24,6 +24,10 @@ BUILD_CXX_FLAGS += -DVESTIGE_HEADER | |||
| endif | |||
| endif | |||
| ifeq ($(CARLA_CSOUND_SUPPORT),true) | |||
| BUILD_CXX_FLAGS += -DWANT_CSOUND | |||
| endif | |||
| ifeq ($(CARLA_RTAUDIO_SUPPORT),true) | |||
| BUILD_CXX_FLAGS += -DWANT_RTAUDIO | |||
| endif | |||
| @@ -59,3 +63,5 @@ ifeq ($(HAVE_ZYN_UI_DEPS),true) | |||
| BUILD_CXX_FLAGS += -DWANT_ZYNADDSUBFX_UI | |||
| endif | |||
| endif | |||
| # -------------------------------------------------------------- | |||
| @@ -229,3 +229,4 @@ class DigitalPeakMeter(QWidget): | |||
| def resizeEvent(self, event): | |||
| self.updateSizes() | |||
| QWidget.resizeEvent(self, event) | |||
| @@ -19,9 +19,7 @@ | |||
| # ------------------------------------------------------------------------------------------------------------ | |||
| # Imports (Global) | |||
| # TODO - SIGNAL, SLOT | |||
| from PyQt5.QtCore import pyqtSlot, Qt, QTimer | |||
| from PyQt5.QtCore import pyqtSignal, pyqtSlot, Qt, QTimer | |||
| from PyQt5.QtGui import QCursor | |||
| from PyQt5.QtWidgets import QAbstractSpinBox, QApplication, QComboBox, QDialog, QMenu, QProgressBar | |||
| from math import isnan | |||
| @@ -71,7 +69,7 @@ class CustomInputDialog(QDialog): | |||
| self.fRetValue = current | |||
| #self.connect(self, SIGNAL("accepted()"), SLOT("slot_setReturnValue()")) | |||
| self.accepted.connect(self.slot_setReturnValue) | |||
| def returnValue(self): | |||
| return self.fRetValue | |||
| @@ -88,6 +86,9 @@ class CustomInputDialog(QDialog): | |||
| # ProgressBar used for ParamSpinBox | |||
| class ParamProgressBar(QProgressBar): | |||
| # signals | |||
| valueChanged = pyqtSignal(float) | |||
| def __init__(self, parent): | |||
| QProgressBar.__init__(self, parent) | |||
| @@ -140,7 +141,7 @@ class ParamProgressBar(QProgressBar): | |||
| elif value > self.fMaximum: | |||
| value = self.fMaximum | |||
| #self.emit(SIGNAL("valueChanged(double)"), value) | |||
| self.valueChanged.emit(value) | |||
| def mousePressEvent(self, event): | |||
| if event.button() == Qt.LeftButton: | |||
| @@ -171,6 +172,9 @@ class ParamProgressBar(QProgressBar): | |||
| # Special SpinBox used for parameters | |||
| class ParamSpinBox(QAbstractSpinBox): | |||
| # signals | |||
| valueChanged = pyqtSignal(float) | |||
| def __init__(self, parent): | |||
| QAbstractSpinBox.__init__(self, parent) | |||
| @@ -178,9 +182,9 @@ class ParamSpinBox(QAbstractSpinBox): | |||
| self.fMaximum = 1.0 | |||
| self.fDefault = 0.0 | |||
| self.fValue = None | |||
| self.fStep = 0.0 | |||
| self.fStepSmall = 0.0 | |||
| self.fStepLarge = 0.0 | |||
| self.fStep = 0.01 | |||
| self.fStepSmall = 0.0001 | |||
| self.fStepLarge = 0.1 | |||
| self.fReadOnly = False | |||
| self.fScalePoints = None | |||
| @@ -194,10 +198,10 @@ class ParamSpinBox(QAbstractSpinBox): | |||
| self.lineEdit().setVisible(False) | |||
| #self.connect(self, SIGNAL("customContextMenuRequested(QPoint)"), SLOT("slot_showCustomMenu()")) | |||
| #self.connect(self.fBar, SIGNAL("valueChanged(double)"), SLOT("slot_progressBarValueChanged(double)")) | |||
| self.customContextMenuRequested.connect(self.slot_showCustomMenu) | |||
| self.fBar.valueChanged.connect(self.slot_progressBarValueChanged) | |||
| #QTimer.singleShot(0, self, SLOT("slot_updateProgressBarGeometry()")) | |||
| QTimer.singleShot(0, self.slot_updateProgressBarGeometry) | |||
| def setDefault(self, value): | |||
| value = fixValue(value, self.fMinimum, self.fMaximum) | |||
| @@ -223,8 +227,8 @@ class ParamSpinBox(QAbstractSpinBox): | |||
| if self.fHaveScalePoints: | |||
| self._setScalePointValue(value) | |||
| #if send: | |||
| #self.emit(SIGNAL("valueChanged(double)"), value) | |||
| if send: | |||
| self.valueChanged.emit(value) | |||
| self.update() | |||
| @@ -320,7 +324,7 @@ class ParamSpinBox(QAbstractSpinBox): | |||
| if self.fValue != None: | |||
| self._setScalePointValue(self.fValue) | |||
| #self.connect(self.fBox, SIGNAL("currentIndexChanged(QString)"), SLOT("slot_comboBoxIndexChanged(QString)")) | |||
| self.fBox.currentIndexChanged.connect(self.slot_comboBoxIndexChanged) | |||
| def stepBy(self, steps): | |||
| if steps == 0 or self.fValue is None: | |||
| @@ -351,7 +355,7 @@ class ParamSpinBox(QAbstractSpinBox): | |||
| self.fBox.update() | |||
| def resizeEvent(self, event): | |||
| #QTimer.singleShot(0, self, SLOT("slot_updateProgressBarGeometry()")) | |||
| QTimer.singleShot(0, self.slot_updateProgressBarGeometry) | |||
| QAbstractSpinBox.resizeEvent(self, event) | |||
| @pyqtSlot(str) | |||
| @@ -19,8 +19,6 @@ | |||
| # ------------------------------------------------------------------------------------------------------------ | |||
| # Imports (Global) | |||
| # TODO - SLOTS | |||
| from math import floor | |||
| from PyQt5.QtCore import Qt, QPointF, QRectF, QTimer, QSize | |||
| from PyQt5.QtGui import QColor, QConicalGradient, QFont, QFontMetrics | |||
| @@ -52,7 +50,7 @@ class PixmapDial(QDial): | |||
| self.fPixmapNum = "01" | |||
| self.fCustomPaint = self.CUSTOM_PAINT_NULL | |||
| self.fHovered = False | |||
| self.fIsHovered = False | |||
| self.fHoverStep = self.HOVER_MIN | |||
| if self.fPixmap.width() > self.fPixmap.height(): | |||
| @@ -155,21 +153,21 @@ class PixmapDial(QDial): | |||
| self.setMaximumSize(self.fSize, self.fSize + self.fLabelHeight + 5) | |||
| def enterEvent(self, event): | |||
| self.fHovered = True | |||
| self.fIsHovered = True | |||
| if self.fHoverStep == self.HOVER_MIN: | |||
| self.fHoverStep = self.HOVER_MIN + 1 | |||
| QDial.enterEvent(self, event) | |||
| def leaveEvent(self, event): | |||
| self.fHovered = False | |||
| self.fIsHovered = False | |||
| if self.fHoverStep == self.HOVER_MAX: | |||
| self.fHoverStep = self.HOVER_MAX - 1 | |||
| QDial.leaveEvent(self, event) | |||
| def paintEvent(self, event): | |||
| painter = QPainter(self) | |||
| event.accept() | |||
| painter = QPainter(self) | |||
| painter.save() | |||
| painter.setRenderHint(QPainter.Antialiasing, True) | |||
| @@ -280,9 +278,14 @@ class PixmapDial(QDial): | |||
| painter.setPen(QPen(color, 2)) | |||
| painter.drawArc(3.5, 4.5, 22.0, 22.0, startAngle, spanAngle) | |||
| # Custom knobs | |||
| else: | |||
| painter.restore() | |||
| return | |||
| if self.HOVER_MIN < self.fHoverStep < self.HOVER_MAX: | |||
| self.fHoverStep += 1 if self.fHovered else -1 | |||
| QTimer.singleShot(20, self, SLOT("update()")) | |||
| self.fHoverStep += 1 if self.fIsHovered else -1 | |||
| QTimer.singleShot(20, self.update) | |||
| else: # isEnabled() | |||
| target = QRectF(0.0, 0.0, self.fSize, self.fSize) | |||
| @@ -293,3 +296,4 @@ class PixmapDial(QDial): | |||
| def resizeEvent(self, event): | |||
| self.updateSizes() | |||
| QDial.resizeEvent(self, event) | |||
| @@ -19,9 +19,7 @@ | |||
| # ------------------------------------------------------------------------------------------------------------ | |||
| # Imports (Global) | |||
| # TODO - SIGNAL, SLOT | |||
| from PyQt5.QtCore import pyqtSlot, qCritical, Qt, QPointF, QRectF, QTimer | |||
| from PyQt5.QtCore import pyqtSignal, qCritical, Qt, QPointF, QRectF, QSize | |||
| from PyQt5.QtGui import QFont, QPainter, QPixmap | |||
| from PyQt5.QtWidgets import QWidget | |||
| @@ -100,6 +98,12 @@ class PixmapKeyboard(QWidget): | |||
| HORIZONTAL = 0 | |||
| VERTICAL = 1 | |||
| # signals | |||
| noteOn = pyqtSignal(int) | |||
| noteOff = pyqtSignal(int) | |||
| notesOn = pyqtSignal() | |||
| notesOff = pyqtSignal() | |||
| def __init__(self, parent): | |||
| QWidget.__init__(self, parent) | |||
| @@ -114,10 +118,12 @@ class PixmapKeyboard(QWidget): | |||
| self.setCursor(Qt.PointingHandCursor) | |||
| self.setMode(self.HORIZONTAL) | |||
| def allNotesOff(self): | |||
| def allNotesOff(self, sendSignal=True): | |||
| self.fEnabledKeys = [] | |||
| self.emit(SIGNAL("notesOff()")) | |||
| if sendSignal: | |||
| self.notesOff.emit() | |||
| self.update() | |||
| def sendNoteOn(self, note, sendSignal=True): | |||
| @@ -125,24 +131,24 @@ class PixmapKeyboard(QWidget): | |||
| self.fEnabledKeys.append(note) | |||
| if sendSignal: | |||
| self.emit(SIGNAL("noteOn(int)"), note) | |||
| self.noteOn.emit(note) | |||
| self.update() | |||
| if len(self.fEnabledKeys) == 1: | |||
| self.emit(SIGNAL("notesOn()")) | |||
| self.notesOn.emit() | |||
| def sendNoteOff(self, note, sendSignal=True): | |||
| if 0 <= note <= 127 and note in self.fEnabledKeys: | |||
| self.fEnabledKeys.remove(note) | |||
| if sendSignal: | |||
| self.emit(SIGNAL("noteOff(int)"), note) | |||
| self.noteOff.emit(note) | |||
| self.update() | |||
| if len(self.fEnabledKeys) == 0: | |||
| self.emit(SIGNAL("notesOff()")) | |||
| self.notesOff.emit() | |||
| def setMode(self, mode, color=COLOR_ORANGE): | |||
| if color == self.COLOR_CLASSIC: | |||
| @@ -243,6 +249,17 @@ class PixmapKeyboard(QWidget): | |||
| self.fLastMouseNote = note | |||
| def minimumSizeHint(self): | |||
| return QSize(self.fWidth, self.fHeight) | |||
| def sizeHint(self): | |||
| if self.fPixmapMode == self.HORIZONTAL: | |||
| return QSize(self.fWidth * self.fOctaves, self.fHeight) | |||
| elif self.fPixmapMode == self.VERTICAL: | |||
| return QSize(self.fWidth, self.fHeight * self.fOctaves) | |||
| else: | |||
| return QSize(self.fWidth, self.fHeight) | |||
| def keyPressEvent(self, event): | |||
| if not event.isAutoRepeat(): | |||
| qKey = str(event.key()) | |||