move pre-release dialog into StartupFSM (and enlarge font sizing)
[ardour.git] / gtk2_ardour / startup_fsm.h
1 /*
2  * Copyright (C) 2019 Paul Davis <paul@linuxaudiosystems.com>
3  *
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.
8  *
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.
13  *
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.
17  */
18
19 #ifndef __gtk2_ardour_startup_fsm_h__
20 #define __gtk2_ardour_startup_fsm_h__
21
22 #include <string>
23
24 #include <sigc++/trackable.h>
25
26 #include "ardour/types.h"
27
28 class NewUserWizard;
29 class EngineControl;
30 class SessionDialog;
31
32 class StartupFSM : public sigc::trackable
33 {
34   public:
35         enum DialogID {
36                 PreReleaseDialog,
37                 NewUserDialog,
38                 NewSessionDialog,
39                 AudioMIDISetup
40         };
41
42         enum Result {
43                 LoadSession,
44                 ExitProgram,
45         };
46
47         StartupFSM (EngineControl&);
48         ~StartupFSM ();
49
50         void start ();
51         void end ();
52
53         std::string session_path;
54         std::string session_name;
55         std::string session_template;
56         int         session_existing_sample_rate;
57         bool        session_is_new;
58         ARDOUR::BusProfile bus_profile;
59
60         /* It's not a dialog but we provide this to make it behave like a (non-modal)
61          * dialog
62          */
63
64         sigc::signal1<void,Result>& signal_response() { return _signal_response; }
65
66         bool brand_new_user() const { return new_user; }
67
68   private:
69         enum MainState {
70                 NeedPreRelease,
71                 NeedWizard,
72                 NeedSessionPath,
73                 NeedEngineParams,
74         };
75
76         bool new_user;
77         bool new_session;
78
79         MainState _state;
80
81         void dialog_response_handler (int response, DialogID);
82
83         void show_new_user_wizard ();
84         void show_session_dialog (bool new_session_required);
85         void show_audiomidi_dialog ();
86         void show_pre_release_dialog ();
87
88         void copy_demo_sessions ();
89         void load_from_application_api (std::string const &);
90         bool get_session_parameters_from_command_line (bool new_session_required);
91         bool get_session_parameters_from_path (std::string const & path, std::string const & template_name, bool new_session_required);
92         void queue_finish ();
93         bool ask_about_loading_existing_session (const std::string& session_path);
94         int  check_session_parameters (bool must_be_new);
95
96         NewUserWizard* new_user_wizard;
97         EngineControl& audiomidi_dialog;
98         SessionDialog* session_dialog;
99         ArdourDialog* pre_release_dialog;
100         sigc::connection current_dialog_connection;
101
102         sigc::signal1<void,Result> _signal_response;
103 };
104
105 #endif /* __gtk2_ardour_startup_fsm_h__ */