diff --git a/c++/widgets/pixmapkeyboard.cpp b/c++/widgets/pixmapkeyboard.cpp index 1c2af78..08c13fa 100644 --- a/c++/widgets/pixmapkeyboard.cpp +++ b/c++/widgets/pixmapkeyboard.cpp @@ -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)) diff --git a/c++/widgets/pixmapkeyboard.h b/c++/widgets/pixmapkeyboard.h index f25a6f3..1e84b3c 100644 --- a/c++/widgets/pixmapkeyboard.h +++ b/c++/widgets/pixmapkeyboard.h @@ -38,6 +38,7 @@ public: PixmapKeyboard(QWidget* parent); + void allNotesOff(); void sendNoteOn(int note, bool sendSignal=true); void sendNoteOff(int note, bool sendSignal=true); diff --git a/src/pixmapkeyboard.py b/src/pixmapkeyboard.py index 99db4bc..264d86b 100644 --- a/src/pixmapkeyboard.py +++ b/src/pixmapkeyboard.py @@ -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) diff --git a/src/shared_carla.py b/src/shared_carla.py index a2a4f30..e6e58bb 100644 --- a/src/shared_carla.py +++ b/src/shared_carla.py @@ -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)