diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2008-03-14 20:18:05 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2008-03-14 20:18:05 +0000 |
commit | 11af3f8fdf1daff7a2eda1ce4b2c4926229e4bc0 (patch) | |
tree | 52cdd0e01775fbcb2b515749d7f4d3cd8baf4d4f /gtk2_ardour/ardour_ui.cc | |
parent | fb6565456e2070f088b2387923d78934ac8ab957 (diff) |
enable icon-start-from-.ardour-file to work on OS X; properly install apple event handlers; change plugin add logic to avoid asking for stream counts before they would be configured; fix up new session dialog to not use manage(), and thus not throw away widgets when their page is hidden (by removal) in the tabbed browser
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@3144 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/ardour_ui.cc')
-rw-r--r-- | gtk2_ardour/ardour_ui.cc | 36 |
1 files changed, 32 insertions, 4 deletions
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 8f543b5e8f..a465eed360 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -35,7 +35,6 @@ #include <pbd/error.h> #include <pbd/basename.h> #include <pbd/compose.h> -#include <pbd/misc.h> #include <pbd/pathscanner.h> #include <pbd/failed_constructor.h> #include <pbd/enumwriter.h> @@ -2192,6 +2191,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) { @@ -2199,8 +2220,10 @@ ARDOUR_UI::get_session_parameters (bool backend_audio_is_running, bool should_be Glib::ustring session_name; Glib::ustring session_path; Glib::ustring template_name; + int response; - int response = Gtk::RESPONSE_NONE; + begin: + response = Gtk::RESPONSE_NONE; if (!ARDOUR_COMMAND_LINE::session_name.empty()) { @@ -2243,6 +2266,13 @@ ARDOUR_UI::get_session_parameters (bool backend_audio_is_running, bool should_be /* handle possible negative responses */ switch (response) { + case 1: + /* sent by idle_load, meaning restart the whole process again */ + new_session_dialog->hide(); + new_session_dialog->reset(); + goto begin; + break; + case Gtk::RESPONSE_CANCEL: case Gtk::RESPONSE_DELETE_EVENT: if (!session) { @@ -2421,7 +2451,6 @@ ARDOUR_UI::load_session (const Glib::ustring& path, const Glib::ustring& snap_na } loading_message (_("Please wait while Ardour loads your session")); - disable_screen_updates (); try { new_session = new Session (*engine, path, snap_name, mix_template); @@ -2493,7 +2522,6 @@ ARDOUR_UI::load_session (const Glib::ustring& path, const Glib::ustring& snap_na session->set_clean (); } - enable_screen_updates (); flush_pending (); retval = 0; |