show() widgets explicitly in gtk2_ardour/analysis_window.cc
[ardour.git] / gtk2_ardour / main.cc
index 41a279f604983dca909ed36e60b37d509f9107f7..67e59d4b80749336bc35bd1b3303598b46cc245e 100644 (file)
@@ -32,6 +32,7 @@
 #include <ardour/version.h>
 #include <ardour/ardour.h>
 #include <ardour/audioengine.h>
+#include <ardour/session_utils.h>
 
 #include <gtkmm/main.h>
 #include <gtkmm2ext/popup.h>
@@ -57,29 +58,6 @@ extern int curvetest (string);
 
 static ARDOUR_UI  *ui = 0;
 
-string
-which_ui_rcfile ()
-{
-       string rcfile;
-       char* env;
-
-       if ((env = getenv ("ARDOUR2_UI_RC")) != 0 && strlen (env)) {
-               rcfile = env;
-       } else {
-               rcfile = "ardour2_ui.rc";
-       }
-
-       rcfile = find_config_file (rcfile);
-       
-       if (rcfile.empty()) {
-               warning << _("Without a UI style file, ardour will look strange.\n Please set ARDOUR2_UI_RC to point to a valid UI style file") << endmsg;
-       } else {
-               cerr << "Loading ui configuration file " << rcfile << endl;
-       }
-       
-       return rcfile;
-}
-
 gint
 show_ui_callback (void *arg)
 {
@@ -140,7 +118,7 @@ maybe_load_session ()
 
        bool isnew;
 
-       if (Session::find_session (session_name, path, name, isnew)) {
+       if (find_session (session_name, path, name, isnew)) {
                error << string_compose(_("could not load command line session \"%1\""), session_name) << endmsg;
                return false;
        }
@@ -191,10 +169,10 @@ int main (int argc, char *argv[])
 #endif
 
 {
-       ARDOUR::AudioEngine *engine;
+       ARDOUR::AudioEngine *engine = NULL;
        vector<Glib::ustring> null_file_list;
 
-        Glib::thread_init();
+       Glib::thread_init();
        gtk_set_locale ();
 
        (void) bindtextdomain (PACKAGE, LOCALEDIR);
@@ -251,8 +229,8 @@ int main (int argc, char *argv[])
 
        PBD::ID::init ();
 
-        try { 
-               ui = new ARDOUR_UI (&argc, &argv, which_ui_rcfile());
+       try { 
+               ui = new ARDOUR_UI (&argc, &argv);
        } catch (failed_constructor& err) {
                error << _("could not create ARDOUR GUI") << endmsg;
                exit (1);
@@ -270,9 +248,10 @@ int main (int argc, char *argv[])
        }
 
     try {
-               ARDOUR::init (*engine, use_vst, try_hw_optimization);
+               ARDOUR::init (use_vst, try_hw_optimization);
                setup_gtk_ardour_enums ();
                Config->set_current_owner (ConfigVariableBase::Interface);
+               ui->setup_profile ();
 
                try { 
                        engine = new ARDOUR::AudioEngine (jack_client_name);
@@ -281,6 +260,8 @@ int main (int argc, char *argv[])
                        error << string_compose (_("Could not connect to JACK server as  \"%1\""), jack_client_name) <<  endmsg;
                        return -1;
                }
+
+               ARDOUR::setup_midi(*engine);
                
                ui->set_engine (*engine);