move more or less all responsibility for ShouldLoad (macOS, NSM) back into ARDOUR_UI
This commit is contained in:
@@ -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) {
|
||||
|
||||
|
||||
@@ -95,7 +95,6 @@ StartupFSM::StartupFSM (EngineControl& amd)
|
||||
Application* app = Application::instance ();
|
||||
|
||||
app->ShouldQuit.connect (sigc::mem_fun (*this, &StartupFSM::queue_finish));
|
||||
app->ShouldLoad.connect (sigc::mem_fun (*this, &StartupFSM::load_from_application_api));
|
||||
|
||||
Gtkmm2ext::Keyboard::HideMightMeanQuit.connect (sigc::mem_fun (*this, &StartupFSM::dialog_hidden));
|
||||
}
|
||||
@@ -567,6 +566,7 @@ StartupFSM::get_session_parameters_from_path (string const & path, string const
|
||||
session_path = path;
|
||||
}
|
||||
|
||||
session_template = string ();
|
||||
|
||||
if (!template_name.empty()) {
|
||||
|
||||
@@ -829,22 +829,6 @@ StartupFSM::copy_demo_sessions ()
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
StartupFSM::load_from_application_api (const std::string& path)
|
||||
{
|
||||
if (!ARDOUR_COMMAND_LINE::session_name.empty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* just set this as if it was given on the command line, rather than
|
||||
* supplied via some desktop system (e.g. macOS application delegate
|
||||
* and "openFile". Note that this relies on this being invoked before
|
||||
* StartupFSM::start().
|
||||
*/
|
||||
|
||||
ARDOUR_COMMAND_LINE::session_name = path;
|
||||
}
|
||||
|
||||
bool
|
||||
StartupFSM::ask_about_loading_existing_session (const std::string& session_path)
|
||||
{
|
||||
|
||||
@@ -75,7 +75,6 @@ class StartupFSM : public sigc::trackable
|
||||
sigc::signal1<void,Result>& signal_response() { return _signal_response; }
|
||||
|
||||
bool brand_new_user() const { return new_user; }
|
||||
|
||||
void handle_path (std::string const & path);
|
||||
|
||||
private:
|
||||
@@ -96,7 +95,6 @@ class StartupFSM : public sigc::trackable
|
||||
void show_plugin_scan_dialog ();
|
||||
|
||||
void copy_demo_sessions ();
|
||||
void load_from_application_api (std::string const &);
|
||||
bool get_session_parameters_from_command_line (bool new_session_required);
|
||||
bool get_session_parameters_from_path (std::string const & path, std::string const & template_name, bool new_session_required);
|
||||
void queue_finish ();
|
||||
|
||||
Reference in New Issue
Block a user