Browse Source

Add "None" to Parameter MIDI CC menu

tags/1.9.4
falkTX 11 years ago
parent
commit
30f209b3f4
1 changed files with 13 additions and 4 deletions
  1. +13
    -4
      source/carla_shared.py

+ 13
- 4
source/carla_shared.py View File

@@ -1032,19 +1032,28 @@ class PluginParameter(QWidget):
def slot_controlSpinboxCustomMenu(self):
menu = QMenu(self)

actNone = menu.addAction(self.tr("None"))

if self.fMidiControl == -1:
actNone.setCheckable(True)
actNone.setChecked(True)

for cc in MIDI_CC_LIST:
action = menu.addAction(cc)

if int(cc.split(" ")[0], 16) == self.fMidiControl:
if self.fMidiControl != -1 and int(cc.split(" ")[0], 16) == self.fMidiControl:
action.setCheckable(True)
action.setChecked(True)

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

if actSel:
selControlStr = actSel.text()
selControl = int(selControlStr.split(" ")[0], 16)
self.ui.sb_control.setValue(selControl)
if actSel == actNone:
self.ui.sb_control.setValue(-1)
else:
selControlStr = actSel.text()
selControl = int(selControlStr.split(" ")[0], 16)
self.ui.sb_control.setValue(selControl)

@pyqtSlot(int)
def slot_controlSpinboxChanged(self, control):


Loading…
Cancel
Save