Prevent the new session dialog from appearing
authorRoy Vegard Ovesen <roy.vegard.ovesen@gmail.com>
Sat, 30 Mar 2013 17:15:57 +0000 (18:15 +0100)
committerRoy Vegard Ovesen <roy.vegard.ovesen@gmail.com>
Sun, 31 Mar 2013 01:59:10 +0000 (03:59 +0200)
gtk2_ardour/ardour_ui.cc
gtk2_ardour/nsm.cc

index c520018a96c8a5aad98dfff497a82b10293970fe..edd57251b2a9f4f685b45d4a3a17f91e5d282b42 100644 (file)
@@ -2447,7 +2447,7 @@ ARDOUR_UI::build_session_from_nsd (const std::string& session_path, const std::s
 {
        BusProfile bus_profile;
 
-       if (Profile->get_sae()) {
+       if (nsm || Profile->get_sae()) {
 
                bus_profile.master_out_channels = 2;
                bus_profile.input_ac = AutoConnectPhysical;
@@ -2591,6 +2591,10 @@ ARDOUR_UI::get_session_parameters (bool quit_on_cancel, bool should_be_new, stri
                
                session_name = _startup->session_name (likely_new);
                
+               if (nsm) {
+                       likely_new = true;
+               }
+
                string::size_type suffix = session_name.find (statefile_suffix);
                
                if (suffix != string::npos) {
@@ -2642,7 +2646,7 @@ ARDOUR_UI::get_session_parameters (bool quit_on_cancel, bool should_be_new, stri
 
                if (Glib::file_test (session_path, Glib::FileTest (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))) {
 
-                       if (likely_new) {
+                       if (likely_new && !nsm) {
 
                                std::string existing = Glib::build_filename (session_path, session_name);
 
index 295022ac9aca01b19b2501e7db1bab9d9fa42d77..bd27fe532cd8b1003737d6d97ca6101fcdd2a825 100644 (file)
@@ -23,8 +23,6 @@
 #include "ardour_ui.h"
 
 #include <stdio.h>
-#include <sys/stat.h>
-#include <sys/types.h>
 #include <unistd.h>
 
 
@@ -50,18 +48,10 @@ NSM_Client::command_open(const char *name,
                          char **out_msg)
 {
     int r = ERR_OK;
-    struct stat buffer;
 
-    ARDOUR_COMMAND_LINE::new_session = true;
+    ARDOUR_COMMAND_LINE::new_session = false;
     ARDOUR_COMMAND_LINE::session_name = name;
     ARDOUR_COMMAND_LINE::jack_client_name = client_id;
 
-    int f = stat(name, &buffer);
-
-    if (f == 0 && S_ISDIR(buffer.st_mode))
-    {
-        ARDOUR_COMMAND_LINE::new_session = false;
-    }
-
     return r;
 }