+ using namespace Notebook_Helpers;
+ vector<string> strings;
+ Label* label;
+ AttachOptions xopt = AttachOptions (FILL|EXPAND);
+ int row;
+
+ set_name (X_("AudioMIDISetup"));
+
+ /* the backend combo is the one thing that is ALWAYS visible
+ */
+
+ vector<const ARDOUR::AudioBackendInfo*> backends = ARDOUR::AudioEngine::instance()->available_backends();
+ 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 (true);
+
+ /* pack it in */
+
+ basic_hbox.pack_start (basic_packer, false, false);
+
+ /* latency tab */
+
+ /* 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.attach (lm_title, 0, 2, row, row+1, xopt, (AttachOptions) 0);
+ row++;
+
+ Gtk::Label* preamble;
+
+ preamble = manage (new Label);
+ preamble->set_width_chars (60);
+ preamble->set_line_wrap (true);
+ preamble->set_markup (_("<span weight=\"bold\">Turn down the volume on your hardware to a very low level.</span>"));
+
+ lm_table.attach (*preamble, 0, 2, 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 (_("Select two channels below and connect them using a cable or (less ideally) a speaker and microphone."));
+
+ lm_table.attach (*preamble, 0, 2, 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, 2, 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, 2, row, row+1, FILL, (AttachOptions) 0);
+ ++row;
+
+ xopt = AttachOptions(0);
+
+ lm_measure_button.add (lm_start_stop_label);
+
+ lm_measure_button.signal_toggled().connect (sigc::mem_fun (*this, &EngineControl::latency_button_toggled));
+ lm_use_button.signal_clicked().connect (sigc::mem_fun (*this, &EngineControl::use_latency_button_clicked));
+ lm_use_button.set_sensitive (false);
+
+ 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 latency\" button."));
+ lm_table.attach (*preamble, 0, 2, row, row+1, AttachOptions(FILL|EXPAND), (AttachOptions) 0);
+ row++;
+
+ lm_table.attach (lm_measure_button, 0, 2, row, row+1, xopt, (AttachOptions) 0);
+ ++row;
+ lm_table.attach (lm_results, 0, 2, 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, 2, row, row+1, AttachOptions(FILL|EXPAND), (AttachOptions) 0);
+ row++;
+
+ lm_table.attach (lm_use_button, 0, 2, row, row+1, xopt, (AttachOptions) 0);
+ ++row;
+
+ lm_results.set_markup ("<i>No measurement results yet</i>");
+
+ lm_vbox.set_border_width (12);
+ lm_vbox.pack_start (lm_table, false, false);
+
+ /* pack it all up */
+
+ notebook.pages().push_back (TabElem (basic_vbox, _("Audio")));
+ notebook.pages().push_back (TabElem (midi_vbox, _("MIDI")));
+ notebook.pages().push_back (TabElem (lm_vbox, _("Latency")));
+ notebook.set_border_width (12);
+
+ notebook.set_tab_pos (POS_RIGHT);
+ notebook.show_all ();
+
+ notebook.set_name ("SettingsNotebook");
+
+ /* packup the notebook */