@@ -113,6 +113,16 @@ PixmapKeyboard::PixmapKeyboard(QWidget* parent) | |||||
setMode(HORIZONTAL); | 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) | void PixmapKeyboard::sendNoteOn(int note, bool sendSignal) | ||||
{ | { | ||||
if (0 <= note && note <= 127 && ! m_enabledKeys.contains(note)) | if (0 <= note && note <= 127 && ! m_enabledKeys.contains(note)) | ||||
@@ -38,6 +38,7 @@ public: | |||||
PixmapKeyboard(QWidget* parent); | PixmapKeyboard(QWidget* parent); | ||||
void allNotesOff(); | |||||
void sendNoteOn(int note, bool sendSignal=true); | void sendNoteOn(int note, bool sendSignal=true); | ||||
void sendNoteOff(int note, bool sendSignal=true); | void sendNoteOff(int note, bool sendSignal=true); | ||||
@@ -104,6 +104,14 @@ class PixmapKeyboard(QWidget): | |||||
self.setCursor(Qt.PointingHandCursor) | self.setCursor(Qt.PointingHandCursor) | ||||
self.setMode(self.HORIZONTAL) | 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): | def sendNoteOn(self, note, sendSignal=True): | ||||
if 0 <= note <= 127 and note not in self.m_enabledKeys: | if 0 <= note <= 127 and note not in self.m_enabledKeys: | ||||
self.m_enabledKeys.append(note) | self.m_enabledKeys.append(note) | ||||
@@ -1323,6 +1323,9 @@ class PluginWidget(QFrame, ui_carla_plugin.Ui_PluginWidget): | |||||
if sendGui: self.led_enable.setChecked(active) | if sendGui: self.led_enable.setChecked(active) | ||||
if sendCallback: Carla.Host.set_active(self.m_pluginId, 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): | def set_drywet(self, value, sendGui=False, sendCallback=True): | ||||
if sendGui: self.dial_drywet.setValue(value) | if sendGui: self.dial_drywet.setValue(value) | ||||
if sendCallback: Carla.Host.set_drywet(self.m_pluginId, float(value)/1000) | if sendCallback: Carla.Host.set_drywet(self.m_pluginId, float(value)/1000) | ||||