From ae88abff333f9fac9f03e7247556b4a3251c2278 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Tue, 1 Sep 2015 15:46:48 -0400 Subject: [PATCH] use newer API to show all actions and bindings with -b --- gtk2_ardour/ardour_ui.cc | 37 ++++++++++++++----------------------- 1 file changed, 14 insertions(+), 23 deletions(-) diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 6e6afbb758..6782442708 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -592,33 +592,24 @@ ARDOUR_UI::post_engine () if (ARDOUR_COMMAND_LINE::show_key_actions) { - cerr << "Dump actions from " << ActionMap::action_maps.size() << " action maps\n"; - for (list::const_iterator map = ActionMap::action_maps.begin(); map != ActionMap::action_maps.end(); ++map) { + vector paths; + vector labels; + vector tooltips; + vector keys; + vector > actions; + + Gtkmm2ext::ActionMap::get_all_actions (paths, labels, tooltips, keys, actions); - Bindings* bindings = (*map)->bindings(); - - ActionMap::Actions actions; + vector::iterator k; + vector::iterator p; - (*map)->get_actions (actions); + for (p = paths.begin(), k = keys.begin(); p != paths.end(); ++k, ++p) { - for (ActionMap::Actions::const_iterator act = actions.begin(); act != actions.end(); ++act) { - - if (bindings) { - - KeyboardKey key; - Bindings::Operation op; - - key = bindings->get_binding_for_action (*act, op); - - if (key == KeyboardKey::null_key()) { - cout << Bindings::ardour_action_name (*act) << endl; - } else { - cout << Bindings::ardour_action_name (*act) << " => " << key.display_label() << endl; - } - } else { - cout << Bindings::ardour_action_name (*act) << endl; - } + if ((*k).empty()) { + cout << *p << endl; + } else { + cout << *p << " => " << *k << endl; } }