+ /* the backend combo is the one thing that is ALWAYS visible */
+
+ vector<const ARDOUR::AudioBackendInfo*> backends = ARDOUR::AudioEngine::instance()->available_backends();
+
+ if (backends.empty()) {
+ MessageDialog msg (string_compose (_("No audio/MIDI backends detected. %1 cannot run\n\n(This is a build/packaging/system error. It should never happen.)"), PROGRAM_NAME));
+ msg.run ();
+ throw failed_constructor ();
+ }
+
+ for (vector<const ARDOUR::AudioBackendInfo*>::const_iterator b = backends.begin(); b != backends.end(); ++b) {
+ strings.push_back ((*b)->name);
+ }
+
+ set_popdown_strings (backend_combo, strings);
+ backend_combo.set_active_text (strings.front());
+ backend_combo.signal_changed().connect (sigc::mem_fun (*this, &EngineControl::backend_changed));
+
+ /* setup basic packing characteristics for the table used on the main
+ * tab of the notebook
+ */
+
+ basic_packer.set_spacings (6);
+ basic_packer.set_border_width (12);
+ basic_packer.set_homogeneous (false);
+
+ /* pack it in */
+
+ basic_hbox.pack_start (basic_packer, false, false);
+
+ /* latency measurement tab */
+
+ lm_title.set_markup (string_compose ("<span size=\"large\" weight=\"bold\">%1</span>", _("Latency Measurement Tool")));
+
+ row = 0;
+ lm_table.set_row_spacings (12);
+ lm_table.set_col_spacings (6);
+ lm_table.set_homogeneous (false);
+
+ lm_table.attach (lm_title, 0, 3, row, row+1, xopt, (AttachOptions) 0);
+ row++;
+
+ lm_preamble.set_width_chars (60);
+ lm_preamble.set_line_wrap (true);
+ lm_preamble.set_markup (_("<span weight=\"bold\">Turn down the volume on your audio equipment to a very low level.</span>"));
+
+ lm_table.attach (lm_preamble, 0, 3, row, row+1, AttachOptions(FILL|EXPAND), (AttachOptions) 0);
+ row++;
+
+ Gtk::Label* preamble;
+ preamble = manage (new Label);
+ preamble->set_width_chars (60);
+ preamble->set_line_wrap (true);
+ preamble->set_markup (_("Select two channels below and connect them using a cable."));
+
+ lm_table.attach (*preamble, 0, 3, row, row+1, AttachOptions(FILL|EXPAND), (AttachOptions) 0);
+ row++;
+
+ label = manage (new Label (_("Output channel")));
+ lm_table.attach (*label, 0, 1, row, row+1, xopt, (AttachOptions) 0);
+
+ Gtk::Alignment* misc_align = manage (new Alignment (0.0, 0.5));
+ misc_align->add (lm_output_channel_combo);
+ lm_table.attach (*misc_align, 1, 3, row, row+1, xopt, (AttachOptions) 0);
+ ++row;
+
+ label = manage (new Label (_("Input channel")));
+ lm_table.attach (*label, 0, 1, row, row+1, xopt, (AttachOptions) 0);
+
+ misc_align = manage (new Alignment (0.0, 0.5));
+ misc_align->add (lm_input_channel_combo);
+ lm_table.attach (*misc_align, 1, 3, row, row+1, FILL, (AttachOptions) 0);
+ ++row;
+
+ xopt = AttachOptions(0);
+
+ lm_measure_label.set_padding (10, 10);
+ lm_measure_button.add (lm_measure_label);
+ lm_measure_button.signal_clicked().connect (sigc::mem_fun (*this, &EngineControl::latency_button_clicked));
+ lm_use_button.signal_clicked().connect (sigc::mem_fun (*this, &EngineControl::use_latency_button_clicked));
+ lm_back_button_signal = lm_back_button.signal_clicked().connect (sigc::bind (sigc::mem_fun (notebook, &Gtk::Notebook::set_current_page), 0));
+
+ lm_use_button.set_sensitive (false);
+
+ /* Increase the default spacing around the labels of these three
+ * buttons
+ */
+
+ Gtk::Misc* l;
+
+ if ((l = dynamic_cast<Gtk::Misc*>(lm_use_button.get_child())) != 0) {
+ l->set_padding (10, 10);
+ }
+
+ if ((l = dynamic_cast<Gtk::Misc*>(lm_back_button.get_child())) != 0) {
+ l->set_padding (10, 10);
+ }
+
+ preamble = manage (new Label);
+ preamble->set_width_chars (60);
+ preamble->set_line_wrap (true);
+ preamble->set_markup (_("Once the channels are connected, click the \"Measure\" button."));
+ lm_table.attach (*preamble, 0, 3, row, row+1, AttachOptions(FILL|EXPAND), (AttachOptions) 0);
+ row++;
+
+ preamble = manage (new Label);
+ preamble->set_width_chars (60);
+ preamble->set_line_wrap (true);
+ preamble->set_markup (_("When satisfied with the results, click the \"Use results\" button."));
+ lm_table.attach (*preamble, 0, 3, row, row+1, AttachOptions(FILL|EXPAND), (AttachOptions) 0);
+
+ ++row; // skip a row in the table
+ ++row; // skip a row in the table
+
+ lm_table.attach (lm_results, 0, 3, row, row+1, AttachOptions(FILL|EXPAND), (AttachOptions) 0);
+
+ ++row; // skip a row in the table
+ ++row; // skip a row in the table
+
+ lm_table.attach (lm_measure_button, 0, 1, row, row+1, AttachOptions(FILL|EXPAND), (AttachOptions) 0);
+ lm_table.attach (lm_use_button, 1, 2, row, row+1, AttachOptions(FILL|EXPAND), (AttachOptions) 0);
+ lm_table.attach (lm_back_button, 2, 3, row, row+1, AttachOptions(FILL|EXPAND), (AttachOptions) 0);
+
+ lm_results.set_markup (string_compose (results_markup, _("No measurement results yet")));
+
+ lm_vbox.set_border_width (12);
+ lm_vbox.pack_start (lm_table, false, false);
+
+ midi_back_button.signal_clicked().connect (sigc::bind (sigc::mem_fun (notebook, &Gtk::Notebook::set_current_page), 0));
+
+ /* pack it all up */
+
+ notebook.pages().push_back (TabElem (basic_vbox, _("Audio")));
+ notebook.pages().push_back (TabElem (lm_vbox, _("Latency")));
+ notebook.pages().push_back (TabElem (midi_vbox, _("MIDI")));
+ notebook.set_border_width (12);
+
+ notebook.set_show_tabs (false);
+ notebook.show_all ();
+
+ notebook.set_name ("SettingsNotebook");
+
+ /* packup the notebook */