From 9ee4c14bce711b92656ddc7d3272cb690614db32 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sat, 15 Jan 2022 13:15:38 -0700 Subject: [PATCH] generic MIDI: extend menu options to drop ALL MIDI bindings, not just a binding map --- libs/surfaces/generic_midi/generic_midi_control_protocol.h | 2 +- libs/surfaces/generic_midi/gmcp_gui.cc | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/libs/surfaces/generic_midi/generic_midi_control_protocol.h b/libs/surfaces/generic_midi/generic_midi_control_protocol.h index 4b8f7c9d7b..14b3e807e4 100644 --- a/libs/surfaces/generic_midi/generic_midi_control_protocol.h +++ b/libs/surfaces/generic_midi/generic_midi_control_protocol.h @@ -96,6 +96,7 @@ public: int load_bindings (const std::string&); void drop_bindings (); + void drop_all (); void check_used_event (int, int); @@ -174,7 +175,6 @@ private: MIDIAction* create_action (const XMLNode&); void reset_controllables (); - void drop_all (); enum ConnectionState { InputConnected = 0x1, diff --git a/libs/surfaces/generic_midi/gmcp_gui.cc b/libs/surfaces/generic_midi/gmcp_gui.cc index dbaa57ad7e..b9e4239859 100644 --- a/libs/surfaces/generic_midi/gmcp_gui.cc +++ b/libs/surfaces/generic_midi/gmcp_gui.cc @@ -148,6 +148,7 @@ GMCPGUI::GMCPGUI (GenericMidiControlProtocol& p) sort (popdowns.begin(), popdowns.end(), less()); popdowns.insert (popdowns.begin(), _("Reset All")); + popdowns.insert (popdowns.begin(), _("Drop Bindings")); set_popdown_strings (map_combo, popdowns); @@ -269,6 +270,8 @@ GMCPGUI::binding_changed () string str = map_combo.get_active_text (); if (str == _("Reset All")) { + cp.drop_all (); + } else if (str == _("Drop Bindings")) { cp.drop_bindings (); } else { for (list::iterator x = cp.map_info.begin(); x != cp.map_info.end(); ++x) {