diff --git a/Makefile b/Makefile index 532818918..4352652ea 100644 --- a/Makefile +++ b/Makefile @@ -100,6 +100,7 @@ UIs = \ source/ui_carla_parameter.py \ source/ui_carla_plugin_default.py \ source/ui_carla_plugin_calf.py \ + source/ui_carla_plugin_zita.py \ source/ui_carla_plugin_zynfx.py \ source/ui_carla_refresh.py \ source/ui_carla_settings.py \ diff --git a/resources/bitmaps/dial_06.png b/resources/bitmaps/dial_06.png new file mode 100644 index 000000000..3b70cdc53 Binary files /dev/null and b/resources/bitmaps/dial_06.png differ diff --git a/resources/bitmaps/dial_06d.png b/resources/bitmaps/dial_06d.png new file mode 100644 index 000000000..cef7847ae Binary files /dev/null and b/resources/bitmaps/dial_06d.png differ diff --git a/resources/bitmaps/zita/ambsect.png b/resources/bitmaps/zita/ambsect.png new file mode 100644 index 000000000..82596958f Binary files /dev/null and b/resources/bitmaps/zita/ambsect.png differ diff --git a/resources/bitmaps/zita/eq1sect.png b/resources/bitmaps/zita/eq1sect.png new file mode 100644 index 000000000..7ddc95a92 Binary files /dev/null and b/resources/bitmaps/zita/eq1sect.png differ diff --git a/resources/bitmaps/zita/eq2sect.png b/resources/bitmaps/zita/eq2sect.png new file mode 100644 index 000000000..fdab8d69c Binary files /dev/null and b/resources/bitmaps/zita/eq2sect.png differ diff --git a/resources/bitmaps/zita/mixsect.png b/resources/bitmaps/zita/mixsect.png new file mode 100644 index 000000000..f7a34c01c Binary files /dev/null and b/resources/bitmaps/zita/mixsect.png differ diff --git a/resources/bitmaps/zita/redzita.png b/resources/bitmaps/zita/redzita.png new file mode 100644 index 000000000..62b676df1 Binary files /dev/null and b/resources/bitmaps/zita/redzita.png differ diff --git a/resources/bitmaps/zita/revsect.png b/resources/bitmaps/zita/revsect.png new file mode 100644 index 000000000..d7e20586d Binary files /dev/null and b/resources/bitmaps/zita/revsect.png differ diff --git a/resources/resources.qrc b/resources/resources.qrc index a2ba3df2c..4af5a2426 100644 --- a/resources/resources.qrc +++ b/resources/resources.qrc @@ -92,6 +92,8 @@ bitmaps/dial_04d.png bitmaps/dial_05.png bitmaps/dial_05d.png + bitmaps/dial_06.png + bitmaps/dial_06d.png bitmaps/kbd_h_dark.png bitmaps/kbd_v_dark.png @@ -113,6 +115,13 @@ bitmaps/style/arrow.png bitmaps/style/groupbox.png + bitmaps/zita/ambsect.png + bitmaps/zita/eq1sect.png + bitmaps/zita/eq2sect.png + bitmaps/zita/mixsect.png + bitmaps/zita/redzita.png + bitmaps/zita/revsect.png + scalable/pb_generic.svg scalable/pb_hardware.svg scalable/pb_plugin.svg diff --git a/resources/ui/carla_plugin_zita.ui b/resources/ui/carla_plugin_zita.ui new file mode 100644 index 000000000..215bf0d13 --- /dev/null +++ b/resources/ui/carla_plugin_zita.ui @@ -0,0 +1,150 @@ + + + PluginWidget + + + + 0 + 0 + 640 + 75 + + + + Qt::CustomContextMenu + + + Frame + + + + 0 + + + 0 + + + + + + 315 + 75 + + + + + 315 + 75 + + + + + 0 + + + 0 + + + + + + + + + 110 + 75 + + + + + 110 + 75 + + + + + 0 + + + 0 + + + + + + + + + 110 + 75 + + + + + 110 + 75 + + + + + 0 + + + 0 + + + + + + + + + 70 + 75 + + + + + 70 + 75 + + + + + 0 + + + 0 + + + + + + + + + 35 + 75 + + + + + 35 + 75 + + + + + 0 + + + 0 + + + + + + + + + diff --git a/source/carla_skin.py b/source/carla_skin.py index 94cf80f99..5229f12bd 100644 --- a/source/carla_skin.py +++ b/source/carla_skin.py @@ -26,6 +26,7 @@ from PyQt4.QtGui import QFont, QFrame import ui_carla_plugin_default import ui_carla_plugin_calf +import ui_carla_plugin_zita import ui_carla_plugin_zynfx from carla_widgets import * @@ -611,6 +612,25 @@ class PluginSlot_Pixmap(PluginSlot_Default): background-repeat: repeat-xy; }""") + #if (self.pinfo['category'] == PLUGIN_CATEGORY_SYNTH): + #self.set_plugin_widget_color(PALETTE_COLOR_WHITE) + #elif (self.pinfo['category'] == PLUGIN_CATEGORY_DELAY): + #self.set_plugin_widget_color(PALETTE_COLOR_ORANGE) + #elif (self.pinfo['category'] == PLUGIN_CATEGORY_EQ): + #self.set_plugin_widget_color(PALETTE_COLOR_GREEN) + #elif (self.pinfo['category'] == PLUGIN_CATEGORY_FILTER): + #self.set_plugin_widget_color(PALETTE_COLOR_BLUE) + #elif (self.pinfo['category'] == PLUGIN_CATEGORY_DYNAMICS): + #self.set_plugin_widget_color(PALETTE_COLOR_PINK) + #elif (self.pinfo['category'] == PLUGIN_CATEGORY_MODULATOR): + #self.set_plugin_widget_color(PALETTE_COLOR_RED) + #elif (self.pinfo['category'] == PLUGIN_CATEGORY_UTILITY): + #self.set_plugin_widget_color(PALETTE_COLOR_YELLOW) + #elif (self.pinfo['category'] == PLUGIN_CATEGORY_OUTRO): + #self.set_plugin_widget_color(PALETTE_COLOR_BROWN) + #else: + #self.set_plugin_widget_color(PALETTE_COLOR_NONE) + #------------------------------------------------------------------ def paintEvent(self, event): @@ -715,6 +735,110 @@ class PluginSlot_Calf(AbstractPluginSlot): # ------------------------------------------------------------------------------------------------------------ +class PluginSlot_Zita(AbstractPluginSlot): + def __init__(self, parent, pluginId): + AbstractPluginSlot.__init__(self, parent, pluginId) + self.ui = ui_carla_plugin_zita.Ui_PluginWidget() + self.ui.setupUi(self) + + # ------------------------------------------------------------- + # Internal stuff + + audioCount = Carla.host.get_audio_port_count_info(self.fPluginId) if Carla.host is not None else {'ins': 2, 'outs': 2 } + + # ------------------------------------------------------------- + # Set-up GUI + + self.setStyleSheet(""" + QFrame#PluginWidget { + background-color: #404040; + } + QWidget#w_revsect { + background-image: url(:/bitmaps/zita/revsect.png); + } + QWidget#w_eq1sect { + background-image: url(:/bitmaps/zita/eq1sect.png); + } + QWidget#w_eq2sect { + background-image: url(:/bitmaps/zita/eq2sect.png); + } + QWidget#w_ambmixsect { + background-image: url(:/bitmaps/zita/%s.png); + } + QWidget#w_redzita { + background-image: url(:/bitmaps/zita/redzita.png); + } + """ % ("mixsect" if audioCount['outs'] == 2 else "ambsect")) + + # ------------------------------------------------------------- + # Set-up Knobs + + self.fKnobDelay = PixmapDial(self, 0) + self.fKnobDelay.setPixmap(6) + self.fKnobDelay.setCustomPaint(PixmapDial.CUSTOM_PAINT_ZITA) + + self.fKnobXover = PixmapDial(self, 1) + self.fKnobXover.setPixmap(6) + self.fKnobXover.setCustomPaint(PixmapDial.CUSTOM_PAINT_ZITA) + + self.fKnobRtLow = PixmapDial(self, 2) + self.fKnobRtLow.setPixmap(6) + self.fKnobRtLow.setCustomPaint(PixmapDial.CUSTOM_PAINT_ZITA) + + self.fKnobRtMid = PixmapDial(self, 3) + self.fKnobRtMid.setPixmap(6) + self.fKnobRtMid.setCustomPaint(PixmapDial.CUSTOM_PAINT_ZITA) + + self.fKnobDamping = PixmapDial(self, 4) + self.fKnobDamping.setPixmap(6) + self.fKnobDamping.setCustomPaint(PixmapDial.CUSTOM_PAINT_ZITA) + + self.fKnobEq1Freq = PixmapDial(self, 5) + self.fKnobEq1Freq.setPixmap(6) + self.fKnobEq1Freq.setCustomPaint(PixmapDial.CUSTOM_PAINT_ZITA) + + self.fKnobEq1Gain = PixmapDial(self, 6) + self.fKnobEq1Gain.setPixmap(6) + self.fKnobEq1Gain.setCustomPaint(PixmapDial.CUSTOM_PAINT_ZITA) + + self.fKnobEq2Freq = PixmapDial(self, 7) + self.fKnobEq2Freq.setPixmap(6) + self.fKnobEq2Freq.setCustomPaint(PixmapDial.CUSTOM_PAINT_ZITA) + + self.fKnobEq2Gain = PixmapDial(self, 8) + self.fKnobEq2Gain.setPixmap(6) + self.fKnobEq2Gain.setCustomPaint(PixmapDial.CUSTOM_PAINT_ZITA) + + self.fKnobMix = PixmapDial(self, 9) + self.fKnobMix.setPixmap(6) + self.fKnobMix.setCustomPaint(PixmapDial.CUSTOM_PAINT_ZITA) + + # ------------------------------------------------------------- + + self.ready() + + self.customContextMenuRequested.connect(self.slot_showDefaultCustomMenu) + + #------------------------------------------------------------------ + + def getFixedHeight(self): + return 75 + + def resizeEvent(self, event): + self.fKnobDelay.move(self.ui.w_revsect.x()+31, 33) + self.fKnobXover.move(self.ui.w_revsect.x()+93, 18) + self.fKnobRtLow.move(self.ui.w_revsect.x()+148, 18) + self.fKnobRtMid.move(self.ui.w_revsect.x()+208, 18) + self.fKnobDamping.move(self.ui.w_revsect.x()+268, 18) + self.fKnobEq1Freq.move(self.ui.w_eq1sect.x()+20, 33) + self.fKnobEq1Gain.move(self.ui.w_eq1sect.x()+69, 18) + self.fKnobEq2Freq.move(self.ui.w_eq2sect.x()+20, 33) + self.fKnobEq2Gain.move(self.ui.w_eq2sect.x()+69, 18) + self.fKnobMix.move(self.ui.w_ambmixsect.x()+24, 33) + AbstractPluginSlot.resizeEvent(self, event) + +# ------------------------------------------------------------------------------------------------------------ + class PluginSlot_ZynFX(AbstractPluginSlot): def __init__(self, parent, pluginId): AbstractPluginSlot.__init__(self, parent, pluginId) @@ -948,6 +1072,10 @@ def createPluginSlot(parent, pluginId): if pluginLabel.startswith("zyn") and pluginInfo['category'] != PLUGIN_CATEGORY_SYNTH: return PluginSlot_ZynFX(parent, pluginId) + if pluginInfo['type'] == PLUGIN_LADSPA: + if pluginLabel == "zita-reverb" or pluginLabel == "zita-reverb-amb": + return PluginSlot_Zita(parent, pluginId) + if pluginName.split(" ", 1)[0].lower() == "calf": return PluginSlot_Calf(parent, pluginId) diff --git a/source/widgets/pixmapdial.py b/source/widgets/pixmapdial.py index 0808d31d0..d52c0c6be 100644 --- a/source/widgets/pixmapdial.py +++ b/source/widgets/pixmapdial.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- # Pixmap Dial, 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 @@ -23,7 +23,7 @@ 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 math import floor +from math import cos, floor, pi, sin # ------------------------------------------------------------------------------------------------------------ # Widget Class @@ -35,7 +35,8 @@ class PixmapDial(QDial): CUSTOM_PAINT_CARLA_VOL = 2 CUSTOM_PAINT_CARLA_L = 3 CUSTOM_PAINT_CARLA_R = 4 - CUSTOM_PAINT_NO_GRADIENT = 5 + CUSTOM_PAINT_ZITA = 5 + CUSTOM_PAINT_NO_GRADIENT = 6 # enum Orientation HORIZONTAL = 0 @@ -286,6 +287,18 @@ class PixmapDial(QDial): painter.setPen(QPen(color, 2)) painter.drawArc(3.5, 4.5, 22.0, 22.0, startAngle, spanAngle) + # Custom knobs (Zita) + elif self.fCustomPaint == self.CUSTOM_PAINT_ZITA: + a = value * pi * 3 / 2 + 4.0 + r = 11.0 + x = 11.5 + y = 11.5 + x += r * sin(a) + y -= r * cos(a) + painter.setBrush(Qt.black) + painter.setPen(QPen(Qt.black, 2)) + painter.drawLine(QPointF(r, r), QPointF(x, y)) + # Custom knobs else: painter.restore()