reinstate ArdourUI::idle_load(), need by OS X build
authorPaul Davis <paul@linuxaudiosystems.com>
Fri, 31 Oct 2008 07:39:25 +0000 (07:39 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Fri, 31 Oct 2008 07:39:25 +0000 (07:39 +0000)
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@4070 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/ardour_ui.cc
gtk2_ardour/ardour_ui.h

index 09ec2e7e88f5847e4a44d34547f9a5576a11ae24..df7ca68f258a1553bec5ab46cd665691f4070747 100644 (file)
@@ -2156,6 +2156,28 @@ ARDOUR_UI::loading_message (const std::string& msg)
        flush_pending ();
 }
 
+void
+ARDOUR_UI::idle_load (const Glib::ustring& path)
+{
+       if (session) {
+               if (Glib::file_test (path, Glib::FILE_TEST_IS_DIR)) {
+                       /* /path/to/foo => /path/to/foo, foo */
+                       load_session (path, basename_nosuffix (path));
+               } else {
+                       /* /path/to/foo/foo.ardour => /path/to/foo, foo */
+                       load_session (Glib::path_get_dirname (path), basename_nosuffix (path));
+               }
+       } else {
+               ARDOUR_COMMAND_LINE::session_name = path;
+               if (new_session_dialog) {
+                       /* make it break out of Dialog::run() and
+                          start again.
+                        */
+                       new_session_dialog->response (1);
+               }
+       }
+}
+
 bool
 ARDOUR_UI::get_session_parameters (bool backend_audio_is_running, bool should_be_new)
 {
index dce32541927de01d0d150e33776e67d38bf90b46..5d08d2524fd1d061b2506a89de761e49b420d669 100644 (file)
@@ -116,6 +116,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI
        void show_about ();
        void hide_about ();
        
+       void idle_load (Glib::ustring& path);
        void finish();
 
        int load_session (const Glib::ustring& path, const Glib::ustring& snapshot, Glib::ustring mix_template = Glib::ustring());