X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fmain.cc;h=e8cf2ac69cf8cfda4f41ca819e3cc8473039995b;hb=5b520324ceab2559723b4ef5127301fa61ff4846;hp=2b16de3d70be41e7c1206525bd85071b32f008e5;hpb=44f4b84551d36ef4103d09452768f5ba53e0002c;p=ardour.git diff --git a/gtk2_ardour/main.cc b/gtk2_ardour/main.cc index 2b16de3d70..e8cf2ac69c 100644 --- a/gtk2_ardour/main.cc +++ b/gtk2_ardour/main.cc @@ -281,10 +281,52 @@ fixup_bundle_environment () #endif +static gboolean +tell_about_jack_death (void* /* ignored */) +{ + if (AudioEngine::instance()->processed_frames() == 0) { + /* died during startup */ + MessageDialog msg (_("JACK exited"), false, Gtk::MESSAGE_INFO, Gtk::BUTTONS_OK); + msg.set_position (Gtk::WIN_POS_CENTER); + msg.set_secondary_text (_( +"JACK exited unexpectedly, and without notifying Ardour.\n\ +\n\ +This could be due to misconfiguration or to an error inside JACK.\n\ +\n\ +Click OK to exit Ardour.")); + + msg.run (); + _exit (0); + + } else { + + /* engine has already run, so this is a mid-session JACK death */ + + MessageDialog* msg = manage (new MessageDialog (_("JACK exited"), false, Gtk::MESSAGE_INFO, Gtk::BUTTONS_NONE)); + msg->set_secondary_text (_( +"JACK exited unexpectedly, and without notifying Ardour.\n\ +\n\ +This is probably due to an error inside JACK. You should restart JACK\n\ +and reconnect Ardour to it, or exit Ardour now. You cannot save your\n\ +session at this time, because we would lose your connection information.\n")); + msg->present (); + } + return false; /* do not call again */ +} + static void -sigpipe_handler (int /*sig*/) +sigpipe_handler (int sig) { - cerr << _("SIGPIPE received - JACK has probably died") << endl; + /* XXX fix this so that we do this again after a reconnect to JACK + */ + + static bool done_the_jack_thing = false; + + if (!done_the_jack_thing) { + AudioEngine::instance()->died (); + g_idle_add (tell_about_jack_death, 0); + done_the_jack_thing = true; + } } #ifdef HAVE_LV2 @@ -363,7 +405,7 @@ int main (int argc, char *argv[]) } if (no_splash) { - cerr << _("Copyright (C) 1999-2008 Paul Davis") << endl + cerr << _("Copyright (C) 1999-2010 Paul Davis") << endl << _("Some portions Copyright (C) Steve Harris, Ari Johnson, Brett Viren, Joel Baker") << endl << endl << string_compose (_("%1 comes with ABSOLUTELY NO WARRANTY"), PROGRAM_NAME) << endl