summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2017-09-14 19:00:08 +0200
committerRobin Gareus <robin@gareus.org>2017-09-14 19:23:37 +0200
commit315792b215aca2446c48b7a840d744d8662ff980 (patch)
treeae85cea9a5f759d81e0461d69c25761bff2b3197
parent14fcf86f037b9c66b2d7575e798fe07e4b2614d0 (diff)
Fix patch-change auto-audition
-rw-r--r--gtk2_ardour/patch_change_widget.cc12
-rw-r--r--gtk2_ardour/patch_change_widget.h2
2 files changed, 8 insertions, 6 deletions
diff --git a/gtk2_ardour/patch_change_widget.cc b/gtk2_ardour/patch_change_widget.cc
index 5d8f77b13c..75f42ea546 100644
--- a/gtk2_ardour/patch_change_widget.cc
+++ b/gtk2_ardour/patch_change_widget.cc
@@ -466,7 +466,7 @@ PatchChangeWidget::audition_next ()
piano_keyboard_set_note_off (_piano, _audition_note_num);
return ++_audition_note_num <= _audition_end_spin.get_value_as_int() && _audition_enable.get_active ();
} else {
- note_on_event_handler (_audition_note_num);
+ note_on_event_handler (_audition_note_num, true);
piano_keyboard_set_note_on (_piano, _audition_note_num);
return true;
}
@@ -475,7 +475,7 @@ PatchChangeWidget::audition_next ()
void
PatchChangeWidget::_note_on_event_handler(GtkWidget*, int note, gpointer arg)
{
- ((PatchChangeWidget*)arg)->note_on_event_handler(note);
+ ((PatchChangeWidget*)arg)->note_on_event_handler(note, false);
}
void
@@ -485,10 +485,12 @@ PatchChangeWidget::_note_off_event_handler(GtkWidget*, int note, gpointer arg)
}
void
-PatchChangeWidget::note_on_event_handler (int note)
+PatchChangeWidget::note_on_event_handler (int note, bool for_audition)
{
- cancel_audition ();
- _pianomm->grab_focus ();
+ if (!for_audition) {
+ cancel_audition ();
+ _pianomm->grab_focus ();
+ }
uint8_t event[3];
event[0] = (MIDI_CMD_NOTE_ON | _channel);
event[1] = note;
diff --git a/gtk2_ardour/patch_change_widget.h b/gtk2_ardour/patch_change_widget.h
index dcd5eaa171..e1df94c0d0 100644
--- a/gtk2_ardour/patch_change_widget.h
+++ b/gtk2_ardour/patch_change_widget.h
@@ -104,7 +104,7 @@ private:
static void _note_on_event_handler (GtkWidget*, int, gpointer);
static void _note_off_event_handler (GtkWidget*, int, gpointer);
- void note_on_event_handler (int);
+ void note_on_event_handler (int, bool for_audition);
void note_off_event_handler (int);
};