Browse Source

More ZynFX skin work, looking good :)

tags/1.9.4
falkTX 11 years ago
parent
commit
32de0c0e7f
7 changed files with 355 additions and 144 deletions
  1. BIN
      resources/bitmaps/dial_05d.png
  2. +1
    -0
      resources/resources.qrc
  3. +84
    -46
      resources/ui/carla_plugin_zynfx.ui
  4. +239
    -91
      source/carla_skin.py
  5. +10
    -0
      source/carla_widgets.py
  6. +7
    -0
      source/widgets/digitalpeakmeter.py
  7. +14
    -7
      source/widgets/pixmapdial.py

BIN
resources/bitmaps/dial_05d.png View File

Before After
Width: 8909  |  Height: 59  |  Size: 372KB Width: 30  |  Height: 30  |  Size: 1.8KB

+ 1
- 0
resources/resources.qrc View File

@@ -84,6 +84,7 @@
<file>bitmaps/dial_04.png</file>
<file>bitmaps/dial_04d.png</file>
<file>bitmaps/dial_05.png</file>
<file>bitmaps/dial_05d.png</file>
<file>bitmaps/kbd_h_classic.png</file>
<file>bitmaps/kbd_h_orange.png</file>
<file>bitmaps/kbd_v_classic.png</file>


+ 84
- 46
resources/ui/carla_plugin_zynfx.ui View File

@@ -6,10 +6,13 @@
<rect>
<x>0</x>
<y>0</y>
<width>397</width>
<height>72</height>
<width>458</width>
<height>75</height>
</rect>
</property>
<property name="contextMenuPolicy">
<enum>Qt::CustomContextMenu</enum>
</property>
<property name="windowTitle">
<string>Frame</string>
</property>
@@ -42,22 +45,89 @@
<widget class="DigitalPeakMeter" name="peak_in" native="true">
<property name="minimumSize">
<size>
<width>30</width>
<width>25</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>30</width>
<width>25</width>
<height>16777215</height>
</size>
</property>
</widget>
</item>
<item row="0" column="1">
<item row="0" column="4" rowspan="2">
<widget class="DigitalPeakMeter" name="peak_out" native="true">
<property name="minimumSize">
<size>
<width>25</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>25</width>
<height>16777215</height>
</size>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QWidget" name="container" native="true">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>306</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item row="1" column="3">
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>5</width>
<height>5</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="1">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>5</width>
<height>5</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="1" colspan="3">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="spacing">
<number>1</number>
<number>3</number>
</property>
<property name="margin">
<number>0</number>
@@ -169,49 +239,17 @@
</widget>
</item>
<item>
<widget class="QComboBox" name="cb_presets"/>
<widget class="QComboBox" name="cb_presets">
<property name="minimumSize">
<size>
<width>125</width>
<height>0</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="2" rowspan="2">
<widget class="DigitalPeakMeter" name="peak_out" native="true">
<property name="minimumSize">
<size>
<width>30</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>30</width>
<height>16777215</height>
</size>
</property>
<zorder>peak_in</zorder>
</widget>
</item>
<item row="1" column="1">
<widget class="QWidget" name="container" native="true">
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>5</number>
</property>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>306</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<customwidgets>


+ 239
- 91
source/carla_skin.py View File

@@ -195,6 +195,21 @@ class PluginSlot(QFrame):
def midiActivityChanged(self, onOff):
pass

def parameterValueChanged(self, parameterId, value):
pass

def programChanged(self, index):
pass

def midiProgramChanged(self, index):
pass

def notePressed(self, note):
pass

def noteReleased(self, note):
pass

#------------------------------------------------------------------

def idleFast(self):
@@ -214,6 +229,70 @@ class PluginSlot(QFrame):

#------------------------------------------------------------------

def showDefaultMenu(self, isEnabled, bEdit = None, bGui = None):
menu = QMenu(self)

actActive = menu.addAction(self.tr("Disable") if isEnabled else self.tr("Enable"))
menu.addSeparator()

if bEdit is not None:
actEdit = menu.addAction(self.tr("Edit"))
actEdit.setCheckable(True)
actEdit.setChecked(bEdit.isChecked())
else:
actEdit = None

if bGui is not None:
actGui = menu.addAction(self.tr("Show Custom UI"))
actGui.setCheckable(True)
actGui.setChecked(bGui.isChecked())
actGui.setEnabled(bGui.isEnabled())
else:
actGui = None

menu.addSeparator()
actClone = menu.addAction(self.tr("Clone"))
actRename = menu.addAction(self.tr("Rename..."))
actRemove = menu.addAction(self.tr("Remove"))

actSel = menu.exec_(QCursor.pos())

if not actSel:
return

if actSel == actActive:
self.setActive(not isEnabled, True, True)
elif actSel == actGui:
bGui.click()
elif actSel == actEdit:
bEdit.click()
elif actSel == actClone:
if Carla.host is not None and not Carla.host.clone_plugin(self.fPluginId):
CustomMessageBox(self, QMessageBox.Warning, self.tr("Error"), self.tr("Operation failed"),
Carla.host.get_last_error(), QMessageBox.Ok, QMessageBox.Ok)

elif actSel == actRename:
oldName = self.fPluginInfo['name']
newNameTry = QInputDialog.getText(self, self.tr("Rename Plugin"), self.tr("New plugin name:"), QLineEdit.Normal, oldName)

if not (newNameTry[1] and newNameTry[0] and oldName != newNameTry[0]):
return

newName = newNameTry[0]

if Carla.host is None or Carla.host.rename_plugin(self.fPluginId, newName):
self.setName(newName)
else:
CustomMessageBox(self, QMessageBox.Warning, self.tr("Error"), self.tr("Operation failed"),
Carla.host.get_last_error(), QMessageBox.Ok, QMessageBox.Ok)

elif actSel == actRemove:
if Carla.host is not None and not Carla.host.remove_plugin(self.fPluginId):
CustomMessageBox(self, QMessageBox.Warning, self.tr("Error"), self.tr("Operation failed"),
Carla.host.get_last_error(), QMessageBox.Ok, QMessageBox.Ok)

#------------------------------------------------------------------

@pyqtSlot(bool)
def slot_showCustomUi(self, show):
Carla.host.show_custom_ui(self.fPluginId, show)
@@ -319,7 +398,7 @@ class PluginSlot_Default(PluginSlot):
#------------------------------------------------------------------

def getFixedHeight(self):
return 32
return 48

#------------------------------------------------------------------

@@ -334,7 +413,9 @@ class PluginSlot_Default(PluginSlot):
#------------------------------------------------------------------

def activeChanged(self, onOff):
self.ui.b_enable.blockSignals(True)
self.ui.b_enable.setChecked(onOff)
self.ui.b_enable.blockSignals(False)

def editDialogChanged(self, visible):
self.ui.b_edit.blockSignals(True)
@@ -366,15 +447,15 @@ class PluginSlot_Default(PluginSlot):
# Input peaks
if self.fPeaksInputCount > 0:
if self.fPeaksInputCount > 1:
peak1 = Carla.host.get_input_peak_value(self.fPluginId, 1)
peak2 = Carla.host.get_input_peak_value(self.fPluginId, 2)
peak1 = Carla.host.get_input_peak_value(self.fPluginId, True)
peak2 = Carla.host.get_input_peak_value(self.fPluginId, False)
ledState = bool(peak1 != 0.0 or peak2 != 0.0)

self.ui.peak_in.displayMeter(1, peak1)
self.ui.peak_in.displayMeter(2, peak2)

else:
peak = Carla.host.get_input_peak_value(self.fPluginId, 1)
peak = Carla.host.get_input_peak_value(self.fPluginId, True)
ledState = bool(peak != 0.0)

self.ui.peak_in.displayMeter(1, peak)
@@ -386,15 +467,15 @@ class PluginSlot_Default(PluginSlot):
# Output peaks
if self.fPeaksOutputCount > 0:
if self.fPeaksOutputCount > 1:
peak1 = Carla.host.get_output_peak_value(self.fPluginId, 1)
peak2 = Carla.host.get_output_peak_value(self.fPluginId, 2)
peak1 = Carla.host.get_output_peak_value(self.fPluginId, True)
peak2 = Carla.host.get_output_peak_value(self.fPluginId, False)
ledState = bool(peak1 != 0.0 or peak2 != 0.0)

self.ui.peak_out.displayMeter(1, peak1)
self.ui.peak_out.displayMeter(2, peak2)

else:
peak = Carla.host.get_output_peak_value(self.fPluginId, 1)
peak = Carla.host.get_output_peak_value(self.fPluginId, True)
ledState = bool(peak != 0.0)

self.ui.peak_out.displayMeter(1, peak)
@@ -411,60 +492,7 @@ class PluginSlot_Default(PluginSlot):

@pyqtSlot()
def slot_showCustomMenu(self):
menu = QMenu(self)

actActive = menu.addAction(self.tr("Disable") if self.ui.b_enable.isChecked() else self.tr("Enable"))
menu.addSeparator()

actGui = menu.addAction(self.tr("Show GUI"))
actGui.setCheckable(True)
actGui.setChecked(self.ui.b_gui.isChecked())
actGui.setEnabled(self.ui.b_gui.isEnabled())

actEdit = menu.addAction(self.tr("Edit"))
actEdit.setCheckable(True)
actEdit.setChecked(self.ui.b_edit.isChecked())

menu.addSeparator()
actClone = menu.addAction(self.tr("Clone"))
actRename = menu.addAction(self.tr("Rename..."))
actRemove = menu.addAction(self.tr("Remove"))

actSel = menu.exec_(QCursor.pos())

if not actSel:
return

if actSel == actActive:
self.setActive(not self.ui.b_enable.isChecked(), True, True)
elif actSel == actGui:
self.ui.b_gui.click()
elif actSel == actEdit:
self.ui.b_edit.click()
elif actSel == actClone:
if not Carla.host.clone_plugin(self.fPluginId):
CustomMessageBox(self, QMessageBox.Warning, self.tr("Error"), self.tr("Operation failed"),
Carla.host.get_last_error(), QMessageBox.Ok, QMessageBox.Ok)

elif actSel == actRename:
oldName = self.fPluginInfo['name']
newNameTry = QInputDialog.getText(self, self.tr("Rename Plugin"), self.tr("New plugin name:"), QLineEdit.Normal, oldName)

if not (newNameTry[1] and newNameTry[0] and oldName != newNameTry[0]):
return

newName = newNameTry[0]

if Carla.host is None or Carla.host.rename_plugin(self.fPluginId, newName):
self.setName(newName)
else:
CustomMessageBox(self, QMessageBox.Warning, self.tr("Error"), self.tr("Operation failed"),
Carla.host.get_last_error(), QMessageBox.Ok, QMessageBox.Ok)

elif actSel == actRemove:
if not Carla.host.remove_plugin(self.fPluginId):
CustomMessageBox(self, QMessageBox.Warning, self.tr("Error"), self.tr("Operation failed"),
Carla.host.get_last_error(), QMessageBox.Ok, QMessageBox.Ok)
self.showDefaultMenu(self.ui.b_enable.isChecked(), self.ui.b_edit, self.ui.b_gui)

#------------------------------------------------------------------

@@ -530,17 +558,17 @@ class PluginSlot_ZynFX(PluginSlot):
background-repeat: repeat-xy;
}""")

#background-position: top left;

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.peak_in.setColor(self.ui.peak_in.GREEN)
self.ui.peak_in.setChannels(self.fPeaksInputCount)
self.ui.peak_in.setLinesEnabled(False)
self.ui.peak_in.setOrientation(self.ui.peak_in.VERTICAL)

self.ui.peak_out.setColor(self.ui.peak_in.BLUE)
self.ui.peak_out.setChannels(self.fPeaksOutputCount)
self.ui.peak_out.setLinesEnabled(False)
self.ui.peak_out.setOrientation(self.ui.peak_out.VERTICAL)

self.ui.label_name.setText(self.fPluginInfo['name'])
@@ -559,16 +587,98 @@ class PluginSlot_ZynFX(PluginSlot):
paramRanges = Carla.host.get_parameter_ranges(self.fPluginId, i)
paramValue = Carla.host.get_current_parameter_value(self.fPluginId, i)

if paramData['type'] not in (PARAMETER_INPUT, PARAMETER_OUTPUT):
if paramData['type'] != PARAMETER_INPUT:
continue

widget = PixmapDial(self)
paramName = charPtrToString(paramInfo['name'])
paramLow = paramName.lower()

# real zyn fx plugins
if self.fPluginInfo['label'] == "zynAlienWah":
if i == 0: paramName = "Freq"
elif i == 1: paramName = "Rnd"
elif i == 2: paramName = "L type" # combobox
elif i == 3: paramName = "St.df"
elif i == 5: paramName = "Fb"
elif i == 7: paramName = "L/R"

if self.fPluginInfo['label'] == "zynChorus":
if i == 0: paramName = "Freq"
elif i == 1: paramName = "Rnd"
elif i == 2: paramName = "L type" # combobox
elif i == 3: paramName = "St.df"
elif i == 6: paramName = "Fb"
elif i == 7: paramName = "L/R"
elif i == 8: paramName = "Flngr" # button
elif i == 9: paramName = "Subst" # button

elif self.fPluginInfo['label'] == "zynDistortion":
if i == 0: paramName = "LRc."
elif i == 4: paramName = "Neg." # button
elif i == 5: paramName = "LPF"
elif i == 6: paramName = "HPF"
elif i == 7: paramName = "St." # button
elif i == 8: paramName = "PF" # button

elif self.fPluginInfo['label'] == "zynDynamicFilter":
if i == 0: paramName = "Freq"
elif i == 1: paramName = "Rnd"
elif i == 2: paramName = "L type" # combobox
elif i == 3: paramName = "St.df"
elif i == 4: paramName = "LfoD"
elif i == 5: paramName = "A.S."
elif i == 6: paramName = "A.Inv." # button
elif i == 7: paramName = "A.M."

elif self.fPluginInfo['label'] == "zynEcho":
if i == 1: paramName = "LRdl."
elif i == 2: paramName = "LRc."
elif i == 3: paramName = "Fb."
elif i == 4: paramName = "Damp"

elif self.fPluginInfo['label'] == "zynPhaser":
if i == 0: paramName = "Freq"
elif i == 1: paramName = "Rnd"
elif i == 2: paramName = "L type" # combobox
elif i == 3: paramName = "St.df"
elif i == 5: paramName = "Fb"
elif i == 7: paramName = "L/R"
elif i == 8: paramName = "Subst" # button
elif i == 9: paramName = "Phase"
elif i == 11: paramName = "Dist"

elif self.fPluginInfo['label'] == "zynReverb":
if i == 2: paramName = "I.delfb"
elif i == 5: paramName = "LPF"
elif i == 6: paramName = "HPF"
elif i == 9: paramName = "R.S."
elif i == 10: paramName = "I.del"

#elif paramLow.find("damp"):
#paramName = "Damp"
#elif paramLow.find("frequency"):
#paramName = "Freq"

# Cut generic names
#elif paramName == "Depth": paramName = "Dpth"
#elif paramName == "Feedback": paramName = "Fb"
#elif paramName == "L/R Cross": #paramName = "L/R"
#elif paramName == "Random": paramName = "Rnd"

widget = PixmapDial(self, i)
widget.setPixmap(5)
widget.setLabel(charPtrToString(paramInfo['name']))
widget.setLabel(paramName)
widget.setCustomPaint(PixmapDial.CUSTOM_PAINT_NO_GRADIENT)

widget.setSingleStep(paramRanges['step']*1000)
widget.setMinimum(paramRanges['min']*1000)
widget.setMaximum(paramRanges['max']*1000)
widget.setValue(paramValue*1000)

widget.setMinimum(paramRanges['min']*100)
widget.setMaximum(paramRanges['max']*100)
widget.setValue(paramValue*100)
if (paramData['hints'] & PARAMETER_IS_ENABLED) == 0:
widget.setEnabled(False)

widget.valueChanged.connect(self.slot_parameterValueChanged)

self.ui.container.layout().insertWidget(index, widget)
index += 1
@@ -596,18 +706,23 @@ class PluginSlot_ZynFX(PluginSlot):
else:
self.fCurrentMidiProgram = -1
self.ui.cb_presets.setEnabled(False)
self.ui.cb_presets.setVisible(False)
self.ui.label_presets.setEnabled(False)
self.ui.label_presets.setVisible(False)

# -------------------------------------------------------------
# Set-up connections

self.ui.b_enable.clicked.connect(self.slot_enableClicked)
self.ui.b_edit.clicked.connect(self.slot_showEditDialog)
self.ui.cb_presets.currentIndexChanged.connect(self.slot_presetChanged)

self.customContextMenuRequested.connect(self.slot_showCustomMenu)

#------------------------------------------------------------------

def getFixedHeight(self):
return 75
return 70

#------------------------------------------------------------------

@@ -617,37 +732,64 @@ class PluginSlot_ZynFX(PluginSlot):

#------------------------------------------------------------------

def setParameterValue(self, parameterId, value):
self.parameterValueChanged(parameterId, value)
PluginSlot.setParameterValue(self, parameterId, value)

def setMidiProgram(self, index):
self.midiProgramChanged(index)
PluginSlot.setMidiProgram(self, index)

#------------------------------------------------------------------

def activeChanged(self, onOff):
self.ui.b_enable.blockSignals(True)
self.ui.b_enable.setChecked(onOff)
self.ui.b_enable.blockSignals(False)

def editDialogChanged(self, visible):
self.ui.b_edit.blockSignals(True)
self.ui.b_edit.setChecked(visible)
self.ui.b_edit.blockSignals(False)

def parameterValueChanged(self, parameterId, value):
for paramIndex, paramWidget in self.fParameterList:
if paramIndex != parameterId:
continue

paramWidget.blockSignals(True)
paramWidget.setValue(value*1000)
paramWidget.blockSignals(False)
break

def midiProgramChanged(self, index):
self.ui.cb_presets.blockSignals(True)
self.ui.cb_presets.setCurrentIndex(index)
self.ui.cb_presets.blockSignals(False)

#------------------------------------------------------------------

def idleFast(self):
# Input peaks
if self.fPeaksInputCount > 0:
if self.fPeaksInputCount > 1:
peak1 = Carla.host.get_input_peak_value(self.fPluginId, 1)
peak2 = Carla.host.get_input_peak_value(self.fPluginId, 2)
peak1 = Carla.host.get_input_peak_value(self.fPluginId, True)
peak2 = Carla.host.get_input_peak_value(self.fPluginId, False)
self.ui.peak_in.displayMeter(1, peak1)
self.ui.peak_in.displayMeter(2, peak2)
else:
peak = Carla.host.get_input_peak_value(self.fPluginId, 1)
peak = Carla.host.get_input_peak_value(self.fPluginId, True)
self.ui.peak_in.displayMeter(1, peak)

# Output peaks
if self.fPeaksOutputCount > 0:
if self.fPeaksOutputCount > 1:
peak1 = Carla.host.get_output_peak_value(self.fPluginId, 1)
peak2 = Carla.host.get_output_peak_value(self.fPluginId, 2)
peak1 = Carla.host.get_output_peak_value(self.fPluginId, True)
peak2 = Carla.host.get_output_peak_value(self.fPluginId, False)
self.ui.peak_out.displayMeter(1, peak1)
self.ui.peak_out.displayMeter(2, peak2)
else:
peak = Carla.host.get_output_peak_value(self.fPluginId, 1)
peak = Carla.host.get_output_peak_value(self.fPluginId, True)
self.ui.peak_out.displayMeter(1, peak)

#------------------------------------------------------------------
@@ -656,29 +798,35 @@ class PluginSlot_ZynFX(PluginSlot):
def slot_enableClicked(self, yesNo):
self.setActive(yesNo, False, True)

#------------------------------------------------------------------
@pyqtSlot(int)
def slot_parameterValueChanged(self, value):
index = self.sender().getIndex()
value = float(value)/1000.0

#def paintEvent(self, event):
#painter = QPainter(self)
#painter.save()
Carla.host.set_parameter_value(self.fPluginId, index, value)
PluginSlot.setParameterValue(self, index, value)

#painter.setPen(QColor(0, 0, 200))
#painter.setBrush(QColor(0, 0, 200))
#painter.drawRect(0, 0, self.width(), self.height())
@pyqtSlot(int)
def slot_presetChanged(self, index):
Carla.host.set_midi_program(self.fPluginId, index)
PluginSlot.setMidiProgram(self, index)

#painter.restore()
#PluginSlot.paintEvent(self, event)
@pyqtSlot()
def slot_showCustomMenu(self):
self.showDefaultMenu(self.ui.b_enable.isChecked(), self.ui.b_edit, None)

# ------------------------------------------------------------------------------------------------------------

def createPluginSlot(parent, pluginId):
pluginInfo = Carla.host.get_plugin_info(pluginId)
pluginInfo['label'] = charPtrToString(pluginInfo['label'])
pluginInfo['maker'] = charPtrToString(pluginInfo['maker'])
pluginInfo['iconName'] = charPtrToString(pluginInfo['iconName'])
pluginInfo = Carla.host.get_plugin_info(pluginId)
pluginLabel = charPtrToString(pluginInfo['label'])
#pluginMaker = charPtrToString(pluginInfo['maker'])
#pluginIcon = charPtrToString(pluginInfo['iconName'])

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

#return PluginSlot(parent, pluginId)
return PluginSlot_Default(parent, pluginId)
#return PluginSlot_ZynFX(parent, pluginId)

# ------------------------------------------------------------------------------------------------------------

+ 10
- 0
source/carla_widgets.py View File

@@ -1173,6 +1173,8 @@ class PluginEdit(QDialog):
def slot_parameterValueChanged(self, parameterId, value):
if Carla.host is not None:
Carla.host.set_parameter_value(self.fPluginId, parameterId, value)
if self.fRealParent is not None:
self.fRealParent.parameterValueChanged(parameterId, value)

@pyqtSlot(int, int)
def slot_parameterMidiControlChanged(self, parameterId, control):
@@ -1192,6 +1194,8 @@ class PluginEdit(QDialog):

if Carla.host is not None:
Carla.host.set_program(self.fPluginId, index)
if self.fRealParent is not None:
self.fRealParent.programChanged(index)

@pyqtSlot(int)
def slot_midiProgramIndexChanged(self, index):
@@ -1199,6 +1203,8 @@ class PluginEdit(QDialog):

if Carla.host is not None:
Carla.host.set_midi_program(self.fPluginId, index)
if self.fRealParent is not None:
self.fRealParent.midiProgramChanged(index)

#------------------------------------------------------------------

@@ -1206,11 +1212,15 @@ class PluginEdit(QDialog):
def slot_noteOn(self, note):
if self.fControlChannel >= 0 and Carla.host is not None:
Carla.host.send_midi_note(self.fPluginId, self.fControlChannel, note, 100)
if self.fRealParent is not None:
self.fRealParent.notePressed(note)

@pyqtSlot(int)
def slot_noteOff(self, note):
if self.fControlChannel >= 0 and Carla.host is not None:
Carla.host.send_midi_note(self.fPluginId, self.fControlChannel, note, 0)
if self.fRealParent is not None:
self.fRealParent.noteReleased(note)

#------------------------------------------------------------------



+ 7
- 0
source/widgets/digitalpeakmeter.py View File

@@ -38,6 +38,7 @@ class DigitalPeakMeter(QWidget):
QWidget.__init__(self, parent)

self.fChannels = 0
self.fDrawLines = True
self.fOrientation = self.VERTICAL
self.fSmoothMultiplier = 1

@@ -93,6 +94,9 @@ class DigitalPeakMeter(QWidget):

self.setOrientation(self.fOrientation)

def setLinesEnabled(self, yesNo):
self.fDrawLines = yesNo

def setOrientation(self, orientation):
self.fOrientation = orientation

@@ -177,6 +181,9 @@ class DigitalPeakMeter(QWidget):

meterX += self.fSizeMeter

if not self.fDrawLines:
return

painter.setBrush(Qt.black)

if self.fOrientation == self.HORIZONTAL:


+ 14
- 7
source/widgets/pixmapdial.py View File

@@ -30,11 +30,12 @@ from math import floor

class PixmapDial(QDial):
# enum CustomPaint
CUSTOM_PAINT_NULL = 0
CUSTOM_PAINT_CARLA_WET = 1
CUSTOM_PAINT_CARLA_VOL = 2
CUSTOM_PAINT_CARLA_L = 3
CUSTOM_PAINT_CARLA_R = 4
CUSTOM_PAINT_NULL = 0
CUSTOM_PAINT_CARLA_WET = 1
CUSTOM_PAINT_CARLA_VOL = 2
CUSTOM_PAINT_CARLA_L = 3
CUSTOM_PAINT_CARLA_R = 4
CUSTOM_PAINT_NO_GRADIENT = 5

# enum Orientation
HORIZONTAL = 0
@@ -43,9 +44,10 @@ class PixmapDial(QDial):
HOVER_MIN = 0
HOVER_MAX = 9

def __init__(self, parent):
def __init__(self, parent, index=0):
QDial.__init__(self, parent)

self.fIndex = index
self.fPixmap = QPixmap(":/bitmaps/dial_01d.png")
self.fPixmapNum = "01"
self.fCustomPaint = self.CUSTOM_PAINT_NULL
@@ -80,6 +82,9 @@ class PixmapDial(QDial):

self.updateSizes()

def getIndex(self):
return self.fIndex

def getSize(self):
return self.fSize

@@ -95,6 +100,9 @@ class PixmapDial(QDial):
self.update()
QDial.setEnabled(self, enabled)

def setIndex(self, index):
self.fIndex = index

def setLabel(self, label):
self.fLabel = label

@@ -296,4 +304,3 @@ class PixmapDial(QDial):
def resizeEvent(self, event):
self.updateSizes()
QDial.resizeEvent(self, event)


Loading…
Cancel
Save