+NewSessionDialog::NewSessionDialog()
+ : ArdourDialog ("session control")
+{
+ in_destructor = false;
+ session_name_label = new Gtk::Label(_("Name:"));
+ m_name = new Gtk::Entry();
+ m_name->set_text(ARDOUR_COMMAND_LINE::session_name);
+
+ chan_count_label_1 = new Gtk::Label(_("channels"));
+ chan_count_label_2 = new Gtk::Label(_("channels"));
+ chan_count_label_3 = new Gtk::Label(_("channels"));
+ chan_count_label_4 = new Gtk::Label(_("channels"));
+
+ chan_count_label_1->set_alignment(0,0.5);
+ chan_count_label_1->set_padding(0,0);
+ chan_count_label_1->set_line_wrap(false);
+
+ chan_count_label_2->set_alignment(0,0.5);
+ chan_count_label_2->set_padding(0,0);
+ chan_count_label_2->set_line_wrap(false);
+
+ chan_count_label_3->set_alignment(0,0.5);
+ chan_count_label_3->set_padding(0,0);
+ chan_count_label_3->set_line_wrap(false);
+
+ chan_count_label_4->set_alignment(0,0.5);
+ chan_count_label_4->set_padding(0,0);
+ chan_count_label_4->set_line_wrap(false);
+
+ bus_label = new Gtk::Label(_("<b>Busses</b>"));
+ input_label = new Gtk::Label(_("<b>Inputs</b>"));
+ output_label = new Gtk::Label(_("<b>Outputs</b>"));
+
+ session_location_label = new Gtk::Label(_("Create folder in:"));
+ m_folder = new Gtk::FileChooserButton(Gtk::FILE_CHOOSER_ACTION_SELECT_FOLDER);
+ session_template_label = new Gtk::Label(_("Template:"));
+ m_template = new Gtk::FileChooserButton();
+ m_create_control_bus = new Gtk::CheckButton(_("Create monitor bus"));
+
+ Gtk::Adjustment *m_control_bus_channel_count_adj = Gtk::manage(new Gtk::Adjustment(2, 0, 100, 1, 10, 0));
+ m_control_bus_channel_count = new Gtk::SpinButton(*m_control_bus_channel_count_adj, 1, 0);
+
+ Gtk::Adjustment *m_master_bus_channel_count_adj = Gtk::manage(new Gtk::Adjustment(2, 0, 100, 1, 10, 0));
+ m_master_bus_channel_count = new Gtk::SpinButton(*m_master_bus_channel_count_adj, 1, 0);
+ m_create_master_bus = new Gtk::CheckButton(_("Create master bus"));
+ advanced_table = new Gtk::Table(2, 2, true);
+ m_connect_inputs = new Gtk::CheckButton(_("Automatically connect to physical inputs"));
+ m_limit_input_ports = new Gtk::CheckButton(_("Use only"));
+
+ Gtk::Adjustment *m_input_limit_count_adj = Gtk::manage(new Gtk::Adjustment(1, 0, 100, 1, 10, 0));
+ m_input_limit_count = new Gtk::SpinButton(*m_input_limit_count_adj, 1, 0);
+ input_port_limit_hbox = new Gtk::HBox(false, 0);
+ input_port_vbox = new Gtk::VBox(false, 0);
+ input_table = new Gtk::Table(2, 2, false);
+
+ bus_frame = new Gtk::Frame();
+ bus_table = new Gtk::Table (2, 3, false);
+
+ input_frame = new Gtk::Frame();
+ m_connect_outputs = new Gtk::CheckButton(_("Automatically connect outputs"));
+ m_limit_output_ports = new Gtk::CheckButton(_("Use only"));
+
+ Gtk::Adjustment *m_output_limit_count_adj = Gtk::manage(new Gtk::Adjustment(1, 0, 100, 1, 10, 0));
+ m_output_limit_count = new Gtk::SpinButton(*m_output_limit_count_adj, 1, 0);
+ output_port_limit_hbox = new Gtk::HBox(false, 0);
+ output_port_vbox = new Gtk::VBox(false, 0);
+
+ Gtk::RadioButton::Group _RadioBGroup_m_connect_outputs_to_master;
+ m_connect_outputs_to_master = new Gtk::RadioButton(_RadioBGroup_m_connect_outputs_to_master, _("... to master bus"));
+ m_connect_outputs_to_physical = new Gtk::RadioButton(_RadioBGroup_m_connect_outputs_to_master, _("... to physical outputs"));
+ output_conn_vbox = new Gtk::VBox(false, 0);
+ output_vbox = new Gtk::VBox(false, 0);
+
+ output_frame = new Gtk::Frame();
+ advanced_vbox = new Gtk::VBox(false, 0);
+ advanced_label = new Gtk::Label(_("Advanced options"));
+ advanced_expander = new Gtk::Expander();
+ new_session_table = new Gtk::Table(2, 2, false);
+ m_open_filechooser = new Gtk::FileChooserButton();
+ open_session_hbox = new Gtk::HBox(false, 0);
+ m_treeview = new Gtk::TreeView();
+ recent_scrolledwindow = new Gtk::ScrolledWindow();
+
+ recent_sesion_label = new Gtk::Label(_("Recent:"));
+ recent_frame = new Gtk::Frame();
+ open_session_vbox = new Gtk::VBox(false, 0);
+ m_notebook = new Gtk::Notebook();
+ session_name_label->set_alignment(0, 0.5);
+ session_name_label->set_padding(6,0);
+ session_name_label->set_line_wrap(false);
+ session_name_label->set_selectable(false);
+ m_name->set_editable(true);
+ m_name->set_max_length(0);
+ m_name->set_has_frame(true);
+ m_name->set_activates_default(true);
+ m_name->set_width_chars (40);
+ session_location_label->set_alignment(0,0.5);
+ session_location_label->set_padding(6,0);
+ session_location_label->set_line_wrap(false);
+ session_location_label->set_selectable(false);
+ session_template_label->set_alignment(0,0.5);
+ session_template_label->set_padding(6,0);
+ session_template_label->set_line_wrap(false);
+ session_template_label->set_selectable(false);
+ m_create_control_bus->set_flags(Gtk::CAN_FOCUS);
+ m_create_control_bus->set_relief(Gtk::RELIEF_NORMAL);
+ m_create_control_bus->set_mode(true);
+ m_create_control_bus->set_active(false);
+ m_create_control_bus->set_border_width(0);
+ m_control_bus_channel_count->set_flags(Gtk::CAN_FOCUS);
+ m_control_bus_channel_count->set_update_policy(Gtk::UPDATE_ALWAYS);
+ m_control_bus_channel_count->set_numeric(true);
+ m_control_bus_channel_count->set_digits(0);
+ m_control_bus_channel_count->set_wrap(false);
+ m_control_bus_channel_count->set_sensitive(false);
+ m_master_bus_channel_count->set_flags(Gtk::CAN_FOCUS);
+ m_master_bus_channel_count->set_update_policy(Gtk::UPDATE_ALWAYS);
+ m_master_bus_channel_count->set_numeric(true);
+ m_master_bus_channel_count->set_digits(0);
+ m_master_bus_channel_count->set_wrap(false);
+ open_session_file_label = new Gtk::Label(_("Browse:"));
+ open_session_file_label->set_alignment(0, 0.5);
+ m_create_master_bus->set_flags(Gtk::CAN_FOCUS);
+ m_create_master_bus->set_relief(Gtk::RELIEF_NORMAL);
+ m_create_master_bus->set_mode(true);
+ m_create_master_bus->set_active(true);
+ m_create_master_bus->set_border_width(0);
+ advanced_table->set_row_spacings(0);
+ advanced_table->set_col_spacings(0);
+
+ m_connect_inputs->set_flags(Gtk::CAN_FOCUS);
+ m_connect_inputs->set_relief(Gtk::RELIEF_NORMAL);
+ m_connect_inputs->set_mode(true);
+ m_connect_inputs->set_active(true);
+ m_connect_inputs->set_border_width(0);
+
+ m_limit_input_ports->set_flags(Gtk::CAN_FOCUS);
+ m_limit_input_ports->set_relief(Gtk::RELIEF_NORMAL);
+ m_limit_input_ports->set_mode(true);
+ m_limit_input_ports->set_sensitive(true);
+ m_limit_input_ports->set_border_width(0);
+ m_input_limit_count->set_flags(Gtk::CAN_FOCUS);
+ m_input_limit_count->set_update_policy(Gtk::UPDATE_ALWAYS);
+ m_input_limit_count->set_numeric(true);
+ m_input_limit_count->set_digits(0);
+ m_input_limit_count->set_wrap(false);
+ m_input_limit_count->set_sensitive(false);
+
+ bus_hbox = new Gtk::HBox (false, 0);
+ bus_hbox->pack_start (*bus_table, Gtk::PACK_SHRINK, 18);
+
+ bus_label->set_alignment(0, 0.5);
+ bus_label->set_padding(0,0);
+ bus_label->set_line_wrap(false);
+ bus_label->set_selectable(false);
+ bus_label->set_use_markup(true);
+ bus_frame->set_shadow_type(Gtk::SHADOW_NONE);
+ bus_frame->set_label_align(0,0.5);
+ bus_frame->add(*bus_hbox);
+ bus_frame->set_label_widget(*bus_label);
+
+ bus_table->set_row_spacings (0);
+ bus_table->set_col_spacings (0);
+ bus_table->attach (*m_create_master_bus, 0, 1, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
+ bus_table->attach (*m_master_bus_channel_count, 1, 2, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
+ bus_table->attach (*chan_count_label_1, 2, 3, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 6, 0);
+ bus_table->attach (*m_create_control_bus, 0, 1, 1, 2, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
+ bus_table->attach (*m_control_bus_channel_count, 1, 2, 1, 2, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
+ bus_table->attach (*chan_count_label_2, 2, 3, 1, 2, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 6, 0);
+
+ input_port_limit_hbox->pack_start(*m_limit_input_ports, Gtk::PACK_SHRINK, 6);
+ input_port_limit_hbox->pack_start(*m_input_limit_count, Gtk::PACK_SHRINK, 0);
+ input_port_limit_hbox->pack_start(*chan_count_label_3, Gtk::PACK_SHRINK, 6);
+ input_port_vbox->pack_start(*m_connect_inputs, Gtk::PACK_SHRINK, 0);
+ input_port_vbox->pack_start(*input_port_limit_hbox, Gtk::PACK_EXPAND_PADDING, 0);
+ input_table->set_row_spacings(0);
+ input_table->set_col_spacings(0);
+ input_table->attach(*input_port_vbox, 0, 1, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 6, 6);
+
+ input_hbox = new Gtk::HBox (false, 0);
+ input_hbox->pack_start (*input_table, Gtk::PACK_SHRINK, 18);
+
+ input_label->set_alignment(0, 0.5);
+ input_label->set_padding(0,0);
+ input_label->set_line_wrap(false);
+ input_label->set_selectable(false);
+ input_label->set_use_markup(true);
+ input_frame->set_shadow_type(Gtk::SHADOW_NONE);
+ input_frame->set_label_align(0,0.5);
+ input_frame->add(*input_hbox);
+ input_frame->set_label_widget(*input_label);
+
+ m_connect_outputs->set_flags(Gtk::CAN_FOCUS);
+ m_connect_outputs->set_relief(Gtk::RELIEF_NORMAL);
+ m_connect_outputs->set_mode(true);
+ m_connect_outputs->set_active(true);
+ m_connect_outputs->set_border_width(0);
+ m_limit_output_ports->set_flags(Gtk::CAN_FOCUS);
+ m_limit_output_ports->set_relief(Gtk::RELIEF_NORMAL);
+ m_limit_output_ports->set_mode(true);
+ m_limit_output_ports->set_sensitive(true);
+ m_limit_output_ports->set_border_width(0);
+ m_output_limit_count->set_flags(Gtk::CAN_FOCUS);
+ m_output_limit_count->set_update_policy(Gtk::UPDATE_ALWAYS);
+ m_output_limit_count->set_numeric(false);
+ m_output_limit_count->set_digits(0);
+ m_output_limit_count->set_wrap(false);
+ m_output_limit_count->set_sensitive(false);
+ output_port_limit_hbox->pack_start(*m_limit_output_ports, Gtk::PACK_SHRINK, 6);
+ output_port_limit_hbox->pack_start(*m_output_limit_count, Gtk::PACK_SHRINK, 0);
+ output_port_limit_hbox->pack_start(*chan_count_label_4, Gtk::PACK_SHRINK, 6);
+ m_connect_outputs_to_master->set_flags(Gtk::CAN_FOCUS);
+ m_connect_outputs_to_master->set_relief(Gtk::RELIEF_NORMAL);
+ m_connect_outputs_to_master->set_mode(true);
+ m_connect_outputs_to_master->set_active(false);
+ m_connect_outputs_to_master->set_border_width(0);
+ m_connect_outputs_to_physical->set_flags(Gtk::CAN_FOCUS);
+ m_connect_outputs_to_physical->set_relief(Gtk::RELIEF_NORMAL);
+ m_connect_outputs_to_physical->set_mode(true);
+ m_connect_outputs_to_physical->set_active(false);
+ m_connect_outputs_to_physical->set_border_width(0);
+ output_conn_vbox->pack_start(*m_connect_outputs, Gtk::PACK_SHRINK, 0);
+ output_conn_vbox->pack_start(*m_connect_outputs_to_master, Gtk::PACK_SHRINK, 0);
+ output_conn_vbox->pack_start(*m_connect_outputs_to_physical, Gtk::PACK_SHRINK, 0);
+ output_vbox->set_border_width(6);
+
+ output_port_vbox->pack_start(*output_port_limit_hbox, Gtk::PACK_SHRINK, 0);
+
+ output_vbox->pack_start(*output_conn_vbox);
+ output_vbox->pack_start(*output_port_vbox);
+
+ output_label->set_alignment(0, 0.5);
+ output_label->set_padding(0,0);
+ output_label->set_line_wrap(false);
+ output_label->set_selectable(false);
+ output_label->set_use_markup(true);
+ output_frame->set_shadow_type(Gtk::SHADOW_NONE);
+ output_frame->set_label_align(0,0.5);
+
+ output_hbox = new Gtk::HBox (false, 0);
+ output_hbox->pack_start (*output_vbox, Gtk::PACK_SHRINK, 18);
+
+ output_frame->add(*output_hbox);
+ output_frame->set_label_widget(*output_label);
+
+ advanced_vbox->pack_start(*advanced_table, Gtk::PACK_SHRINK, 0);
+ advanced_vbox->pack_start(*bus_frame, Gtk::PACK_SHRINK, 6);
+ advanced_vbox->pack_start(*input_frame, Gtk::PACK_SHRINK, 6);
+ advanced_vbox->pack_start(*output_frame, Gtk::PACK_SHRINK, 0);
+ advanced_label->set_padding(0,0);
+ advanced_label->set_line_wrap(false);
+ advanced_label->set_selectable(false);
+ advanced_label->set_alignment(0, 0.5);
+ advanced_expander->set_flags(Gtk::CAN_FOCUS);
+ advanced_expander->set_border_width(0);
+ advanced_expander->set_expanded(false);
+ advanced_expander->set_spacing(0);
+ advanced_expander->add(*advanced_vbox);
+ advanced_expander->set_label_widget(*advanced_label);
+ new_session_table->set_border_width(12);
+ new_session_table->set_row_spacings(6);
+ new_session_table->set_col_spacings(0);
+ new_session_table->attach(*session_name_label, 0, 1, 0, 1, Gtk::FILL, Gtk::FILL, 0, 0);
+ new_session_table->attach(*m_name, 1, 2, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::FILL, 0, 0);
+ new_session_table->attach(*session_location_label, 0, 1, 1, 2, Gtk::FILL, Gtk::FILL, 0, 0);
+ new_session_table->attach(*m_folder, 1, 2, 1, 2, Gtk::EXPAND|Gtk::FILL, Gtk::FILL, 0, 0);
+ new_session_table->attach(*session_template_label, 0, 1, 2, 3, Gtk::FILL, Gtk::FILL, 0, 0);
+ new_session_table->attach(*m_template, 1, 2, 2, 3, Gtk::EXPAND|Gtk::FILL, Gtk::FILL, 0, 0);
+
+ if (!ARDOUR::Profile->get_sae()) {
+ new_session_table->attach(*advanced_expander, 0, 2, 3, 4, Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 6);
+ }
+
+ open_session_hbox->pack_start(*open_session_file_label, false, false, 12);
+ open_session_hbox->pack_start(*m_open_filechooser, true, true, 12);
+ m_treeview->set_flags(Gtk::CAN_FOCUS);
+ m_treeview->set_headers_visible(true);
+ m_treeview->set_rules_hint(false);
+ m_treeview->set_reorderable(false);
+ m_treeview->set_enable_search(true);
+ m_treeview->set_fixed_height_mode(false);
+ m_treeview->set_hover_selection(false);
+ m_treeview->set_size_request(-1, 150);
+ recent_scrolledwindow->set_flags(Gtk::CAN_FOCUS);
+ recent_scrolledwindow->set_border_width(6);
+ recent_scrolledwindow->set_shadow_type(Gtk::SHADOW_IN);
+ recent_scrolledwindow->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
+ recent_scrolledwindow->property_window_placement().set_value(Gtk::CORNER_TOP_LEFT);
+ recent_scrolledwindow->add(*m_treeview);
+
+ recent_sesion_label->set_padding(0,0);
+ recent_sesion_label->set_line_wrap(false);
+ recent_sesion_label->set_selectable(false);
+ recent_frame->set_border_width(12);
+ recent_frame->set_shadow_type(Gtk::SHADOW_NONE);
+ recent_frame->add(*recent_scrolledwindow);
+ recent_frame->set_label_widget(*recent_sesion_label);
+ open_session_vbox->pack_start(*recent_frame, Gtk::PACK_EXPAND_WIDGET, 0);
+ open_session_vbox->pack_start(*open_session_hbox, Gtk::PACK_SHRINK, 12);
+ m_notebook->set_flags(Gtk::CAN_FOCUS);
+ m_notebook->set_scrollable(true);
+ get_vbox()->set_homogeneous(false);
+ get_vbox()->set_spacing(0);
+ get_vbox()->pack_start(*m_notebook, Gtk::PACK_SHRINK, 0);
+
+ /*
+ icon setting is done again in the editor (for the whole app),
+ but its all chickens and eggs at this point.
+ */
+
+ list<Glib::RefPtr<Gdk::Pixbuf> > window_icons;
+ Glib::RefPtr<Gdk::Pixbuf> icon;
+
+ if ((icon = ::get_icon ("ardour_icon_16px")) != 0) {
+ window_icons.push_back (icon);
+ }
+ if ((icon = ::get_icon ("ardour_icon_22px")) != 0) {
+ window_icons.push_back (icon);
+ }
+ if ((icon = ::get_icon ("ardour_icon_32px")) != 0) {
+ window_icons.push_back (icon);
+ }
+ if ((icon = ::get_icon ("ardour_icon_48px")) != 0) {
+ window_icons.push_back (icon);
+ }
+ if (!window_icons.empty()) {
+ set_icon_list (window_icons);
+ }
+
+ WindowTitle title(Glib::get_application_name());
+ title += _("Session Control");
+ set_title(title.get_string());
+
+ set_position (Gtk::WIN_POS_MOUSE);
+ set_resizable(false);
+ set_has_separator(false);
+ quit_or_cancel_button = add_button(Gtk::Stock::QUIT, Gtk::RESPONSE_CANCEL);
+ add_button(Gtk::Stock::CLEAR, Gtk::RESPONSE_NONE);
+ m_okbutton = add_button(Gtk::Stock::NEW, Gtk::RESPONSE_OK);
+
+ recent_model = Gtk::TreeStore::create (recent_columns);
+ m_treeview->set_model (recent_model);
+ m_treeview->append_column (_("Recent sessions"), recent_columns.visible_name);
+ m_treeview->set_headers_visible (false);
+ m_treeview->get_selection()->set_mode (Gtk::SELECTION_SINGLE);