|
|
@@ -26,11 +26,11 @@ from carla_config import * |
|
|
|
|
|
|
|
if config_UseQt5: |
|
|
|
from PyQt5.QtCore import Qt, QRectF |
|
|
|
from PyQt5.QtGui import QFont, QPen, QPixmap |
|
|
|
from PyQt5.QtGui import QFont, QFontDatabase, QPen, QPixmap |
|
|
|
from PyQt5.QtWidgets import QFrame, QPushButton |
|
|
|
else: |
|
|
|
from PyQt4.QtCore import Qt, QRectF |
|
|
|
from PyQt4.QtGui import QFont, QFrame, QPen, QPixmap, QPushButton |
|
|
|
from PyQt4.QtGui import QFont, QFontDatabase, QFrame, QPen, QPixmap, QPushButton |
|
|
|
|
|
|
|
# ------------------------------------------------------------------------------------------------------------ |
|
|
|
# Imports (Custom) |
|
|
@@ -51,15 +51,25 @@ def getParameterShortName(paramName): |
|
|
|
paramName = paramName.split("/",1)[0].split(" (",1)[0].split(" [",1)[0].strip() |
|
|
|
paramLow = paramName.lower() |
|
|
|
|
|
|
|
if paramLow.startswith("compressor "): |
|
|
|
paramName = paramName.replace("ompressor ", ".", 1) |
|
|
|
paramLow = paramName.lower() |
|
|
|
|
|
|
|
# Cut generic names |
|
|
|
if "bandwidth" in paramLow: |
|
|
|
if "attack" in paramLow: |
|
|
|
paramName = paramName.replace("ttack", "tk") |
|
|
|
elif "bandwidth" in paramLow: |
|
|
|
paramName = paramName.replace("andwidth", "w") |
|
|
|
elif "damping" in paramLow: |
|
|
|
paramName = paramName.replace("amping", "amp") |
|
|
|
elif "distortion" in paramLow: |
|
|
|
paramName = paramName.replace("istortion", "ist") |
|
|
|
elif "feedback" in paramLow: |
|
|
|
paramName = paramName.replace("eedback", "b") |
|
|
|
elif "frequency" in paramLow: |
|
|
|
paramName = paramName.replace("requency", "req") |
|
|
|
elif "makeup" in paramLow: |
|
|
|
paramName = paramName.replace("akeup", "kUp" if "Make" in paramName else "kup") |
|
|
|
elif "output" in paramLow: |
|
|
|
paramName = paramName.replace("utput", "ut") |
|
|
|
elif "random" in paramLow: |
|
|
@@ -1071,6 +1081,135 @@ class PluginSlot_BasicFX(AbstractPluginSlot): |
|
|
|
|
|
|
|
# ------------------------------------------------------------------------------------------------------------ |
|
|
|
|
|
|
|
class PluginSlot_OpenAV(AbstractPluginSlot): |
|
|
|
def __init__(self, parent, host, pluginId): |
|
|
|
AbstractPluginSlot.__init__(self, parent, host, pluginId) |
|
|
|
self.ui = ui_carla_plugin_basic_fx.Ui_PluginWidget() |
|
|
|
self.ui.setupUi(self) |
|
|
|
|
|
|
|
# ------------------------------------------------------------- |
|
|
|
# Set-up GUI |
|
|
|
|
|
|
|
QFontDatabase.addApplicationFont(":/fonts/uranium.ttf") |
|
|
|
|
|
|
|
labelFont = QFont() |
|
|
|
labelFont.setFamily("Uranium") |
|
|
|
labelFont.setPointSize(13) |
|
|
|
labelFont.setCapitalization(QFont.AllUppercase) |
|
|
|
self.ui.label_name.setFont(labelFont) |
|
|
|
|
|
|
|
self.setStyleSheet(""" |
|
|
|
PluginSlot_OpenAV#PluginWidget { |
|
|
|
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, |
|
|
|
stop: 0 #303030, stop: 0.35 #111111, stop: 1.0 #111111); |
|
|
|
} |
|
|
|
""") |
|
|
|
|
|
|
|
self.ui.label_name.setStyleSheet("* { color: #FF5100; }") |
|
|
|
#self.ui.line.setStyleSheet("* { background-color: #FF5100; color: #FF5100; }") |
|
|
|
|
|
|
|
self.ui.b_enable.setPixmaps(":/bitmaps/button_off.png", ":/bitmaps/button_on.png", ":/bitmaps/button_off.png") |
|
|
|
self.ui.b_edit.setPixmaps(":/bitmaps/button_edit.png", ":/bitmaps/button_edit_down.png", ":/bitmaps/button_edit_hover.png") |
|
|
|
self.ui.b_gui.setPixmaps(":/bitmaps/button_gui.png", ":/bitmaps/button_gui_down.png", ":/bitmaps/button_gui_hover.png") |
|
|
|
|
|
|
|
# ------------------------------------------------------------- |
|
|
|
# Set-up parameters |
|
|
|
|
|
|
|
parameterCount = self.host.get_parameter_count(self.fPluginId) |
|
|
|
|
|
|
|
index = 0 |
|
|
|
for i in range(parameterCount): |
|
|
|
if index >= 8: |
|
|
|
break |
|
|
|
|
|
|
|
paramInfo = self.host.get_parameter_info(self.fPluginId, i) |
|
|
|
paramData = self.host.get_parameter_data(self.fPluginId, i) |
|
|
|
paramRanges = self.host.get_parameter_ranges(self.fPluginId, i) |
|
|
|
|
|
|
|
if paramData['type'] != PARAMETER_INPUT: |
|
|
|
continue |
|
|
|
if paramData['hints'] & PARAMETER_IS_BOOLEAN: |
|
|
|
continue |
|
|
|
if (paramData['hints'] & PARAMETER_IS_ENABLED) == 0: |
|
|
|
continue |
|
|
|
|
|
|
|
paramName = getParameterShortName(paramInfo['name']) |
|
|
|
|
|
|
|
widget = PixmapDial(self, i) |
|
|
|
widget.setPixmap(11) |
|
|
|
widget.setLabel(paramName) |
|
|
|
widget.setCustomPaintMode(PixmapDial.CUSTOM_PAINT_MODE_NO_GRADIENT) |
|
|
|
widget.setMinimum(paramRanges['min']) |
|
|
|
widget.setMaximum(paramRanges['max']) |
|
|
|
|
|
|
|
if (paramData['hints'] & PARAMETER_IS_ENABLED) == 0: |
|
|
|
widget.setEnabled(False) |
|
|
|
|
|
|
|
self.ui.w_knobs.layout().insertWidget(index, widget) |
|
|
|
index += 1 |
|
|
|
|
|
|
|
self.fParameterList.append([i, widget]) |
|
|
|
|
|
|
|
self.ui.dial_drywet.setIndex(PARAMETER_DRYWET) |
|
|
|
self.ui.dial_drywet.setPixmap(11) |
|
|
|
self.ui.dial_drywet.setLabel("Dry/Wet") |
|
|
|
self.ui.dial_drywet.setCustomPaintMode(PixmapDial.CUSTOM_PAINT_MODE_NO_GRADIENT) |
|
|
|
self.ui.dial_drywet.setMinimum(0.0) |
|
|
|
self.ui.dial_drywet.setMaximum(1.0) |
|
|
|
self.ui.dial_drywet.setVisible(self.fPluginInfo['hints'] & PLUGIN_CAN_DRYWET) |
|
|
|
|
|
|
|
self.ui.dial_vol.setIndex(PARAMETER_VOLUME) |
|
|
|
self.ui.dial_vol.setPixmap(11) |
|
|
|
self.ui.dial_vol.setLabel("Volume") |
|
|
|
self.ui.dial_vol.setCustomPaintMode(PixmapDial.CUSTOM_PAINT_MODE_NO_GRADIENT) |
|
|
|
self.ui.dial_vol.setMinimum(0.0) |
|
|
|
self.ui.dial_vol.setMaximum(1.27) |
|
|
|
self.ui.dial_vol.setVisible(self.fPluginInfo['hints'] & PLUGIN_CAN_VOLUME) |
|
|
|
|
|
|
|
self.fParameterList.append([PARAMETER_DRYWET, self.ui.dial_drywet]) |
|
|
|
self.fParameterList.append([PARAMETER_VOLUME, self.ui.dial_vol]) |
|
|
|
|
|
|
|
# ------------------------------------------------------------- |
|
|
|
|
|
|
|
self.b_enable = self.ui.b_enable |
|
|
|
self.b_gui = self.ui.b_gui |
|
|
|
self.b_edit = self.ui.b_edit |
|
|
|
|
|
|
|
self.label_name = self.ui.label_name |
|
|
|
|
|
|
|
self.led_control = self.ui.led_control |
|
|
|
self.led_midi = self.ui.led_midi |
|
|
|
self.led_audio_in = self.ui.led_audio_in |
|
|
|
self.led_audio_out = self.ui.led_audio_out |
|
|
|
|
|
|
|
self.peak_in = self.ui.peak_in |
|
|
|
self.peak_out = self.ui.peak_out |
|
|
|
|
|
|
|
self.ready() |
|
|
|
|
|
|
|
self.customContextMenuRequested.connect(self.slot_showDefaultCustomMenu) |
|
|
|
|
|
|
|
#------------------------------------------------------------------ |
|
|
|
|
|
|
|
def getFixedHeight(self): |
|
|
|
return 79 |
|
|
|
|
|
|
|
#------------------------------------------------------------------ |
|
|
|
|
|
|
|
def paintEvent(self, event): |
|
|
|
painter = QPainter(self) |
|
|
|
painter.setBrush(Qt.transparent) |
|
|
|
|
|
|
|
painter.setPen(QPen(QColor(42, 42, 42), 1)) |
|
|
|
painter.drawRect(0, 1, self.width()-1, 79-3) |
|
|
|
|
|
|
|
painter.setPen(QPen(QColor(60, 60, 60), 1)) |
|
|
|
painter.drawLine(0, 0, self.width(), 0) |
|
|
|
|
|
|
|
AbstractPluginSlot.paintEvent(self, event) |
|
|
|
|
|
|
|
# ------------------------------------------------------------------------------------------------------------ |
|
|
|
|
|
|
|
class PluginSlot_Calf(AbstractPluginSlot): |
|
|
|
def __init__(self, parent, host, pluginId): |
|
|
|
AbstractPluginSlot.__init__(self, parent, host, pluginId) |
|
|
@@ -1655,6 +1794,9 @@ def createPluginSlot(parent, host, pluginId, useSkins): |
|
|
|
|
|
|
|
#pluginIcon = pluginInfo['iconName'] |
|
|
|
|
|
|
|
if pluginMaker == "OpenAV Productions": |
|
|
|
return PluginSlot_OpenAV(parent, host, pluginId) |
|
|
|
|
|
|
|
if pluginInfo['type'] == PLUGIN_INTERNAL: |
|
|
|
if pluginLabel.startswith("zyn") and pluginInfo['category'] != PLUGIN_CATEGORY_SYNTH: |
|
|
|
return PluginSlot_ZynFX(parent, host, pluginId) |
|
|
|