Browse Source

PixmapKeyboard: Add allNotesOff() call, use it in Carla/Control

tags/v0.9.0
falkTX 12 years ago
parent
commit
664d1d5905
4 changed files with 22 additions and 0 deletions
  1. +10
    -0
      c++/widgets/pixmapkeyboard.cpp
  2. +1
    -0
      c++/widgets/pixmapkeyboard.h
  3. +8
    -0
      src/pixmapkeyboard.py
  4. +3
    -0
      src/shared_carla.py

+ 10
- 0
c++/widgets/pixmapkeyboard.cpp View File

@@ -113,6 +113,16 @@ PixmapKeyboard::PixmapKeyboard(QWidget* parent)
setMode(HORIZONTAL);
}

void PixmapKeyboard::allNotesOff()
{
m_enabledKeys.clear();

m_needsUpdate = true;
QTimer::singleShot(0, this, SLOT(updateOnce()));

emit notesOff();
}

void PixmapKeyboard::sendNoteOn(int note, bool sendSignal)
{
if (0 <= note && note <= 127 && ! m_enabledKeys.contains(note))


+ 1
- 0
c++/widgets/pixmapkeyboard.h View File

@@ -38,6 +38,7 @@ public:

PixmapKeyboard(QWidget* parent);

void allNotesOff();
void sendNoteOn(int note, bool sendSignal=true);
void sendNoteOff(int note, bool sendSignal=true);



+ 8
- 0
src/pixmapkeyboard.py View File

@@ -104,6 +104,14 @@ class PixmapKeyboard(QWidget):
self.setCursor(Qt.PointingHandCursor)
self.setMode(self.HORIZONTAL)

def allNotesOff(self):
self.m_enabledKeys = []

self.m_needsUpdate = True
QTimer.singleShot(0, self, SLOT("slot_updateOnce()"))

self.emit(SIGNAL("notesOff()"))

def sendNoteOn(self, note, sendSignal=True):
if 0 <= note <= 127 and note not in self.m_enabledKeys:
self.m_enabledKeys.append(note)


+ 3
- 0
src/shared_carla.py View File

@@ -1323,6 +1323,9 @@ class PluginWidget(QFrame, ui_carla_plugin.Ui_PluginWidget):
if sendGui: self.led_enable.setChecked(active)
if sendCallback: Carla.Host.set_active(self.m_pluginId, active)

if active:
self.edit_dialog.keyboard.allNotesOff()

def set_drywet(self, value, sendGui=False, sendCallback=True):
if sendGui: self.dial_drywet.setValue(value)
if sendCallback: Carla.Host.set_drywet(self.m_pluginId, float(value)/1000)


Loading…
Cancel
Save