2 * Copyright (C) 2019 Paul Davis <paul@linuxaudiosystems.com>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 #ifndef __gtk2_ardour_startup_fsm_h__
20 #define __gtk2_ardour_startup_fsm_h__
24 #include <sigc++/trackable.h>
26 #include "ardour/types.h"
32 class PluginScanDialog;
34 class StartupFSM : public sigc::trackable
53 WaitingForSessionPath,
54 WaitingForEngineParams,
58 StartupFSM (EngineControl&);
64 std::string session_path;
65 std::string session_name;
66 std::string session_template;
67 int session_existing_sample_rate;
69 ARDOUR::BusProfile bus_profile;
71 /* It's not a dialog but we provide this to make it behave like a (non-modal)
75 sigc::signal1<void,Result>& signal_response() { return _signal_response; }
77 bool brand_new_user() const { return new_user; }
81 bool new_session_required;
85 void set_state (MainState);
86 void dialog_response_handler (int response, DialogID);
87 template<typename T> void end_dialog (T**);
88 template<typename T> void end_dialog (T&);
90 void show_new_user_dialog ();
91 void show_session_dialog (bool new_session_required);
92 void show_audiomidi_dialog ();
93 void show_pre_release_dialog ();
94 void show_plugin_scan_dialog ();
96 void copy_demo_sessions ();
97 void load_from_application_api (std::string const &);
98 bool get_session_parameters_from_command_line (bool new_session_required);
99 bool get_session_parameters_from_path (std::string const & path, std::string const & template_name, bool new_session_required);
100 void queue_finish ();
101 bool ask_about_loading_existing_session (const std::string& session_path);
102 int check_session_parameters (bool must_be_new);
103 void start_audio_midi_setup ();
104 void engine_running ();
105 void handle_waiting_for_session_path ();
107 /* the Audio/MIDI dialog needs to be persistent and is thus owned by
108 * ARDOUR_UI and we use it by reference. All other dialogs can be
109 * created and destroyed within the scope of startup.
112 EngineControl& audiomidi_dialog;
113 NewUserWizard* new_user_dialog;
114 SessionDialog* session_dialog;
115 ArdourDialog* pre_release_dialog;
116 PluginScanDialog* plugin_scan_dialog;
118 sigc::connection current_dialog_connection;
120 sigc::signal1<void,Result> _signal_response;
122 void dialog_hidden (Gtk::Window*);
125 #endif /* __gtk2_ardour_startup_fsm_h__ */