Browse Source

Initial skin for zita-rev

tags/1.9.4
falkTX 11 years ago
parent
commit
e8741106cc
13 changed files with 304 additions and 3 deletions
  1. +1
    -0
      Makefile
  2. BIN
      resources/bitmaps/dial_06.png
  3. BIN
      resources/bitmaps/dial_06d.png
  4. BIN
      resources/bitmaps/zita/ambsect.png
  5. BIN
      resources/bitmaps/zita/eq1sect.png
  6. BIN
      resources/bitmaps/zita/eq2sect.png
  7. BIN
      resources/bitmaps/zita/mixsect.png
  8. BIN
      resources/bitmaps/zita/redzita.png
  9. BIN
      resources/bitmaps/zita/revsect.png
  10. +9
    -0
      resources/resources.qrc
  11. +150
    -0
      resources/ui/carla_plugin_zita.ui
  12. +128
    -0
      source/carla_skin.py
  13. +16
    -3
      source/widgets/pixmapdial.py

+ 1
- 0
Makefile View File

@@ -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 \


BIN
resources/bitmaps/dial_06.png View File

Before After
Width: 21  |  Height: 21  |  Size: 882B

BIN
resources/bitmaps/dial_06d.png View File

Before After
Width: 21  |  Height: 21  |  Size: 882B

BIN
resources/bitmaps/zita/ambsect.png View File

Before After
Width: 70  |  Height: 75  |  Size: 2.4KB

BIN
resources/bitmaps/zita/eq1sect.png View File

Before After
Width: 110  |  Height: 75  |  Size: 3.4KB

BIN
resources/bitmaps/zita/eq2sect.png View File

Before After
Width: 110  |  Height: 75  |  Size: 3.6KB

BIN
resources/bitmaps/zita/mixsect.png View File

Before After
Width: 70  |  Height: 75  |  Size: 2.7KB

BIN
resources/bitmaps/zita/redzita.png View File

Before After
Width: 35  |  Height: 75  |  Size: 1.2KB

BIN
resources/bitmaps/zita/revsect.png View File

Before After
Width: 315  |  Height: 75  |  Size: 7.9KB

+ 9
- 0
resources/resources.qrc View File

@@ -92,6 +92,8 @@
<file>bitmaps/dial_04d.png</file>
<file>bitmaps/dial_05.png</file>
<file>bitmaps/dial_05d.png</file>
<file>bitmaps/dial_06.png</file>
<file>bitmaps/dial_06d.png</file>

<file>bitmaps/kbd_h_dark.png</file>
<file>bitmaps/kbd_v_dark.png</file>
@@ -113,6 +115,13 @@
<file>bitmaps/style/arrow.png</file>
<file>bitmaps/style/groupbox.png</file>

<file>bitmaps/zita/ambsect.png</file>
<file>bitmaps/zita/eq1sect.png</file>
<file>bitmaps/zita/eq2sect.png</file>
<file>bitmaps/zita/mixsect.png</file>
<file>bitmaps/zita/redzita.png</file>
<file>bitmaps/zita/revsect.png</file>

<file>scalable/pb_generic.svg</file>
<file>scalable/pb_hardware.svg</file>
<file>scalable/pb_plugin.svg</file>


+ 150
- 0
resources/ui/carla_plugin_zita.ui View File

@@ -0,0 +1,150 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PluginWidget</class>
<widget class="QFrame" name="PluginWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>640</width>
<height>75</height>
</rect>
</property>
<property name="contextMenuPolicy">
<enum>Qt::CustomContextMenu</enum>
</property>
<property name="windowTitle">
<string>Frame</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_6">
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="QWidget" name="w_revsect" native="true">
<property name="minimumSize">
<size>
<width>315</width>
<height>75</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>315</width>
<height>75</height>
</size>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<number>0</number>
</property>
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="w_eq1sect" native="true">
<property name="minimumSize">
<size>
<width>110</width>
<height>75</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>110</width>
<height>75</height>
</size>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<number>0</number>
</property>
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="w_eq2sect" native="true">
<property name="minimumSize">
<size>
<width>110</width>
<height>75</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>110</width>
<height>75</height>
</size>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<number>0</number>
</property>
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="w_ambmixsect" native="true">
<property name="minimumSize">
<size>
<width>70</width>
<height>75</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>70</width>
<height>75</height>
</size>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<number>0</number>
</property>
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="w_redzita" native="true">
<property name="minimumSize">
<size>
<width>35</width>
<height>75</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>35</width>
<height>75</height>
</size>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<number>0</number>
</property>
</layout>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

+ 128
- 0
source/carla_skin.py View File

@@ -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)



+ 16
- 3
source/widgets/pixmapdial.py View File

@@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-

# Pixmap Dial, a custom Qt4 widget
# Copyright (C) 2011-2013 Filipe Coelho <falktx@falktx.com>
# Copyright (C) 2011-2014 Filipe Coelho <falktx@falktx.com>
#
# 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()


Loading…
Cancel
Save