Browse Source

Initial OpenAV plugin skin

tags/1.9.5
falkTX 10 years ago
parent
commit
2560cabaef
6 changed files with 151 additions and 3 deletions
  1. BIN
      resources/bitmaps/dial_11.png
  2. BIN
      resources/bitmaps/dial_11d.png
  3. BIN
      resources/fonts/uranium.ttf
  4. +4
    -0
      resources/resources.qrc
  5. +145
    -3
      source/carla_skin.py
  6. +2
    -0
      source/widgets/pixmapdial.py

BIN
resources/bitmaps/dial_11.png View File

Before After
Width: 32  |  Height: 4128  |  Size: 71KB

BIN
resources/bitmaps/dial_11d.png View File

Before After
Width: 32  |  Height: 32  |  Size: 879B

BIN
resources/fonts/uranium.ttf View File


+ 4
- 0
resources/resources.qrc View File

@@ -98,6 +98,8 @@
<file>bitmaps/dial_09d.png</file> <file>bitmaps/dial_09d.png</file>
<file>bitmaps/dial_10.png</file> <file>bitmaps/dial_10.png</file>
<file>bitmaps/dial_10d.png</file> <file>bitmaps/dial_10d.png</file>
<file>bitmaps/dial_11.png</file>
<file>bitmaps/dial_11d.png</file>


<file>bitmaps/kbd_h_dark.png</file> <file>bitmaps/kbd_h_dark.png</file>
<file>bitmaps/kbd_v_dark.png</file> <file>bitmaps/kbd_v_dark.png</file>
@@ -142,5 +144,7 @@
<file>scalable/pb_jamin.svg</file> <file>scalable/pb_jamin.svg</file>
<file>scalable/pb_mplayer.svg</file> <file>scalable/pb_mplayer.svg</file>
<file>scalable/pb_vlc.svg</file> <file>scalable/pb_vlc.svg</file>

<file>fonts/uranium.ttf</file>
</qresource> </qresource>
</RCC> </RCC>

+ 145
- 3
source/carla_skin.py View File

@@ -26,11 +26,11 @@ from carla_config import *


if config_UseQt5: if config_UseQt5:
from PyQt5.QtCore import Qt, QRectF 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 from PyQt5.QtWidgets import QFrame, QPushButton
else: else:
from PyQt4.QtCore import Qt, QRectF 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) # Imports (Custom)
@@ -51,15 +51,25 @@ def getParameterShortName(paramName):
paramName = paramName.split("/",1)[0].split(" (",1)[0].split(" [",1)[0].strip() paramName = paramName.split("/",1)[0].split(" (",1)[0].split(" [",1)[0].strip()
paramLow = paramName.lower() paramLow = paramName.lower()


if paramLow.startswith("compressor "):
paramName = paramName.replace("ompressor ", ".", 1)
paramLow = paramName.lower()

# Cut generic names # 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") paramName = paramName.replace("andwidth", "w")
elif "damping" in paramLow:
paramName = paramName.replace("amping", "amp")
elif "distortion" in paramLow: elif "distortion" in paramLow:
paramName = paramName.replace("istortion", "ist") paramName = paramName.replace("istortion", "ist")
elif "feedback" in paramLow: elif "feedback" in paramLow:
paramName = paramName.replace("eedback", "b") paramName = paramName.replace("eedback", "b")
elif "frequency" in paramLow: elif "frequency" in paramLow:
paramName = paramName.replace("requency", "req") paramName = paramName.replace("requency", "req")
elif "makeup" in paramLow:
paramName = paramName.replace("akeup", "kUp" if "Make" in paramName else "kup")
elif "output" in paramLow: elif "output" in paramLow:
paramName = paramName.replace("utput", "ut") paramName = paramName.replace("utput", "ut")
elif "random" in paramLow: 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): class PluginSlot_Calf(AbstractPluginSlot):
def __init__(self, parent, host, pluginId): def __init__(self, parent, host, pluginId):
AbstractPluginSlot.__init__(self, parent, host, pluginId) AbstractPluginSlot.__init__(self, parent, host, pluginId)
@@ -1655,6 +1794,9 @@ def createPluginSlot(parent, host, pluginId, useSkins):


#pluginIcon = pluginInfo['iconName'] #pluginIcon = pluginInfo['iconName']


if pluginMaker == "OpenAV Productions":
return PluginSlot_OpenAV(parent, host, pluginId)

if pluginInfo['type'] == PLUGIN_INTERNAL: if pluginInfo['type'] == PLUGIN_INTERNAL:
if pluginLabel.startswith("zyn") and pluginInfo['category'] != PLUGIN_CATEGORY_SYNTH: if pluginLabel.startswith("zyn") and pluginInfo['category'] != PLUGIN_CATEGORY_SYNTH:
return PluginSlot_ZynFX(parent, host, pluginId) return PluginSlot_ZynFX(parent, host, pluginId)


+ 2
- 0
source/widgets/pixmapdial.py View File

@@ -161,6 +161,8 @@ class PixmapDial(QDial):


if self.fPixmapNum in ("01", "02", "07", "08", "09", "10"): if self.fPixmapNum in ("01", "02", "07", "08", "09", "10"):
self.fLabelPos.setY(self.fPixmapBaseSize + self.fLabelHeight) self.fLabelPos.setY(self.fPixmapBaseSize + self.fLabelHeight)
elif self.fPixmapNum in ("11",):
self.fLabelPos.setY(self.fPixmapBaseSize + self.fLabelHeight*2/3)
else: else:
self.fLabelPos.setY(self.fPixmapBaseSize + self.fLabelHeight/2) self.fLabelPos.setY(self.fPixmapBaseSize + self.fLabelHeight/2)




Loading…
Cancel
Save