4 #include <gtkmm/main.h>
5 #include <gtkmm/filechooser.h>
7 #include "pbd/failed_constructor.h"
8 #include "pbd/file_utils.h"
9 #include "pbd/filesystem.h"
11 #include "ardour/filesystem_paths.h"
12 #include "ardour/recent_sessions.h"
13 #include "ardour/session.h"
14 #include "ardour/session_state_utils.h"
15 #include "ardour/template_utils.h"
18 #include "engine_dialog.h"
26 using namespace ARDOUR;
28 ArdourStartup* ArdourStartup::the_startup = 0;
30 ArdourStartup::ArdourStartup ()
32 , ic_new_session_button (_("Open a new session"))
33 , ic_existing_session_button (_("Open an existing session"))
34 , more_new_session_options_button (_("I'd like more options for this session"))
35 , monitor_via_hardware_button (_("Use an external mixer or the hardware mixer of your audio interface.\n\
36 Ardour will play NO role in monitoring"))
37 , monitor_via_ardour_button (_("Ask Ardour to playback material as it is being recorded"))
38 , new_folder_chooser (FILE_CHOOSER_ACTION_SELECT_FOLDER)
39 , _output_limit_count_adj (1, 0, 100, 1, 10, 0)
40 , _input_limit_count_adj (1, 0, 100, 1, 10, 0)
41 , _control_bus_channel_count_adj (2, 0, 100, 1, 10, 0)
42 , _master_bus_channel_count_adj (2, 0, 100, 1, 10, 0)
45 audio_page_index = -1;
46 initial_choice_index = -1;
47 new_user_page_index = -1;
48 default_folder_page_index = -1;
49 monitoring_page_index = -1;
50 session_page_index = -1;
51 final_page_index = -1;
52 session_options_page_index = -1;
55 config_modified = false;
56 default_dir_chooser = 0;
58 set_keep_above (true);
59 set_position (WIN_POS_CENTER);
63 if (!find_file_in_search_path (ardour_search_path() + system_data_search_path(), "ardour_icon_48px.png", icon_file)) {
64 throw failed_constructor();
68 icon_pixbuf = Gdk::Pixbuf::create_from_file (icon_file.to_string());
72 throw failed_constructor();
75 sys::path been_here_before = user_config_directory();
76 been_here_before /= ".a3"; // XXXX use more specific version so we can catch upgrades
77 bool new_user = !exists (been_here_before);
78 bool need_audio_setup = !EngineControl::engine_running();
81 /* "touch" the file */
82 ofstream fout (been_here_before.to_string().c_str());
83 setup_new_user_page ();
84 setup_first_time_config_page ();
85 setup_monitoring_choice_page ();
87 if (need_audio_setup) {
93 if (need_audio_setup) {
97 setup_initial_choice_page ();
100 setup_session_page ();
101 setup_more_options_page ();
110 ArdourStartup::~ArdourStartup ()
115 ArdourStartup::session_name (bool& should_be_new)
117 if (ic_new_session_button.get_active()) {
118 should_be_new = true;
119 return new_name_entry.get_text ();
121 should_be_new = false;
123 TreeIter iter = recent_session_display.get_selection()->get_selected();
126 return (*iter)[recent_session_columns.visible_name];
134 ArdourStartup::session_folder ()
136 if (ic_new_session_button.get_active()) {
137 return new_folder_chooser.get_current_folder();
139 TreeIter iter = recent_session_display.get_selection()->get_selected();
142 return (*iter)[recent_session_columns.fullpath];
149 ArdourStartup::setup_audio_page ()
151 engine_dialog = manage (new EngineControl);
153 engine_dialog->show_all ();
155 audio_page_index = append_page (*engine_dialog);
156 set_page_type (*engine_dialog, ASSISTANT_PAGE_CONTENT);
157 set_page_title (*engine_dialog, _("Audio Setup"));
159 /* the default parameters should work, so the page is potentially complete */
161 set_page_complete (*engine_dialog, true);
165 ArdourStartup::setup_new_user_page ()
167 Label* foomatic = manage (new Label);
169 foomatic->set_markup (_("\
170 <span size=\"larger\">Ardour is a digital audio workstation. You can use it to\n\
171 record, edit and mix multi-track audio. You can produce your\n\
172 own CDs, mix video soundtracks, or just experiment with new\n\
173 ideas about music and sound.\n\
175 There are a few things that need to configured before you start\n\
176 using the program.</span>\
179 HBox* hbox = manage (new HBox);
180 HBox* vbox = manage (new HBox);
182 hbox->set_border_width (12);
183 vbox->set_border_width (12);
185 hbox->pack_start (*foomatic, false, true);
186 vbox->pack_start (*hbox, false, true);
192 new_user_page_index = append_page (*vbox);
193 set_page_type (*vbox, ASSISTANT_PAGE_INTRO);
194 set_page_title (*vbox, _("Welcome to Ardour"));
195 set_page_header_image (*vbox, icon_pixbuf);
196 set_page_complete (*vbox, true);
200 ArdourStartup::default_dir_changed ()
202 Config->set_default_session_parent_dir (default_dir_chooser->get_current_folder());
203 config_modified = true;
207 ArdourStartup::setup_first_time_config_page ()
209 default_dir_chooser = manage (new FileChooserButton (_("Default folder for Ardour sessions"),
210 FILE_CHOOSER_ACTION_SELECT_FOLDER));
211 Gtk::Label* txt = manage (new Label);
212 HBox* hbox1 = manage (new HBox);
213 VBox* vbox = manage (new VBox);
215 txt->set_markup (_("\
216 Each project that you work on with Ardour has its own folder.\n\
217 These can require a lot of disk space if you are recording audio.\n\
219 Where would you like new Ardour sessions to be stored by default?\n\
220 <i>(You can put new sessions anywhere - this is just a default)</i>"));
222 hbox1->set_border_width (6);
223 vbox->set_border_width (6);
225 hbox1->pack_start (*default_dir_chooser, false, true);
226 vbox->pack_start (*txt, false, true);
227 vbox->pack_start (*hbox1, false, true);
229 string def = Config->get_default_session_parent_dir();
231 /* XXX really need glob here */
234 def = Glib::get_home_dir();
236 default_dir_chooser->set_current_folder (def);
237 default_dir_chooser->signal_current_folder_changed().connect (mem_fun (*this, &ArdourStartup::default_dir_changed));
238 default_dir_chooser->show ();
244 default_folder_page_index = append_page (*vbox);
245 set_page_title (*vbox, _("Default folder for new sessions"));
246 set_page_header_image (*vbox, icon_pixbuf);
247 set_page_type (*vbox, ASSISTANT_PAGE_CONTENT);
249 /* user can just skip all these settings if they want to */
251 set_page_complete (*vbox, true);
255 ArdourStartup::setup_monitoring_choice_page ()
257 mon_vbox.set_spacing (6);
258 mon_vbox.set_border_width (6);
260 RadioButton::Group g (monitor_via_hardware_button.get_group());
261 monitor_via_ardour_button.set_group (g);
263 monitor_label.set_markup("\
264 While recording instruments or vocals, you probably want to listen to the\n\
265 signal as well as record it. This is called \"monitoring\". There are\n\
266 different ways to do this depending on the equipment you have and the\n\
267 configuration of that equipment. The two most common are presented here.\n\
268 Please choose whichever one is right for your setup.\n\n\
269 <i>You can change this preference at any time, via the Options menu</i>");
271 mon_vbox.pack_start (monitor_label, false, false);
272 mon_vbox.pack_start (monitor_via_hardware_button, false, false);
273 mon_vbox.pack_start (monitor_via_ardour_button, false, false);
276 monitor_label.show ();
277 monitor_via_ardour_button.show ();
278 monitor_via_hardware_button.show ();
280 monitoring_page_index = append_page (mon_vbox);
281 set_page_title (mon_vbox, _("Monitoring Choices"));
282 set_page_header_image (mon_vbox, icon_pixbuf);
284 /* user could just click on "Forward" if default
288 set_page_complete (mon_vbox, true);
292 ArdourStartup::setup_initial_choice_page ()
294 ic_vbox.set_spacing (6);
295 ic_vbox.set_border_width (6);
297 RadioButton::Group g (ic_new_session_button.get_group());
298 ic_existing_session_button.set_group (g);
300 HBox* centering_hbox = manage (new HBox);
301 VBox* centering_vbox = manage (new VBox);
303 centering_vbox->pack_start (ic_new_session_button, false, true);
304 centering_vbox->pack_start (ic_existing_session_button, false, true);
305 centering_vbox->show ();
307 centering_hbox->pack_start (*centering_vbox, true, true);
308 centering_hbox->show ();
310 ic_vbox.pack_start (*centering_hbox, true, true);
312 ic_new_session_button.show ();
313 ic_existing_session_button.show ();
316 initial_choice_index = append_page (ic_vbox);
317 set_page_title (ic_vbox, _("What would you like to do?"));
318 set_page_header_image (ic_vbox, icon_pixbuf);
320 /* user could just click on "Forward" if default
324 set_page_complete (ic_vbox, true);
328 ArdourStartup::setup_session_page ()
330 session_hbox.set_border_width (12);
331 session_vbox.set_border_width (12);
333 session_vbox.pack_start (session_hbox, true, true);
334 session_vbox.show ();
335 session_hbox.show ();
337 session_page_index = append_page (session_vbox);
338 /* initial setting */
339 set_page_type (session_vbox, ASSISTANT_PAGE_CONFIRM);
343 ArdourStartup::setup_final_page ()
345 final_page.set_text ("Ardour is ready for use");
347 final_page_index = append_page (final_page);
348 set_page_complete (final_page, true);
349 set_page_header_image (final_page, icon_pixbuf);
350 set_page_type (final_page, ASSISTANT_PAGE_CONFIRM);
354 ArdourStartup::on_cancel ()
360 ArdourStartup::on_close ()
368 ArdourStartup::on_apply ()
372 // XXX do stuff and then ....
375 engine_dialog->setup_engine ();
378 if (config_modified) {
380 if (default_dir_chooser) {
381 Config->set_default_session_parent_dir (default_dir_chooser->get_current_folder());
384 if (monitor_via_hardware_button.get_active()) {
385 Config->set_monitoring_model (ExternalMonitoring);
386 } else if (monitor_via_ardour_button.get_active()) {
387 Config->set_monitoring_model (SoftwareMonitoring);
390 Config->save_state ();
397 ArdourStartup::on_prepare (Gtk::Widget* page)
399 if (page == &session_vbox) {
401 if (ic_new_session_button.get_active()) {
402 /* new session requested */
403 setup_new_session_page ();
405 /* existing session requested */
406 setup_existing_session_page ();
412 ArdourStartup::setup_new_session_page ()
414 if (!session_hbox.get_children().empty()) {
415 session_hbox.remove (**session_hbox.get_children().begin());
418 if (session_new_vbox.get_children().empty()) {
420 HBox* hbox1 = manage (new HBox);
421 Label* label1 = manage (new Label);
423 hbox1->set_spacing (6);
424 hbox1->pack_start (*label1, false, false);
425 hbox1->pack_start (new_name_entry, true, true);
427 label1->set_text (_("Session name:"));
431 new_name_entry.show ();
433 new_name_entry.signal_changed().connect (mem_fun (*this, &ArdourStartup::new_name_changed));
434 new_name_entry.signal_activate().connect (mem_fun (*this, &ArdourStartup::move_along_now));
436 HBox* hbox2 = manage (new HBox);
437 Label* label2 = manage (new Label);
439 hbox2->set_spacing (6);
440 hbox2->pack_start (*label2, false, false);
441 hbox2->pack_start (new_folder_chooser, true, true);
443 label2->set_text (_("Create session folder in:"));
445 string def = Config->get_default_session_parent_dir();
447 /* XXX really need glob here */
450 def = Glib::get_home_dir();
453 new_folder_chooser.set_current_folder (def);
454 new_folder_chooser.set_title (_("Select folder for session"));
458 new_folder_chooser.show ();
460 if (is_directory (user_template_directory ())) {
461 session_template_chooser.set_current_folder (user_template_directory().to_string());
462 } else if (is_directory (system_template_directory ())) {
463 session_template_chooser.set_current_folder (system_template_directory().to_string());
465 /* hmm, no templates ... what to do? */
468 if (is_directory (system_template_directory ())) {
469 session_template_chooser.add_shortcut_folder (system_template_directory().to_string());
472 HBox* hbox3 = manage (new HBox);
473 Label* label3 = manage (new Label);
475 hbox3->set_spacing (6);
476 hbox3->pack_start (*label3, false, false);
477 hbox3->pack_start (session_template_chooser, true, true);
479 label3->set_text (_("Use this template:"));
483 session_template_chooser.show ();
485 Gtk::FileFilter* template_filter = manage (new (Gtk::FileFilter));
486 template_filter->add_pattern(X_("*.template"));
487 session_template_chooser.set_filter (*template_filter);
488 session_template_chooser.set_title (_("Select template"));
491 HBox* hbox4 = manage (new HBox);
493 hbox4->set_spacing (6);
494 hbox4->pack_start (more_new_session_options_button, false, false);
497 more_new_session_options_button.show ();
498 more_new_session_options_button.signal_clicked().connect (mem_fun (*this, &ArdourStartup::more_new_session_options_button_clicked));
499 session_new_vbox.set_spacing (12);
501 session_new_vbox.pack_start (*hbox1, false, false);
502 session_new_vbox.pack_start (*hbox2, false, false);
503 session_new_vbox.pack_start (*hbox3, false, false);
504 session_new_vbox.pack_start (*hbox4, false, false);
507 session_new_vbox.show ();
508 session_hbox.pack_start (session_new_vbox, false, false);
509 set_page_title (session_vbox, _("New Session"));
510 set_page_type (session_vbox, ASSISTANT_PAGE_CONFIRM);
512 new_name_entry.grab_focus ();
516 ArdourStartup::new_name_changed ()
518 if (!new_name_entry.get_text().empty()) {
519 set_page_complete (session_vbox, true);
521 set_page_complete (session_vbox, false);
526 ArdourStartup::redisplay_recent_sessions ()
528 std::vector<sys::path> session_directories;
529 RecentSessionsSorter cmp;
531 recent_session_display.set_model (Glib::RefPtr<TreeModel>(0));
532 recent_session_model->clear ();
534 ARDOUR::RecentSessions rs;
535 ARDOUR::read_recent_sessions (rs);
538 recent_session_display.set_model (recent_session_model);
542 // sort them alphabetically
543 sort (rs.begin(), rs.end(), cmp);
545 for (ARDOUR::RecentSessions::iterator i = rs.begin(); i != rs.end(); ++i) {
546 session_directories.push_back ((*i).second);
549 for (vector<sys::path>::const_iterator i = session_directories.begin(); i != session_directories.end(); ++i)
551 std::vector<sys::path> state_file_paths;
553 // now get available states for this session
555 get_state_files_in_directory (*i, state_file_paths);
557 vector<string*>* states;
558 vector<const gchar*> item;
559 string fullpath = (*i).to_string();
561 /* remove any trailing / */
563 if (fullpath[fullpath.length()-1] == '/') {
564 fullpath = fullpath.substr (0, fullpath.length()-1);
567 /* check whether session still exists */
568 if (!Glib::file_test(fullpath.c_str(), Glib::FILE_TEST_EXISTS)) {
569 /* session doesn't exist */
573 /* now get available states for this session */
575 if ((states = Session::possible_states (fullpath)) == 0) {
580 std::vector<string> state_file_names(get_file_names_no_extension (state_file_paths));
582 Gtk::TreeModel::Row row = *(recent_session_model->append());
584 row[recent_session_columns.visible_name] = Glib::path_get_basename (fullpath);
585 row[recent_session_columns.fullpath] = fullpath;
587 if (state_file_names.size() > 1) {
591 for (std::vector<std::string>::iterator i2 = state_file_names.begin();
592 i2 != state_file_names.end(); ++i2)
595 Gtk::TreeModel::Row child_row = *(recent_session_model->append (row.children()));
597 child_row[recent_session_columns.visible_name] = *i2;
598 child_row[recent_session_columns.fullpath] = fullpath;
603 recent_session_display.set_model (recent_session_model);
607 ArdourStartup::recent_session_row_selected ()
609 if (recent_session_display.get_selection()->count_selected_rows() > 0) {
610 set_page_complete (session_vbox, true);
612 set_page_complete (session_vbox, false);
617 ArdourStartup::setup_existing_session_page ()
619 if (!session_hbox.get_children().empty()) {
620 session_hbox.remove (**session_hbox.get_children().begin());
623 if (recent_scroller.get_children().empty()) {
625 recent_session_model = TreeStore::create (recent_session_columns);
626 recent_session_display.set_model (recent_session_model);
627 recent_session_display.append_column (_("Recent Sessions"), recent_session_columns.visible_name);
628 recent_session_display.set_headers_visible (false);
629 recent_session_display.get_selection()->set_mode (SELECTION_BROWSE);
631 recent_session_display.get_selection()->signal_changed().connect (mem_fun (*this, &ArdourStartup::recent_session_row_selected));
633 recent_scroller.add (recent_session_display);
634 recent_scroller.set_policy (Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC);
636 recent_session_display.show();
639 recent_scroller.show();
640 redisplay_recent_sessions ();
641 recent_session_display.signal_row_activated().connect (mem_fun (*this, &ArdourStartup::recent_row_activated));
643 session_hbox.pack_start (recent_scroller, true, true);
644 set_page_title (session_vbox, _("Select a session"));
645 set_page_type (session_vbox, ASSISTANT_PAGE_CONFIRM);
649 ArdourStartup::more_new_session_options_button_clicked ()
651 if (more_new_session_options_button.get_active()) {
652 more_options_vbox.show_all ();
653 set_page_type (more_options_vbox, ASSISTANT_PAGE_CONFIRM);
654 set_page_type (session_vbox, ASSISTANT_PAGE_CONTENT);
656 set_page_type (session_vbox, ASSISTANT_PAGE_CONFIRM);
657 more_options_vbox.hide ();
662 ArdourStartup::setup_more_options_page ()
664 more_options_vbox.set_border_width (12);
666 _output_limit_count.set_adjustment (_output_limit_count_adj);
667 _input_limit_count.set_adjustment (_input_limit_count_adj);
668 _control_bus_channel_count.set_adjustment (_control_bus_channel_count_adj);
669 _master_bus_channel_count.set_adjustment (_master_bus_channel_count_adj);
671 chan_count_label_1.set_text (_("channels"));
672 chan_count_label_2.set_text (_("channels"));
673 chan_count_label_3.set_text (_("channels"));
674 chan_count_label_4.set_text (_("channels"));
676 chan_count_label_1.set_alignment(0,0.5);
677 chan_count_label_1.set_padding(0,0);
678 chan_count_label_1.set_line_wrap(false);
680 chan_count_label_2.set_alignment(0,0.5);
681 chan_count_label_2.set_padding(0,0);
682 chan_count_label_2.set_line_wrap(false);
684 chan_count_label_3.set_alignment(0,0.5);
685 chan_count_label_3.set_padding(0,0);
686 chan_count_label_3.set_line_wrap(false);
688 chan_count_label_4.set_alignment(0,0.5);
689 chan_count_label_4.set_padding(0,0);
690 chan_count_label_4.set_line_wrap(false);
692 bus_label.set_markup (_("<b>Busses</b>"));
693 input_label.set_markup (_("<b>Inputs</b>"));
694 output_label.set_markup (_("<b>Outputs</b>"));
696 _create_control_bus.set_label (_("Create monitor bus"));
697 _create_control_bus.set_flags(Gtk::CAN_FOCUS);
698 _create_control_bus.set_relief(Gtk::RELIEF_NORMAL);
699 _create_control_bus.set_mode(true);
700 _create_control_bus.set_active(false);
701 _create_control_bus.set_border_width(0);
703 _control_bus_channel_count.set_flags(Gtk::CAN_FOCUS);
704 _control_bus_channel_count.set_update_policy(Gtk::UPDATE_ALWAYS);
705 _control_bus_channel_count.set_numeric(true);
706 _control_bus_channel_count.set_digits(0);
707 _control_bus_channel_count.set_wrap(false);
708 _control_bus_channel_count.set_sensitive(false);
710 _master_bus_channel_count.set_flags(Gtk::CAN_FOCUS);
711 _master_bus_channel_count.set_update_policy(Gtk::UPDATE_ALWAYS);
712 _master_bus_channel_count.set_numeric(true);
713 _master_bus_channel_count.set_digits(0);
714 _master_bus_channel_count.set_wrap(false);
716 _create_master_bus.set_label (_("Create master bus"));
717 _create_master_bus.set_flags(Gtk::CAN_FOCUS);
718 _create_master_bus.set_relief(Gtk::RELIEF_NORMAL);
719 _create_master_bus.set_mode(true);
720 _create_master_bus.set_active(true);
721 _create_master_bus.set_border_width(0);
723 advanced_table.set_row_spacings(0);
724 advanced_table.set_col_spacings(0);
726 _connect_inputs.set_label (_("Automatically connect to physical_inputs"));
727 _connect_inputs.set_flags(Gtk::CAN_FOCUS);
728 _connect_inputs.set_relief(Gtk::RELIEF_NORMAL);
729 _connect_inputs.set_mode(true);
730 _connect_inputs.set_active(true);
731 _connect_inputs.set_border_width(0);
733 _limit_input_ports.set_label (_("Use only"));
734 _limit_input_ports.set_flags(Gtk::CAN_FOCUS);
735 _limit_input_ports.set_relief(Gtk::RELIEF_NORMAL);
736 _limit_input_ports.set_mode(true);
737 _limit_input_ports.set_sensitive(true);
738 _limit_input_ports.set_border_width(0);
740 _input_limit_count.set_flags(Gtk::CAN_FOCUS);
741 _input_limit_count.set_update_policy(Gtk::UPDATE_ALWAYS);
742 _input_limit_count.set_numeric(true);
743 _input_limit_count.set_digits(0);
744 _input_limit_count.set_wrap(false);
745 _input_limit_count.set_sensitive(false);
747 bus_hbox.pack_start (bus_table, Gtk::PACK_SHRINK, 18);
749 bus_label.set_alignment(0, 0.5);
750 bus_label.set_padding(0,0);
751 bus_label.set_line_wrap(false);
752 bus_label.set_selectable(false);
753 bus_label.set_use_markup(true);
754 bus_frame.set_shadow_type(Gtk::SHADOW_NONE);
755 bus_frame.set_label_align(0,0.5);
756 bus_frame.add(bus_hbox);
757 bus_frame.set_label_widget(bus_label);
759 bus_table.set_row_spacings (0);
760 bus_table.set_col_spacings (0);
761 bus_table.attach (_create_master_bus, 0, 1, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
762 bus_table.attach (_master_bus_channel_count, 1, 2, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
763 bus_table.attach (chan_count_label_1, 2, 3, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 6, 0);
764 bus_table.attach (_create_control_bus, 0, 1, 1, 2, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
765 bus_table.attach (_control_bus_channel_count, 1, 2, 1, 2, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
766 bus_table.attach (chan_count_label_2, 2, 3, 1, 2, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 6, 0);
768 input_port_limit_hbox.pack_start(_limit_input_ports, Gtk::PACK_SHRINK, 6);
769 input_port_limit_hbox.pack_start(_input_limit_count, Gtk::PACK_SHRINK, 0);
770 input_port_limit_hbox.pack_start(chan_count_label_3, Gtk::PACK_SHRINK, 6);
771 input_port_vbox.pack_start(_connect_inputs, Gtk::PACK_SHRINK, 0);
772 input_port_vbox.pack_start(input_port_limit_hbox, Gtk::PACK_EXPAND_PADDING, 0);
773 input_table.set_row_spacings(0);
774 input_table.set_col_spacings(0);
775 input_table.attach(input_port_vbox, 0, 1, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 6, 6);
777 input_hbox.pack_start (input_table, Gtk::PACK_SHRINK, 18);
779 input_label.set_alignment(0, 0.5);
780 input_label.set_padding(0,0);
781 input_label.set_line_wrap(false);
782 input_label.set_selectable(false);
783 input_label.set_use_markup(true);
784 input_frame.set_shadow_type(Gtk::SHADOW_NONE);
785 input_frame.set_label_align(0,0.5);
786 input_frame.add(input_hbox);
787 input_frame.set_label_widget(input_label);
789 _connect_outputs.set_label (_("Automatically connect outputs"));
790 _connect_outputs.set_flags(Gtk::CAN_FOCUS);
791 _connect_outputs.set_relief(Gtk::RELIEF_NORMAL);
792 _connect_outputs.set_mode(true);
793 _connect_outputs.set_active(true);
794 _connect_outputs.set_border_width(0);
795 _limit_output_ports.set_label (_("Use only"));
796 _limit_output_ports.set_flags(Gtk::CAN_FOCUS);
797 _limit_output_ports.set_relief(Gtk::RELIEF_NORMAL);
798 _limit_output_ports.set_mode(true);
799 _limit_output_ports.set_sensitive(true);
800 _limit_output_ports.set_border_width(0);
801 _output_limit_count.set_flags(Gtk::CAN_FOCUS);
802 _output_limit_count.set_update_policy(Gtk::UPDATE_ALWAYS);
803 _output_limit_count.set_numeric(false);
804 _output_limit_count.set_digits(0);
805 _output_limit_count.set_wrap(false);
806 _output_limit_count.set_sensitive(false);
807 output_port_limit_hbox.pack_start(_limit_output_ports, Gtk::PACK_SHRINK, 6);
808 output_port_limit_hbox.pack_start(_output_limit_count, Gtk::PACK_SHRINK, 0);
809 output_port_limit_hbox.pack_start(chan_count_label_4, Gtk::PACK_SHRINK, 6);
811 _connect_outputs_to_master.set_label (_("... to master bus"));
812 _connect_outputs_to_master.set_flags(Gtk::CAN_FOCUS);
813 _connect_outputs_to_master.set_relief(Gtk::RELIEF_NORMAL);
814 _connect_outputs_to_master.set_mode(true);
815 _connect_outputs_to_master.set_active(false);
816 _connect_outputs_to_master.set_border_width(0);
818 _connect_outputs_to_master.set_group (connect_outputs_group);
819 _connect_outputs_to_physical.set_group (connect_outputs_group);
821 _connect_outputs_to_physical.set_label (_("... to physical outputs"));
822 _connect_outputs_to_physical.set_flags(Gtk::CAN_FOCUS);
823 _connect_outputs_to_physical.set_relief(Gtk::RELIEF_NORMAL);
824 _connect_outputs_to_physical.set_mode(true);
825 _connect_outputs_to_physical.set_active(false);
826 _connect_outputs_to_physical.set_border_width(0);
828 output_conn_vbox.pack_start(_connect_outputs, Gtk::PACK_SHRINK, 0);
829 output_conn_vbox.pack_start(_connect_outputs_to_master, Gtk::PACK_SHRINK, 0);
830 output_conn_vbox.pack_start(_connect_outputs_to_physical, Gtk::PACK_SHRINK, 0);
831 output_vbox.set_border_width(6);
833 output_port_vbox.pack_start(output_port_limit_hbox, Gtk::PACK_SHRINK, 0);
835 output_vbox.pack_start(output_conn_vbox);
836 output_vbox.pack_start(output_port_vbox);
838 output_label.set_alignment(0, 0.5);
839 output_label.set_padding(0,0);
840 output_label.set_line_wrap(false);
841 output_label.set_selectable(false);
842 output_label.set_use_markup(true);
843 output_frame.set_shadow_type(Gtk::SHADOW_NONE);
844 output_frame.set_label_align(0,0.5);
846 output_hbox.pack_start (output_vbox, Gtk::PACK_SHRINK, 18);
848 output_frame.add(output_hbox);
849 output_frame.set_label_widget(output_label);
851 more_options_vbox.pack_start(advanced_table, Gtk::PACK_SHRINK, 0);
852 more_options_vbox.pack_start(bus_frame, Gtk::PACK_SHRINK, 6);
853 more_options_vbox.pack_start(input_frame, Gtk::PACK_SHRINK, 6);
854 more_options_vbox.pack_start(output_frame, Gtk::PACK_SHRINK, 0);
858 _connect_inputs.signal_clicked().connect (mem_fun (*this, &ArdourStartup::connect_inputs_clicked));
859 _connect_outputs.signal_clicked().connect (mem_fun (*this, &ArdourStartup::connect_outputs_clicked));
860 _limit_input_ports.signal_clicked().connect (mem_fun (*this, &ArdourStartup::limit_inputs_clicked));
861 _limit_output_ports.signal_clicked().connect (mem_fun (*this, &ArdourStartup::limit_outputs_clicked));
862 _create_master_bus.signal_clicked().connect (mem_fun (*this, &ArdourStartup::master_bus_button_clicked));
863 _create_control_bus.signal_clicked().connect (mem_fun (*this, &ArdourStartup::monitor_bus_button_clicked));
865 /* note that more_options_vbox is NOT visible by
866 * default. this is entirely by design - this page
867 * should be skipped unless explicitly requested.
870 session_options_page_index = append_page (more_options_vbox);
871 set_page_title (more_options_vbox, _("Advanced Session Options"));
872 set_page_complete (more_options_vbox, true);
876 ArdourStartup::create_master_bus() const
878 return _create_master_bus.get_active();
882 ArdourStartup::master_channel_count() const
884 return _master_bus_channel_count.get_value_as_int();
888 ArdourStartup::create_control_bus() const
890 return _create_control_bus.get_active();
894 ArdourStartup::control_channel_count() const
896 return _control_bus_channel_count.get_value_as_int();
900 ArdourStartup::connect_inputs() const
902 return _connect_inputs.get_active();
906 ArdourStartup::limit_inputs_used_for_connection() const
908 return _limit_input_ports.get_active();
912 ArdourStartup::input_limit_count() const
914 return _input_limit_count.get_value_as_int();
918 ArdourStartup::connect_outputs() const
920 return _connect_outputs.get_active();
924 ArdourStartup::limit_outputs_used_for_connection() const
926 return _limit_output_ports.get_active();
930 ArdourStartup::output_limit_count() const
932 return _output_limit_count.get_value_as_int();
936 ArdourStartup::connect_outs_to_master() const
938 return _connect_outputs_to_master.get_active();
942 ArdourStartup::connect_outs_to_physical() const
944 return _connect_outputs_to_physical.get_active();
948 ArdourStartup::connect_inputs_clicked ()
950 _limit_input_ports.set_sensitive(_connect_inputs.get_active());
952 if (_connect_inputs.get_active() && _limit_input_ports.get_active()) {
953 _input_limit_count.set_sensitive(true);
955 _input_limit_count.set_sensitive(false);
960 ArdourStartup::connect_outputs_clicked ()
962 _limit_output_ports.set_sensitive(_connect_outputs.get_active());
964 if (_connect_outputs.get_active() && _limit_output_ports.get_active()) {
965 _output_limit_count.set_sensitive(true);
967 _output_limit_count.set_sensitive(false);
972 ArdourStartup::limit_inputs_clicked ()
974 _input_limit_count.set_sensitive(_limit_input_ports.get_active());
978 ArdourStartup::limit_outputs_clicked ()
980 _output_limit_count.set_sensitive(_limit_output_ports.get_active());
984 ArdourStartup::master_bus_button_clicked ()
986 _master_bus_channel_count.set_sensitive(_create_master_bus.get_active());
990 ArdourStartup::monitor_bus_button_clicked ()
992 _control_bus_channel_count.set_sensitive(_create_control_bus.get_active());
996 ArdourStartup::move_along_now ()
998 gint cur = get_current_page ();
1000 if (cur == session_page_index) {
1001 if (more_new_session_options_button.get_active()) {
1002 set_current_page (session_options_page_index);
1010 ArdourStartup::recent_row_activated (const Gtk::TreePath& path, Gtk::TreeViewColumn* col)
1012 set_page_complete (session_vbox, true);