Change actions to -A and use -b to output keybindings

This commit is contained in:
Len Ovens 2017-04-28 08:19:20 -07:00
parent cbe1f5d395
commit 620f3b9358
3 changed files with 27 additions and 4 deletions

View File

@ -688,6 +688,21 @@ ARDOUR_UI::post_engine ()
*/
if (ARDOUR_COMMAND_LINE::show_key_actions) {
stringstream sstr;
Bindings::save_all_bindings_as_html (sstr);
if (sstr.str().empty()) {
return;
}
cout << sstr.str().c_str();
halt_connection.disconnect ();
AudioEngine::instance()->stop ();
exit (0);
}
if (ARDOUR_COMMAND_LINE::show_actions) {
vector<string> paths;
@ -699,12 +714,12 @@ ARDOUR_UI::post_engine ()
string ver = ver_in.substr(0, ver_in.find("-"));
cout << "\n<h2>Menu actions</h2>" << endl;
cout << "<!-- created by running " << PROGRAM_NAME << " -b -->" << endl;
cout << "<!-- created by running " << PROGRAM_NAME << " -A -->" << endl;
cout << "<p>\n Every single menu item in " << PROGRAM_NAME << "'s GUI is accessible by control" << endl;
cout << " surfaces or scripts.\n</p>\n" << endl;
cout << "<p>\n The list below shows all available values of <em>action-name</em> as of" << endl;
cout << " " << PROGRAM_NAME << " " << ver << ". You can get the current list at any" << endl;
cout << " time by running " << PROGRAM_NAME << " with the -b flag.\n</p>\n" << endl;
cout << " time by running " << PROGRAM_NAME << " with the -A flag.\n</p>\n" << endl;
cout << "<table class=\"dl\">\n <thead>" << endl;
cout << " <tr><th>Action Name</th><th>Menu Name</th></tr>" << endl;
cout << " </thead>\n <tbody>" << endl;

View File

@ -39,6 +39,7 @@ string ARDOUR_COMMAND_LINE::session_name = "";
string ARDOUR_COMMAND_LINE::backend_client_name = "ardour";
string ARDOUR_COMMAND_LINE::backend_session_uuid;
bool ARDOUR_COMMAND_LINE::show_key_actions = false;
bool ARDOUR_COMMAND_LINE::show_actions = false;
bool ARDOUR_COMMAND_LINE::no_splash = false;
bool ARDOUR_COMMAND_LINE::just_version = false;
bool ARDOUR_COMMAND_LINE::use_vst = true;
@ -67,7 +68,8 @@ print_help (const char *execname)
<< "\n\n"
<< _("Options:\n")
<< _(" -a, --no-announcements Do not contact website for announcements\n")
<< _(" -b, --actions Print all possible menu action names\n")
<< _(" -A, --actions Print all possible menu action names\n")
<< _(" -b, --bindings Display all current key bindings\n")
<< _(" -B, --bypass-plugins Bypass all plugins in an existing session\n")
<< _(" -c, --name <name> Use a specific backend client name, default is ardour\n")
#ifndef NDEBUG
@ -116,7 +118,8 @@ ARDOUR_COMMAND_LINE::parse_opts (int argc, char *argv[])
{ "version", 0, 0, 'v' },
{ "help", 0, 0, 'h' },
{ "no-announcements", 0, 0, 'a' },
{ "actions", 0, 0, 'b' },
{ "actions", 0, 0, 'A' },
{ "bindings", 0, 0, 'b' },
{ "bypass-plugins", 0, 0, 'B' },
{ "disable-plugins", 0, 0, 'd' },
{ "debug", 1, 0, 'D' },
@ -166,6 +169,10 @@ ARDOUR_COMMAND_LINE::parse_opts (int argc, char *argv[])
check_announcements = false;
break;
case 'A':
show_actions = true;
break;
case 'b':
show_key_actions = true;
break;

View File

@ -26,6 +26,7 @@ namespace ARDOUR_COMMAND_LINE {
extern std::string session_name;
extern bool show_key_actions;
extern bool show_actions;
extern bool no_splash;
extern bool just_version;
extern std::string backend_client_name;