fix startupFSM handling of a ShouldLoad signal

This currently only handles initial session load by dbl-click on
a session file. It also does not work if the user or new or
subject to a pre-release warning. These last two restrictions
may remain in place, although if a person's first exposure to
the program is "copy my session, download program, dbl-click
on the session file", then that's not so nice
This commit is contained in:
Paul Davis 2020-03-06 15:53:31 -07:00
parent 694a0eaeca
commit c8d449f356
2 changed files with 21 additions and 3 deletions

View File

@ -199,6 +199,9 @@ StartupFSM::dialog_response_handler (int response, StartupFSM::DialogID dialog_i
switch (_state) {
case WaitingForPreRelease:
switch (dialog_id) {
case ApplicationPseudoDialog:
/* this shouldn't happen; ignore it */
break;
case PreReleaseDialog:
default:
/* any response value from the pre-release dialog means
@ -217,6 +220,9 @@ StartupFSM::dialog_response_handler (int response, StartupFSM::DialogID dialog_i
case WaitingForNewUser:
switch (dialog_id) {
case ApplicationPseudoDialog:
/* this shouldn't happen; ignore it */
break;
case NewUserDialog:
switch (response) {
case RESPONSE_OK:
@ -262,6 +268,13 @@ StartupFSM::dialog_response_handler (int response, StartupFSM::DialogID dialog_i
}
break;
case ApplicationPseudoDialog:
/* macOS, NSM etc. ... existence was already checked */
if (get_session_parameters_from_path (ARDOUR_COMMAND_LINE::session_name, string(), false)) {
start_audio_midi_setup ();
}
break;
default:
/* ERROR */
break;
@ -895,7 +908,11 @@ Full information on all the above can be found on the support page at\n\
void
StartupFSM::handle_path (string const & path)
{
if (get_session_parameters_from_path (path, string(), false)) {
_signal_response (LoadSession);
if (!ARDOUR_COMMAND_LINE::session_name.empty()) {
return;
}
ARDOUR_COMMAND_LINE::session_name = path;
dialog_response_handler (RESPONSE_OK, ApplicationPseudoDialog);
}

View File

@ -39,7 +39,8 @@ class StartupFSM : public sigc::trackable
NewUserDialog,
NewSessionDialog,
AudioMIDISetup,
PluginDialog
PluginDialog,
ApplicationPseudoDialog,
};
enum Result {