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 gint response () const {
73 bool on_delete_event (GdkEventAny*);
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_button_press(GdkEventButton *);
99 void initial_button_activated();
101 /* monitoring choices */
104 Gtk::Label monitor_label;
105 Gtk::RadioButton monitor_via_hardware_button;
106 Gtk::RadioButton monitor_via_ardour_button;
107 void setup_monitoring_choice_page ();
109 /* session page (could be new or existing) */
111 void setup_session_page ();
112 Gtk::VBox session_vbox;
113 Gtk::HBox session_hbox;
115 /* recent sessions */
117 void setup_existing_session_page ();
119 struct RecentSessionsSorter {
120 bool operator() (std::pair<std::string,std::string> a, std::pair<std::string,std::string> b) const {
121 return cmp_nocase(a.first, b.first) == -1;
125 struct RecentSessionModelColumns : public Gtk::TreeModel::ColumnRecord {
126 RecentSessionModelColumns() {
130 Gtk::TreeModelColumn<Glib::ustring> visible_name;
131 Gtk::TreeModelColumn<Glib::ustring> fullpath;
134 RecentSessionModelColumns recent_session_columns;
135 Gtk::TreeView recent_session_display;
136 Glib::RefPtr<Gtk::TreeStore> recent_session_model;
137 Gtk::ScrolledWindow recent_scroller;
138 int redisplay_recent_sessions ();
139 void recent_session_row_selected ();
140 void recent_row_activated (const Gtk::TreePath& path, Gtk::TreeViewColumn* col);
142 /* audio setup page */
144 void setup_audio_page ();
145 EngineControl* engine_dialog;
149 void setup_new_session_page ();
150 Gtk::Entry new_name_entry;
151 Gtk::FileChooserButton new_folder_chooser;
152 Gtk::FileChooserButton session_template_chooser;
154 struct SessionTemplateColumns : public Gtk::TreeModel::ColumnRecord {
155 SessionTemplateColumns () {
160 Gtk::TreeModelColumn<std::string> name;
161 Gtk::TreeModelColumn<std::string> path;
164 SessionTemplateColumns session_template_columns;
165 Glib::RefPtr<Gtk::ListStore> template_model;
166 Gtk::ComboBox template_chooser;
168 Gtk::VBox session_new_vbox;
169 Gtk::CheckButton more_new_session_options_button;
170 Gtk::RadioButtonGroup session_template_group;
171 Gtk::RadioButton use_session_as_template_button;
172 Gtk::RadioButton use_template_button;
174 void more_new_session_options_button_clicked();
175 void new_name_changed ();
176 void populate_session_templates ();
178 /* more options for new sessions */
180 Gtk::VBox more_options_vbox;
182 Gtk::Label chan_count_label_1;
183 Gtk::Label chan_count_label_2;
184 Gtk::Label chan_count_label_3;
185 Gtk::Label chan_count_label_4;
186 Gtk::Table advanced_table;
187 Gtk::HBox input_port_limit_hbox;
188 Gtk::VBox input_port_vbox;
189 Gtk::Table input_table;
190 Gtk::HBox input_hbox;
192 Gtk::Label bus_label;
193 Gtk::Frame bus_frame;
194 Gtk::Table bus_table;
197 Gtk::Label input_label;
198 Gtk::Frame input_frame;
199 Gtk::HBox output_port_limit_hbox;
200 Gtk::VBox output_port_vbox;
201 Gtk::VBox output_conn_vbox;
202 Gtk::VBox output_vbox;
203 Gtk::HBox output_hbox;
205 Gtk::Label output_label;
206 Gtk::Frame output_frame;
207 Gtk::VBox advanced_vbox;
208 Gtk::Label advanced_label;
210 Gtk::CheckButton _create_master_bus;
211 Gtk::SpinButton _master_bus_channel_count;
213 Gtk::CheckButton _create_control_bus;
214 Gtk::SpinButton _control_bus_channel_count;
216 Gtk::CheckButton _connect_inputs;
217 Gtk::CheckButton _limit_input_ports;
218 Gtk::SpinButton _input_limit_count;
220 Gtk::CheckButton _connect_outputs;
221 Gtk::CheckButton _limit_output_ports;
222 Gtk::SpinButton _output_limit_count;
224 Gtk::RadioButtonGroup connect_outputs_group;
225 Gtk::RadioButton _connect_outputs_to_master;
226 Gtk::RadioButton _connect_outputs_to_physical;
228 Gtk::Adjustment _output_limit_count_adj;
229 Gtk::Adjustment _input_limit_count_adj;
230 Gtk::Adjustment _control_bus_channel_count_adj;
231 Gtk::Adjustment _master_bus_channel_count_adj;
233 void connect_inputs_clicked ();
234 void connect_outputs_clicked ();
235 void limit_inputs_clicked ();
236 void limit_outputs_clicked ();
237 void master_bus_button_clicked ();
238 void monitor_bus_button_clicked ();
239 void setup_more_options_page ();
243 void setup_final_page ();
244 Gtk::Label final_page;
248 Glib::RefPtr<Pango::Layout> layout;
252 gint audio_page_index;
253 gint new_user_page_index;
254 gint default_folder_page_index;
255 gint monitoring_page_index;
256 gint session_page_index;
257 gint initial_choice_index;
258 gint final_page_index;
259 gint session_options_page_index;
261 void move_along_now ();
265 #endif /* __gtk2_ardour_startup_h__ */