- 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 exec_path (execpath);
- std::string dir_path = Glib::path_get_dirname (exec_path);
- 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);
-
- path = dir_path;
- path += "/../Resources";
- path += dir_path;
- path += "/../Resources/Surfaces";
- path += dir_path;
- path += "/../Resources/Panners";
-
- setenv ("ARDOUR_MODULE_PATH", path.c_str(), 1);
-
- path = user_config_directory().to_string();
- path += ':';
- path += dir_path;
- path += "/../Resources/icons:";
- path += dir_path;
- path += "/../Resources/pixmaps:";
- path += dir_path;
- path += "/../Resources/share:";
- path += dir_path;
- path += "/../Resources";
-
- setenv ("ARDOUR_PATH", path.c_str(), 1);
- setenv ("ARDOUR_CONFIG_PATH", path.c_str(), 1);
-
- path = dir_path;
- path += "/../Resources";
- setenv ("ARDOUR_INSTANT_XML_PATH", path.c_str(), 1);
-
- cstr = getenv ("LADSPA_PATH");
- if (cstr) {
- path = cstr;
- path += ':';
- } else {
- path = "";
- }
- path += dir_path;
- path += "/../Plugins";
-
- setenv ("LADSPA_PATH", path.c_str(), 1);
-
- cstr = getenv ("VAMP_PATH");
- if (cstr) {
- path = cstr;
- path += ':';
- } else {
- path = "";
- }
- path += dir_path;
- path += "/../Frameworks";
+static gboolean
+tell_about_backend_death (void* /* ignored */)
+{
+ if (AudioEngine::instance()->processed_frames() == 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()));