1 #ifndef __gtk2_ardour_startup_h__
2 #define __gtk2_ardour_startup_h__
6 #include <gdkmm/pixbuf.h>
7 #include <gtkmm/assistant.h>
8 #include <gtkmm/label.h>
9 #include <gtkmm/drawingarea.h>
10 #include <gtkmm/box.h>
11 #include <gtkmm/radiobutton.h>
12 #include <gtkmm/filechooserbutton.h>
13 #include <gtkmm/scrolledwindow.h>
14 #include <gtkmm/treeview.h>
15 #include <gtkmm/treestore.h>
16 #include <gtkmm/checkbutton.h>
17 #include <gtkmm/table.h>
18 #include <gtkmm/frame.h>
19 #include <gtkmm/spinbutton.h>
20 #include <gtkmm/liststore.h>
21 #include <gtkmm/combobox.h>
23 #include "ardour/utils.h"
27 class ArdourStartup : public Gtk::Assistant {
32 void set_new_only (bool);
34 Glib::ustring session_name (bool& should_be_new);
35 Glib::ustring session_folder ();
37 bool use_session_template();
38 Glib::ustring session_template_name();
40 EngineControl* engine_control() { return engine_dialog; }
42 // advanced session options
44 bool create_master_bus() const;
45 int master_channel_count() const;
47 bool create_control_bus() const;
48 int control_channel_count() const;
50 bool connect_inputs() const;
51 bool limit_inputs_used_for_connection() const;
52 int input_limit_count() const;
54 bool connect_outputs() const;
55 bool limit_outputs_used_for_connection() const;
56 int output_limit_count() const;
58 bool connect_outs_to_master() const;
59 bool connect_outs_to_physical() const;
61 bool applying () const {
74 void on_prepare (Gtk::Widget*);
76 static ArdourStartup *the_startup;
78 Glib::RefPtr<Gdk::Pixbuf> icon_pixbuf;
80 void setup_new_user_page ();
81 Glib::RefPtr<Gdk::Pixbuf> splash_pixbuf;
82 Gtk::DrawingArea splash_area;
83 bool splash_expose (GdkEventExpose* ev);
85 void setup_first_time_config_page ();
88 Gtk::FileChooserButton* default_dir_chooser;
89 void default_dir_changed();
90 void setup_first_page ();
92 /* initial choice page */
94 void setup_initial_choice_page ();
96 Gtk::RadioButton ic_new_session_button;
97 Gtk::RadioButton ic_existing_session_button;
98 bool initial_choice_activated(GdkEventButton *);
100 /* monitoring choices */
103 Gtk::Label monitor_label;
104 Gtk::RadioButton monitor_via_hardware_button;
105 Gtk::RadioButton monitor_via_ardour_button;
106 void setup_monitoring_choice_page ();
108 /* session page (could be new or existing) */
110 void setup_session_page ();
111 Gtk::VBox session_vbox;
112 Gtk::HBox session_hbox;
114 /* recent sessions */
116 void setup_existing_session_page ();
118 struct RecentSessionsSorter {
119 bool operator() (std::pair<std::string,std::string> a, std::pair<std::string,std::string> b) const {
120 return cmp_nocase(a.first, b.first) == -1;
124 struct RecentSessionModelColumns : public Gtk::TreeModel::ColumnRecord {
125 RecentSessionModelColumns() {
129 Gtk::TreeModelColumn<Glib::ustring> visible_name;
130 Gtk::TreeModelColumn<Glib::ustring> fullpath;
133 RecentSessionModelColumns recent_session_columns;
134 Gtk::TreeView recent_session_display;
135 Glib::RefPtr<Gtk::TreeStore> recent_session_model;
136 Gtk::ScrolledWindow recent_scroller;
137 void redisplay_recent_sessions ();
138 void recent_session_row_selected ();
139 void recent_row_activated (const Gtk::TreePath& path, Gtk::TreeViewColumn* col);
141 /* audio setup page */
143 void setup_audio_page ();
144 EngineControl* engine_dialog;
148 void setup_new_session_page ();
149 Gtk::Entry new_name_entry;
150 Gtk::FileChooserButton new_folder_chooser;
151 Gtk::FileChooserButton session_template_chooser;
153 struct SessionTemplateColumns : public Gtk::TreeModel::ColumnRecord {
154 SessionTemplateColumns () {
159 Gtk::TreeModelColumn<std::string> name;
160 Gtk::TreeModelColumn<std::string> path;
163 SessionTemplateColumns session_template_columns;
164 Glib::RefPtr<Gtk::ListStore> template_model;
165 Gtk::ComboBox template_chooser;
167 Gtk::VBox session_new_vbox;
168 Gtk::CheckButton more_new_session_options_button;
169 Gtk::RadioButtonGroup session_template_group;
170 Gtk::RadioButton use_session_as_template_button;
171 Gtk::RadioButton use_template_button;
173 void more_new_session_options_button_clicked();
174 void new_name_changed ();
175 void populate_session_templates ();
177 /* more options for new sessions */
179 Gtk::VBox more_options_vbox;
181 Gtk::Label chan_count_label_1;
182 Gtk::Label chan_count_label_2;
183 Gtk::Label chan_count_label_3;
184 Gtk::Label chan_count_label_4;
185 Gtk::Table advanced_table;
186 Gtk::HBox input_port_limit_hbox;
187 Gtk::VBox input_port_vbox;
188 Gtk::Table input_table;
189 Gtk::HBox input_hbox;
191 Gtk::Label bus_label;
192 Gtk::Frame bus_frame;
193 Gtk::Table bus_table;
196 Gtk::Label input_label;
197 Gtk::Frame input_frame;
198 Gtk::HBox output_port_limit_hbox;
199 Gtk::VBox output_port_vbox;
200 Gtk::VBox output_conn_vbox;
201 Gtk::VBox output_vbox;
202 Gtk::HBox output_hbox;
204 Gtk::Label output_label;
205 Gtk::Frame output_frame;
206 Gtk::VBox advanced_vbox;
207 Gtk::Label advanced_label;
209 Gtk::CheckButton _create_master_bus;
210 Gtk::SpinButton _master_bus_channel_count;
212 Gtk::CheckButton _create_control_bus;
213 Gtk::SpinButton _control_bus_channel_count;
215 Gtk::CheckButton _connect_inputs;
216 Gtk::CheckButton _limit_input_ports;
217 Gtk::SpinButton _input_limit_count;
219 Gtk::CheckButton _connect_outputs;
220 Gtk::CheckButton _limit_output_ports;
221 Gtk::SpinButton _output_limit_count;
223 Gtk::RadioButtonGroup connect_outputs_group;
224 Gtk::RadioButton _connect_outputs_to_master;
225 Gtk::RadioButton _connect_outputs_to_physical;
227 Gtk::Adjustment _output_limit_count_adj;
228 Gtk::Adjustment _input_limit_count_adj;
229 Gtk::Adjustment _control_bus_channel_count_adj;
230 Gtk::Adjustment _master_bus_channel_count_adj;
232 void connect_inputs_clicked ();
233 void connect_outputs_clicked ();
234 void limit_inputs_clicked ();
235 void limit_outputs_clicked ();
236 void master_bus_button_clicked ();
237 void monitor_bus_button_clicked ();
238 void setup_more_options_page ();
242 void setup_final_page ();
243 Gtk::Label final_page;
247 Glib::RefPtr<Pango::Layout> layout;
251 gint audio_page_index;
252 gint new_user_page_index;
253 gint default_folder_page_index;
254 gint monitoring_page_index;
255 gint session_page_index;
256 gint initial_choice_index;
257 gint final_page_index;
258 gint session_options_page_index;
260 void move_along_now ();
264 #endif /* __gtk2_ardour_startup_h__ */