fix startup FSM handling when pre-release dialog is shown AND cmdline session info is given

This commit is contained in:
Paul Davis 2019-12-12 13:32:42 -07:00
parent 3437fec785
commit 1b91615b2c
2 changed files with 37 additions and 30 deletions

View file

@ -141,35 +141,7 @@ StartupFSM::start ()
show_new_user_dialog ();
break;
case WaitingForSessionPath:
if (ARDOUR_COMMAND_LINE::session_name.empty()) {
/* nothing given on the command line ... show new session dialog */
show_session_dialog (new_session_required);
} else {
if (get_session_parameters_from_command_line (new_session_required)) {
/* command line arguments all OK. Get engine parameters */
if (!new_session_required && session_existing_sample_rate > 0) {
audiomidi_dialog.set_desired_sample_rate (session_existing_sample_rate);
}
start_audio_midi_setup ();
} else {
/* command line arguments not good. Use
* dialog, but prime the dialog with
* the information we set up in
* get_session_parameters_from_command_line()
*/
show_session_dialog (new_session_required);
}
}
handle_waiting_for_session_path ();
break;
default:
fatal << string_compose (_("Programming error: %1"), string_compose (X_("impossible starting state in StartupFSM (%1)"), enum_2_string (_state))) << endmsg;
@ -243,7 +215,7 @@ StartupFSM::dialog_response_handler (int response, StartupFSM::DialogID dialog_i
if (NewUserWizard::required()) {
show_new_user_dialog ();
} else {
show_session_dialog (new_session_required);
handle_waiting_for_session_path ();
}
break;
}
@ -344,6 +316,40 @@ StartupFSM::dialog_response_handler (int response, StartupFSM::DialogID dialog_i
}
}
void
StartupFSM::handle_waiting_for_session_path ()
{
if (ARDOUR_COMMAND_LINE::session_name.empty()) {
/* nothing given on the command line ... show new session dialog */
show_session_dialog (new_session_required);
} else {
if (get_session_parameters_from_command_line (new_session_required)) {
/* command line arguments all OK. Get engine parameters */
if (!new_session_required && session_existing_sample_rate > 0) {
audiomidi_dialog.set_desired_sample_rate (session_existing_sample_rate);
}
start_audio_midi_setup ();
} else {
/* command line arguments not good. Use
* dialog, but prime the dialog with
* the information we set up in
* get_session_parameters_from_command_line()
*/
show_session_dialog (new_session_required);
}
}
}
void
StartupFSM::show_plugin_scan_dialog ()
{

View file

@ -102,6 +102,7 @@ class StartupFSM : public sigc::trackable
int check_session_parameters (bool must_be_new);
void start_audio_midi_setup ();
void engine_running ();
void handle_waiting_for_session_path ();
/* the Audio/MIDI dialog needs to be persistent and is thus owned by
* ARDOUR_UI and we use it by reference. All other dialogs can be