- if (!getenv ("ARDOUR_BUNDLED")) {
- return;
- }
-
- EnvironmentalProtectionAgency::set_global_epa (new EnvironmentalProtectionAgency (true, "PREBUNDLE_ENV"));
-
- set_language_preference ();
-
- char execpath[MAXPATHLEN+1];
- uint32_t pathsz = sizeof (execpath);
-
- _NSGetExecutablePath (execpath, &pathsz);
-
- std::string dir_path = Glib::path_get_dirname (execpath);
- std::string path;
- const char *cstr = getenv ("PATH");
-
- /* ensure that we find any bundled executables (e.g. JACK),
- and find them before any instances of the same name
- elsewhere in PATH
- */
-
- path = dir_path;
-
- /* JACK is often in /usr/local/bin and since Info.plist refuses to
- set PATH, we have to force this in order to discover a running
- instance of JACK ...
- */
-
- path += ':';
- path += "/usr/local/bin";
-
- if (cstr) {
- path += ':';
- path += cstr;
- }
- setenv ("PATH", path.c_str(), 1);
-
- export_search_path (dir_path, "ARDOUR_DLL_PATH", "/../Frameworks");
-
- path += dir_path;
- path += "/../Resources";
-
- /* inside an OS X .app bundle, there is no difference
- between DATA and CONFIG locations, since OS X doesn't
- attempt to do anything to expose the notion of
- machine-independent shared data.
- */
-
- export_search_path (dir_path, "ARDOUR_DATA_PATH", "/../Resources");
- export_search_path (dir_path, "ARDOUR_CONFIG_PATH", "/../Resources");
- export_search_path (dir_path, "ARDOUR_INSTANT_XML_PATH", "/../Resources");
-
- export_search_path (dir_path, "LADSPA_PATH", "/../Plugins");
- export_search_path (dir_path, "VAMP_PATH", "/../Frameworks");
-
- path = dir_path;
- path += "/../Frameworks/clearlooks";
- setenv ("GTK_PATH", path.c_str(), 1);
-
- /* unset GTK_RC_FILES so that we only load the RC files that we define
- */
-
- unsetenv ("GTK_RC_FILES");
-
- if (!ARDOUR::translations_are_disabled ()) {
-
- path = dir_path;
- path += "/../Resources/locale";
-
- localedir = strdup (path.c_str());
- setenv ("GTK_LOCALEDIR", localedir, 1);
- }
-
- /* write a pango.rc file and tell pango to use it. we'd love
- to put this into the PROGRAM_NAME.app bundle and leave it there,
- but the user may not have write permission. so ...
-
- we also have to make sure that the user ardour directory
- actually exists ...
- */
-
- try {
- sys::create_directories (user_config_directory ());
- }
- catch (const sys::filesystem_error& ex) {
- error << _("Could not create user configuration directory") << endmsg;
- }
+ if (AudioEngine::instance()->processed_samples() == 0) {
+ /* died during startup */
+ MessageDialog msg (string_compose (_("The audio backend (%1) has failed, or terminated"), AudioEngine::instance()->current_backend_name()), false);
+ msg.set_position (Gtk::WIN_POS_CENTER);
+ msg.set_secondary_text (string_compose (_(
+"%2 exited unexpectedly, and without notifying %1.\n\
+\n\
+This could be due to misconfiguration or to an error inside %2.\n\
+\n\
+Click OK to exit %1."), PROGRAM_NAME, AudioEngine::instance()->current_backend_name()));