summaryrefslogtreecommitdiff
path: root/gtk2_ardour/ardour_ui_startup.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2020-03-05 17:34:41 -0700
committerPaul Davis <paul@linuxaudiosystems.com>2020-03-05 17:34:41 -0700
commit86045fe5268811233b7267a46a88179b1c56c8b7 (patch)
treedd16880a9963593bdb2bbd0241088521ce8f65ce /gtk2_ardour/ardour_ui_startup.cc
parentf04974aa6cb93de18be6a48c40e8ce15d738aaf6 (diff)
move more or less all responsibility for ShouldLoad (macOS, NSM) back into ARDOUR_UI
Diffstat (limited to 'gtk2_ardour/ardour_ui_startup.cc')
-rw-r--r--gtk2_ardour/ardour_ui_startup.cc19
1 files changed, 17 insertions, 2 deletions
diff --git a/gtk2_ardour/ardour_ui_startup.cc b/gtk2_ardour/ardour_ui_startup.cc
index c555ce43da..6178282a21 100644
--- a/gtk2_ardour/ardour_ui_startup.cc
+++ b/gtk2_ardour/ardour_ui_startup.cc
@@ -474,6 +474,8 @@ ARDOUR_UI::starting ()
{
Application* app = Application::instance();
+ app->ShouldLoad.connect (sigc::mem_fun (*this, &ARDOUR_UI::load_from_application_api));
+
if (ARDOUR_COMMAND_LINE::check_announcements) {
check_announcements ();
}
@@ -657,7 +659,7 @@ ARDOUR_UI::load_from_application_api (const std::string& path)
line arguments to an app via the openFile delegate protocol. Ardour
already does its own command line processing, and having both
pathways active causes crashes. So, if the command line was already
- set, do nothing here.
+ set, do nothing here. NSM also uses this code path.
*/
if (!ARDOUR_COMMAND_LINE::session_name.empty()) {
@@ -675,10 +677,23 @@ ARDOUR_UI::load_from_application_api (const std::string& path)
*/
if (startup_fsm) {
+ /* this will result in the StartupFSM signalling us to load a
+ * session, which if successful will then destroy the
+ * startupFSM and we'll move right along.
+ */
+
startup_fsm->handle_path (path);
return;
}
+ /* the mechanisms that can result is this being called are only
+ * possible for existing sessions.
+ */
+
+ if (!Glib::file_test (path, Glib::FILE_TEST_EXISTS)) {
+ return;
+ }
+
ARDOUR_COMMAND_LINE::session_name = path;
int rv;
@@ -691,7 +706,7 @@ ARDOUR_UI::load_from_application_api (const std::string& path)
rv = load_session (Glib::path_get_dirname (path), basename_nosuffix (path));
}
- // if load_session fails, and there is no existing session ....
+ // there was no startupFSM, load_session fails, and there is no existing session ....
if (rv && !_session) {