Setup fixed ports for MIDI control data; hence remove configuration of those ports...
[ardour.git] / gtk2_ardour / ardour_ui.cc
index 5404432c376707c676bba121144244661b8c55d1..11cea54c02d3f0527e653356504857c1fc2cc183 100644 (file)
@@ -49,7 +49,6 @@
 #include "gtkmm2ext/utils.h"
 #include "gtkmm2ext/click_box.h"
 #include "gtkmm2ext/fastmeter.h"
-#include "gtkmm2ext/stop_signal.h"
 #include "gtkmm2ext/popup.h"
 #include "gtkmm2ext/window_title.h"
 
@@ -97,6 +96,7 @@ typedef uint64_t microseconds_t;
 #include "startup.h"
 #include "engine_dialog.h"
 #include "processor_box.h"
+#include "time_axis_view_item.h"
 
 #include "i18n.h"
 
@@ -287,6 +287,8 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[])
 
        reset_dpi();
 
+        TimeAxisViewItem::set_constant_heights ();
+
        starting.connect (sigc::mem_fun(*this, &ARDOUR_UI::startup));
        stopping.connect (sigc::mem_fun(*this, &ARDOUR_UI::shutdown));
 
@@ -295,7 +297,7 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[])
 
 /** @return true if a session was chosen and `apply' clicked, otherwise false if `cancel' was clicked */
 bool
-ARDOUR_UI::run_startup (bool should_be_new)
+ARDOUR_UI::run_startup (bool should_be_new, string load_template)
 {
        if (_startup == 0) {
                _startup = new ArdourStartup ();
@@ -308,6 +310,9 @@ ARDOUR_UI::run_startup (bool should_be_new)
        }
 
        _startup->set_new_only (should_be_new);
+        if (!load_template.empty()) {
+            _startup->set_load_template( load_template );
+        }
        _startup->present ();
 
        main().run();
@@ -347,6 +352,8 @@ ARDOUR_UI::create_engine ()
 
        engine->Halted.connect_same_thread (forever_connections, boost::bind (&ARDOUR_UI::engine_halted, this, _1, false));
 
+        ARDOUR::Port::set_connecting_blocked (ARDOUR_COMMAND_LINE::no_connect_ports);
+
        post_engine ();
 
        return 0;
@@ -358,9 +365,6 @@ ARDOUR_UI::post_engine ()
        /* Things to be done once we create the AudioEngine
         */
 
-       MIDI::Manager::instance()->set_api_data (engine->jack());
-       setup_midi ();
-       
        ARDOUR::init_post_engine ();
 
        ActionManager::init ();
@@ -643,7 +647,7 @@ Please consider the possibilities, and perhaps (re)start JACK."));
 void
 ARDOUR_UI::startup ()
 {
-       if (get_session_parameters (true, ARDOUR_COMMAND_LINE::new_session)) {
+       if (get_session_parameters (true, ARDOUR_COMMAND_LINE::new_session, ARDOUR_COMMAND_LINE::load_template)) {
                exit (1);
        }
 
@@ -1980,7 +1984,7 @@ ARDOUR_UI::snapshot_session (bool switch_to_it)
        prompter.add_button (Gtk::Stock::SAVE, Gtk::RESPONSE_ACCEPT);
        prompter.set_title (_("Take Snapshot"));
        prompter.set_title (_("Take Snapshot"));
-       prompter.set_prompt (_("Name of New Snapshot"));
+       prompter.set_prompt (_("Name of new snapshot"));
 
         if (!switch_to_it) {
                 char timebuf[128];
@@ -2389,7 +2393,7 @@ ARDOUR_UI::loading_message (const std::string& /*msg*/)
 
 /** @param quit_on_cancel true if exit() should be called if the user clicks `cancel' in the new session dialog */
 int
-ARDOUR_UI::get_session_parameters (bool quit_on_cancel, bool should_be_new)
+ARDOUR_UI::get_session_parameters (bool quit_on_cancel, bool should_be_new, string load_template)
 {
        Glib::ustring session_name;
        Glib::ustring session_path;
@@ -2397,6 +2401,11 @@ ARDOUR_UI::get_session_parameters (bool quit_on_cancel, bool should_be_new)
        int ret = -1;
        bool likely_new = false;
 
+        if (! load_template.empty()) {
+            should_be_new = true;
+            template_name = load_template;
+        }
+
        while (ret != 0) {
 
                if (!should_be_new && !ARDOUR_COMMAND_LINE::session_name.empty()) {
@@ -2416,7 +2425,7 @@ ARDOUR_UI::get_session_parameters (bool quit_on_cancel, bool should_be_new)
 
                } else {
 
-                       bool const apply = run_startup (should_be_new);
+                       bool const apply = run_startup (should_be_new, load_template);
                        if (!apply) {
                                if (quit_on_cancel) {
                                        exit (1);