X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fardour_ui.cc;h=d01a92ebf659c43a74f8eb22e2d9e9b964134004;hb=0b189a576670a49693331e00ad8e8626f5826af7;hp=14a0ff9f1b25d8a930c52e68b31b7e77baf85381;hpb=41493d556a66cdb481d7c39d29a3cdb7773d1531;p=ardour.git diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 14a0ff9f1b..d01a92ebf6 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -95,6 +95,7 @@ #include "ardour/profile.h" #include "ardour/recent_sessions.h" #include "ardour/record_enable_control.h" +#include "ardour/revision.h" #include "ardour/session_directory.h" #include "ardour/session_route.h" #include "ardour/session_state_utils.h" @@ -687,6 +688,55 @@ 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; + } + gchar* file_name; + GError *err = NULL; + gint fd; + + if ((fd = g_file_open_tmp ("akprintXXXXXX.html", &file_name, &err)) < 0) { + if (err) { + error << string_compose (_("Could not open temporary file to print bindings (%1)"), err->message) << endmsg; + g_error_free (err); + } + return; + } + +#ifdef PLATFORM_WINDOWS + ::close (fd); +#endif + + err = NULL; + + if (!g_file_set_contents (file_name, sstr.str().c_str(), sstr.str().size(), &err)) { +#ifndef PLATFORM_WINDOWS + ::close (fd); +#endif + g_unlink (file_name); + if (err) { + error << string_compose (_("Could not save bindings to file (%1)"), err->message) << endmsg; + g_error_free (err); + } + return; + } + +#ifndef PLATFORM_WINDOWS + ::close (fd); +#endif + + PBD::open_uri (string_compose ("file:///%1", file_name)); + + halt_connection.disconnect (); + AudioEngine::instance()->stop (); + exit (0); + + } + + if (ARDOUR_COMMAND_LINE::show_actions) { vector paths; @@ -694,21 +744,70 @@ ARDOUR_UI::post_engine () vector tooltips; vector keys; vector > actions; + string ver_in = revision; + string ver = ver_in.substr(0, ver_in.find("-")); + + stringstream output; + output << "\n

Menu actions

" << endl; + output << "

\n Every single menu item in " << PROGRAM_NAME << "'s GUI is accessible by control" << endl; + output << " surfaces or scripts.\n

\n" << endl; + output << "

\n The list below shows all available values of action-name as of" << endl; + output << " " << PROGRAM_NAME << " " << ver << ". You can get the current list at any" << endl; + output << " time by running " << PROGRAM_NAME << " with the -A flag.\n

\n" << endl; + output << "\n " << endl; + output << " " << endl; + output << " \n " << endl; Gtkmm2ext::ActionMap::get_all_actions (paths, labels, tooltips, keys, actions); - vector::iterator k; vector::iterator p; + vector::iterator l; + + for (p = paths.begin(), l = labels.begin(); p != paths.end(); ++p, ++l) { + output << " " << endl; + } + output << " \n
Action NameMenu Name
" << (*p).substr (9, string::npos); + output << "" << *l << "
" << endl; + + // output this mess to a browser for easiest X-platform use + // it is not pretty HTML, but it works and it's main purpose + // is to create raw html to fit in Ardour's manual with no editing + gchar* file_name; + GError *err = NULL; + gint fd; + + if ((fd = g_file_open_tmp ("akprintXXXXXX.html", &file_name, &err)) < 0) { + if (err) { + error << string_compose (_("Could not open temporary file to print bindings (%1)"), err->message) << endmsg; + g_error_free (err); + } + return; + } + +#ifdef PLATFORM_WINDOWS + ::close (fd); +#endif - for (p = paths.begin(), k = keys.begin(); p != paths.end(); ++k, ++p) { + err = NULL; - if ((*k).empty()) { - cout << *p << endl; - } else { - cout << *p << " => " << *k << endl; + if (!g_file_set_contents (file_name, output.str().c_str(), output.str().size(), &err)) { +#ifndef PLATFORM_WINDOWS + ::close (fd); +#endif + g_unlink (file_name); + if (err) { + error << string_compose (_("Could not save bindings to file (%1)"), err->message) << endmsg; + g_error_free (err); } + return; } +#ifndef PLATFORM_WINDOWS + ::close (fd); +#endif + + PBD::open_uri (string_compose ("file:///%1", file_name)); + halt_connection.disconnect (); AudioEngine::instance()->stop (); exit (0); @@ -4376,9 +4475,8 @@ ARDOUR_UI::start_video_server (Gtk::Window* float_window, bool popup_msg) if (icsd_docroot == X_("/") || icsd_docroot == X_("C:\\")) { Config->set_video_advanced_setup(false); } else { - std::ostringstream osstream; - osstream << "http://127.0.0.1:" << video_server_dialog->get_listenport() << "/"; - Config->set_video_server_url(osstream.str()); + std::string url_str = "http://127.0.0.1:" + to_string(video_server_dialog->get_listenport()) + "/"; + Config->set_video_server_url(url_str); Config->set_video_server_docroot(icsd_docroot); Config->set_video_advanced_setup(true); } @@ -5387,10 +5485,16 @@ ARDOUR_UI::do_audio_midi_setup (uint32_t desired_sample_rate) while (true) { int response = audio_midi_setup->run(); - printf("RESPONSE %d\n", response); switch (response) { case Gtk::RESPONSE_DELETE_EVENT: - return -1; + // after latency callibration engine may run, + // Running() signal was emitted, but dialog will not + // have emitted a response. The user needs to close + // the dialog -> Gtk::RESPONSE_DELETE_EVENT + if (!AudioEngine::instance()->running()) { + return -1; + } + // fall through default: if (!AudioEngine::instance()->running()) { continue;