#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"
*/
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<string> paths;
vector<string> tooltips;
vector<string> keys;
vector<Glib::RefPtr<Gtk::Action> > actions;
+ string ver_in = revision;
+ string ver = ver_in.substr(0, ver_in.find("-"));
+
+ stringstream output;
+ output << "\n<h2>Menu actions</h2>" << endl;
+ output << "<p>\n Every single menu item in " << PROGRAM_NAME << "'s GUI is accessible by control" << endl;
+ output << " surfaces or scripts.\n</p>\n" << endl;
+ output << "<p>\n The list below shows all available values of <em>action-name</em> 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</p>\n" << endl;
+ output << "<table class=\"dl\">\n <thead>" << endl;
+ output << " <tr><th>Action Name</th><th>Menu Name</th></tr>" << endl;
+ output << " </thead>\n <tbody>" << endl;
Gtkmm2ext::ActionMap::get_all_actions (paths, labels, tooltips, keys, actions);
- vector<string>::iterator k;
vector<string>::iterator p;
+ vector<string>::iterator l;
+
+ for (p = paths.begin(), l = labels.begin(); p != paths.end(); ++p, ++l) {
+ output << " <tr><th><kbd class=\"osc\">" << (*p).substr (9, string::npos);
+ output << "</kbd></th><td>" << *l << "</td></tr>" << endl;
+ }
+ output << " </tbody>\n </table>" << 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);
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);
}
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;