Add a double-click handler for items in the editor window.
[ardour.git] / gtk2_ardour / main.cc
index e9b5da3e04ccd99d010e62cfb27339c70e5d15ad..d01bca2a624f0cd57dbaa2870d867a369847cb64 100644 (file)
@@ -36,8 +36,6 @@
 #include "pbd/boost_debug.h"
 #endif
 
-#include <jack/jack.h>
-
 #include "ardour/revision.h"
 #include "ardour/version.h"
 #include "ardour/ardour.h"
@@ -80,17 +78,10 @@ static const char* localedir = LOCALEDIR;
 void
 gui_jack_error ()
 {
-       MessageDialog win (string_compose (_("%1 could not connect to JACK."), PROGRAM_NAME),
+       MessageDialog win (string_compose (_("%1 could not connect to the audio backend."), PROGRAM_NAME),
                           false,
                           Gtk::MESSAGE_INFO,
                           Gtk::BUTTONS_NONE);
-       win.set_secondary_text(string_compose (_("There are several possible reasons:\n\
-\n\
-1) JACK is not running.\n\
-2) JACK is running as another user, perhaps root.\n\
-3) There is already another client called \"%1\".\n\
-\n\
-Please consider the possibilities, and perhaps (re)start JACK."), PROGRAM_NAME));
 
        win.add_button (Stock::QUIT, RESPONSE_CLOSE);
        win.set_default_response (RESPONSE_CLOSE);
@@ -162,7 +153,7 @@ fixup_bundle_environment (int, char* [])
                
                vector<string> lpath;
                lpath.push_back (bundle_dir);
-               lpath.push_back ("share");
+               lpath.push_back ("Resources");
                lpath.push_back ("locale");
                localedir = strdup (Glib::build_filename (lpath).c_str());
        }
@@ -181,9 +172,9 @@ fixup_bundle_environment (int, char* [])
        export_search_path (bundle_dir, "ARDOUR_INSTANT_XML_PATH", "/Resources");
        export_search_path (bundle_dir, "LADSPA_PATH", "/Plugins");
        export_search_path (bundle_dir, "VAMP_PATH", "/lib");
-       export_search_path (bundle_dir, "SUIL_MODULE_DIR", "/lib");
        export_search_path (bundle_dir, "GTK_PATH", "/lib/gtkengines");
 
+       setenv ("SUIL_MODULE_DIR", (bundle_dir + "/lib").c_str(), 1);
        setenv ("PATH", (bundle_dir + "/MacOS:" + std::string(getenv ("PATH"))).c_str(), 1);
 
        /* unset GTK_RC_FILES so that we only load the RC files that we define
@@ -291,9 +282,9 @@ fixup_bundle_environment (int /*argc*/, char* argv[])
        export_search_path (dir_path, "ARDOUR_DATA_PATH", "/share");
        export_search_path (dir_path, "LADSPA_PATH", "/plugins");
        export_search_path (dir_path, "VAMP_PATH", "/lib");
-       export_search_path (dir_path, "SUIL_MODULE_DIR", "/lib");
        export_search_path (dir_path, "GTK_PATH", "/lib/gtkengines");
 
+       setenv ("SUIL_MODULE_DIR", (dir_path + "/lib").c_str(), 1);
        setenv ("PATH", (dir_path + "/bin:" + std::string(getenv ("PATH"))).c_str(), 1);
 
        /* unset GTK_RC_FILES so that we only load the RC files that we define
@@ -478,10 +469,6 @@ int main (int argc, char *argv[])
                exit (1);
        }
 
-       if (curvetest_file) {
-               return curvetest (curvetest_file);
-       }
-
        cout << PROGRAM_NAME
             << VERSIONSTRING
             << _(" (built using ")
@@ -509,7 +496,14 @@ int main (int argc, char *argv[])
 
        /* some GUI objects need this */
 
-       PBD::ID::init ();
+       if (!ARDOUR::init (ARDOUR_COMMAND_LINE::use_vst, ARDOUR_COMMAND_LINE::try_hw_optimization, localedir)) {
+               error << string_compose (_("could not initialize %1."), PROGRAM_NAME) << endmsg;
+               exit (1);
+       }
+
+       if (curvetest_file) {
+               return curvetest (curvetest_file);
+       }
 
        if (::signal (SIGPIPE, sigpipe_handler)) {
                cerr << _("Cannot xinstall SIGPIPE error handler") << endl;
@@ -524,6 +518,7 @@ int main (int argc, char *argv[])
 
        ui->run (text_receiver);
        Gtkmm2ext::Application::instance()->cleanup();
+       delete ui;
        ui = 0;
 
        ARDOUR::cleanup ();