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>
25 class ArdourStartup
: public Gtk::Assistant
{
30 void set_new_only (bool);
32 Glib::ustring
session_name (bool& should_be_new
);
33 Glib::ustring
session_folder ();
35 bool use_session_template();
36 Glib::ustring
session_template_name();
38 EngineControl
* engine_control() { return engine_dialog
; }
40 // advanced session options
42 bool create_master_bus() const;
43 int master_channel_count() const;
45 bool create_control_bus() const;
46 int control_channel_count() const;
48 bool connect_inputs() const;
49 bool limit_inputs_used_for_connection() const;
50 int input_limit_count() const;
52 bool connect_outputs() const;
53 bool limit_outputs_used_for_connection() const;
54 int output_limit_count() const;
56 bool connect_outs_to_master() const;
57 bool connect_outs_to_physical() const;
59 bool applying () const {
72 void on_prepare (Gtk::Widget
*);
74 static ArdourStartup
*the_startup
;
76 Glib::RefPtr
<Gdk::Pixbuf
> icon_pixbuf
;
78 void setup_new_user_page ();
79 Glib::RefPtr
<Gdk::Pixbuf
> splash_pixbuf
;
80 Gtk::DrawingArea splash_area
;
81 bool splash_expose (GdkEventExpose
* ev
);
83 void setup_first_time_config_page ();
86 Gtk::FileChooserButton
* default_dir_chooser
;
87 void default_dir_changed();
88 void setup_first_page ();
90 /* initial choice page */
92 void setup_initial_choice_page ();
94 Gtk::RadioButton ic_new_session_button
;
95 Gtk::RadioButton ic_existing_session_button
;
96 bool initial_choice_activated(GdkEventButton
*);
98 /* monitoring choices */
101 Gtk::Label monitor_label
;
102 Gtk::RadioButton monitor_via_hardware_button
;
103 Gtk::RadioButton monitor_via_ardour_button
;
104 void setup_monitoring_choice_page ();
106 /* session page (could be new or existing) */
108 void setup_session_page ();
109 Gtk::VBox session_vbox
;
110 Gtk::HBox session_hbox
;
112 /* recent sessions */
114 void setup_existing_session_page ();
116 struct RecentSessionsSorter
{
117 bool operator() (std::pair
<std::string
,std::string
> a
, std::pair
<std::string
,std::string
> b
) const {
118 return cmp_nocase(a
.first
, b
.first
) == -1;
122 struct RecentSessionModelColumns
: public Gtk::TreeModel::ColumnRecord
{
123 RecentSessionModelColumns() {
127 Gtk::TreeModelColumn
<Glib::ustring
> visible_name
;
128 Gtk::TreeModelColumn
<Glib::ustring
> fullpath
;
131 RecentSessionModelColumns recent_session_columns
;
132 Gtk::TreeView recent_session_display
;
133 Glib::RefPtr
<Gtk::TreeStore
> recent_session_model
;
134 Gtk::ScrolledWindow recent_scroller
;
135 void redisplay_recent_sessions ();
136 void recent_session_row_selected ();
137 void recent_row_activated (const Gtk::TreePath
& path
, Gtk::TreeViewColumn
* col
);
139 /* audio setup page */
141 void setup_audio_page ();
142 EngineControl
* engine_dialog
;
146 void setup_new_session_page ();
147 Gtk::Entry new_name_entry
;
148 Gtk::FileChooserButton new_folder_chooser
;
149 Gtk::FileChooserButton session_template_chooser
;
151 struct SessionTemplateColumns
: public Gtk::TreeModel::ColumnRecord
{
152 SessionTemplateColumns () {
157 Gtk::TreeModelColumn
<std::string
> name
;
158 Gtk::TreeModelColumn
<std::string
> path
;
161 SessionTemplateColumns session_template_columns
;
162 Glib::RefPtr
<Gtk::ListStore
> template_model
;
163 Gtk::ComboBox template_chooser
;
165 Gtk::VBox session_new_vbox
;
166 Gtk::CheckButton more_new_session_options_button
;
167 Gtk::RadioButtonGroup session_template_group
;
168 Gtk::RadioButton use_session_as_template_button
;
169 Gtk::RadioButton use_template_button
;
171 void more_new_session_options_button_clicked();
172 void new_name_changed ();
173 void populate_session_templates ();
175 /* more options for new sessions */
177 Gtk::VBox more_options_vbox
;
179 Gtk::Label chan_count_label_1
;
180 Gtk::Label chan_count_label_2
;
181 Gtk::Label chan_count_label_3
;
182 Gtk::Label chan_count_label_4
;
183 Gtk::Table advanced_table
;
184 Gtk::HBox input_port_limit_hbox
;
185 Gtk::VBox input_port_vbox
;
186 Gtk::Table input_table
;
187 Gtk::HBox input_hbox
;
189 Gtk::Label bus_label
;
190 Gtk::Frame bus_frame
;
191 Gtk::Table bus_table
;
194 Gtk::Label input_label
;
195 Gtk::Frame input_frame
;
196 Gtk::HBox output_port_limit_hbox
;
197 Gtk::VBox output_port_vbox
;
198 Gtk::VBox output_conn_vbox
;
199 Gtk::VBox output_vbox
;
200 Gtk::HBox output_hbox
;
202 Gtk::Label output_label
;
203 Gtk::Frame output_frame
;
204 Gtk::VBox advanced_vbox
;
205 Gtk::Label advanced_label
;
207 Gtk::CheckButton _create_master_bus
;
208 Gtk::SpinButton _master_bus_channel_count
;
210 Gtk::CheckButton _create_control_bus
;
211 Gtk::SpinButton _control_bus_channel_count
;
213 Gtk::CheckButton _connect_inputs
;
214 Gtk::CheckButton _limit_input_ports
;
215 Gtk::SpinButton _input_limit_count
;
217 Gtk::CheckButton _connect_outputs
;
218 Gtk::CheckButton _limit_output_ports
;
219 Gtk::SpinButton _output_limit_count
;
221 Gtk::RadioButtonGroup connect_outputs_group
;
222 Gtk::RadioButton _connect_outputs_to_master
;
223 Gtk::RadioButton _connect_outputs_to_physical
;
225 Gtk::Adjustment _output_limit_count_adj
;
226 Gtk::Adjustment _input_limit_count_adj
;
227 Gtk::Adjustment _control_bus_channel_count_adj
;
228 Gtk::Adjustment _master_bus_channel_count_adj
;
230 void connect_inputs_clicked ();
231 void connect_outputs_clicked ();
232 void limit_inputs_clicked ();
233 void limit_outputs_clicked ();
234 void master_bus_button_clicked ();
235 void monitor_bus_button_clicked ();
236 void setup_more_options_page ();
240 void setup_final_page ();
241 Gtk::Label final_page
;
245 Glib::RefPtr
<Pango::Layout
> layout
;
249 gint audio_page_index
;
250 gint new_user_page_index
;
251 gint default_folder_page_index
;
252 gint monitoring_page_index
;
253 gint session_page_index
;
254 gint initial_choice_index
;
255 gint final_page_index
;
256 gint session_options_page_index
;
258 void move_along_now ();
262 #endif /* __gtk2_ardour_startup_h__ */