Vkeybd: force release notes on panic

If key(s) are still being pressed, a key-repeat will re-trigger
the most recently pressed note (depending on keyboard settings).
This commit is contained in:
Robin Gareus 2019-12-26 12:17:20 +01:00
parent b228dce1c1
commit b942eecc9c
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
3 changed files with 9 additions and 0 deletions

View File

@ -1044,6 +1044,13 @@ APianoKeyboard::sustain_release ()
}
}
void
APianoKeyboard::reset ()
{
sustain_release ();
stop_unsustained_notes ();
}
void
APianoKeyboard::set_note_on (int note)
{

View File

@ -52,6 +52,7 @@ public:
void set_note_on (int note);
void set_note_off (int note);
void reset ();
void set_grand_piano_highlight (bool enabled);
void set_annotate_layout (bool enabled);

View File

@ -398,6 +398,7 @@ VirtualKeyboardWindow::update_octave_range ()
bool
VirtualKeyboardWindow::send_panic_message (GdkEventButton*)
{
_piano.reset ();
uint8_t channel = PBD::atoi (_midi_channel.get_text ()) - 1;
uint8_t ev[3];
ev[0] = MIDI_CMD_CONTROL | channel;