diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2015-09-01 13:54:45 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2016-02-22 15:31:24 -0500 |
commit | 20ba651af4c3a68ce254e6c0254f875fd3d0ba91 (patch) | |
tree | 2c83252c194e495821db063af61c9055468b6bac /gtk2_ardour | |
parent | 09f90208976f64f2ecac7977beb9d8c4b6896d21 (diff) |
fix up code to print all available actions and existing key bindings
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/ardour_ui.cc | 37 |
1 files changed, 25 insertions, 12 deletions
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 30113ece44..6e6afbb758 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -592,20 +592,33 @@ ARDOUR_UI::post_engine () if (ARDOUR_COMMAND_LINE::show_key_actions) { - for (list<Bindings*>::const_iterator mb = Bindings::bindings.begin(); mb != Bindings::bindings.end(); ++mb) { - - vector<string> names; - vector<string> paths; - vector<string> keys; + cerr << "Dump actions from " << ActionMap::action_maps.size() << " action maps\n"; + + for (list<ActionMap*>::const_iterator map = ActionMap::action_maps.begin(); map != ActionMap::action_maps.end(); ++map) { -#warning Paul fix this before tabbed is merged - // mb->second->get_all_actions (names, paths, keys); + Bindings* bindings = (*map)->bindings(); - vector<string>::iterator n; - vector<string>::iterator k; - vector<string>::iterator p; - for (n = names.begin(), k = keys.begin(), p = paths.begin(); n != names.end(); ++n, ++k, ++p) { - cout << "Action: '" << (*n) << "' bound to '" << (*k) << "' Path: '" << (*p) << "'" << endl; + ActionMap::Actions actions; + + (*map)->get_actions (actions); + + 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; + } } } |