+ gain_display = new ArdourDisplay ();
+ gain_display->set_size_request (PX_SCALE(68), PX_SCALE(20));
+ gain_display->add_controllable_preset(_("0 dB"), 0.0);
+ gain_display->add_controllable_preset(_("-3 dB"), -3.0);
+ gain_display->add_controllable_preset(_("-6 dB"), -6.0);
+ gain_display->add_controllable_preset(_("-12 dB"), -12.0);
+ gain_display->add_controllable_preset(_("-20 dB"), -20.0);
+ gain_display->add_controllable_preset(_("-30 dB"), -30.0);
+
+ Label* output_label = manage (new Label (_("Output")));
+ output_label->set_name (X_("MonitorSectionLabel"));
+
+ output_button = new ArdourButton ();
+ output_button->set_text (_("Output"));
+ output_button->set_name (X_("monitor section cut")); // XXX
+ output_button->set_text_ellipsize (Pango::ELLIPSIZE_MIDDLE);
+ output_button->set_layout_ellipsize_width (PX_SCALE(128) * PANGO_SCALE);
+
+ channel_table_scroller.set_policy (Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC);
+ channel_table_scroller.set_size_request (-1, PX_SCALE(150));
+ channel_table_scroller.set_shadow_type (Gtk::SHADOW_NONE);
+ channel_table_scroller.show ();
+ channel_table_scroller.add (channel_table_viewport);
+
+ channel_size_group = SizeGroup::create (SIZE_GROUP_HORIZONTAL);
+ channel_size_group->add_widget (channel_table_header);
+ channel_size_group->add_widget (channel_table);
+
+ channel_table_header.resize (1, 5);
+
+ Label* l1 = manage (new Label (X_(" ")));
+ l1->set_name (X_("MonitorSectionLabel"));
+ channel_table_header.attach (*l1, 0, 1, 0, 1, EXPAND|FILL);
+
+ l1 = manage (new Label (_("Mute")));
+ l1->set_name (X_("MonitorSectionLabel"));
+ channel_table_header.attach (*l1, 1, 2, 0, 1, EXPAND|FILL);
+
+ l1 = manage (new Label (_("Dim")));
+ l1->set_name (X_("MonitorSectionLabel"));
+ channel_table_header.attach (*l1, 2, 3, 0, 1, EXPAND|FILL);
+
+ l1 = manage (new Label (_("Solo")));
+ l1->set_name (X_("MonitorSectionLabel"));
+ channel_table_header.attach (*l1, 3, 4, 0, 1, EXPAND|FILL);
+
+ l1 = manage (new Label (_("Inv")));
+ l1->set_name (X_("MonitorSectionLabel"));
+ channel_table_header.attach (*l1, 4, 5, 0, 1, EXPAND|FILL);
+
+ channel_table_header.show ();
+
+
+ /****************************************************************************
+ * LAYOUT top to bottom
+ */
+
+ // solo, iso information
+ HBox* rude_box = manage (new HBox);
+ rude_box->set_spacing (PX_SCALE(4));
+ rude_box->set_homogeneous (true);
+ rude_box->pack_start (rude_solo_button, true, true);
+ rude_box->pack_start (rude_iso_button, true, true);
+
+ // solo options (right align)
+ HBox* tbx1 = manage (new HBox);
+ tbx1->pack_end (exclusive_solo_button, false, false);
+
+ HBox* tbx2 = manage (new HBox);
+ tbx2->pack_end (solo_mute_override_button, false, false);
+
+ HBox* tbx3 = manage (new HBox);
+ tbx3->pack_end (toggle_processorbox_button, false, false);
+
+ HBox* tbx0 = manage (new HBox); // space
+
+ // combined solo mode (Sip, AFL, PFL) & solo options
+ Table *solo_tbl = manage (new Table);
+ solo_tbl->attach (solo_in_place_button, 0, 1, 0, 1, EXPAND|FILL, SHRINK, 0, 2);
+ solo_tbl->attach (pfl_button, 0, 1, 1, 2, EXPAND|FILL, SHRINK, 0, 2);
+ solo_tbl->attach (afl_button, 0, 1, 2, 3, EXPAND|FILL, SHRINK, 0, 2);
+ solo_tbl->attach (*tbx0, 1, 2, 0, 3, EXPAND|FILL, SHRINK, 2, 2);
+ solo_tbl->attach (*tbx1, 2, 3, 0, 1, EXPAND|FILL, SHRINK, 0, 2);
+ solo_tbl->attach (*tbx2, 2, 3, 1, 2, EXPAND|FILL, SHRINK, 0, 2);
+ solo_tbl->attach (*tbx3, 2, 3, 2, 3, EXPAND|FILL, SHRINK, 0, 2);
+
+ // boost, cut, dim volume control
+ Table *level_tbl = manage (new Table);
+ level_tbl->attach (*solo_boost_label, 0, 2, 0, 1, EXPAND|FILL, SHRINK, 1, 2);
+ level_tbl->attach (*solo_boost_control, 0, 2, 1, 2, EXPAND|FILL, SHRINK, 1, 2);
+ level_tbl->attach (*solo_boost_display, 0, 2, 2, 3, EXPAND , SHRINK, 1, 2);
+
+ level_tbl->attach (*solo_cut_label, 2, 4, 0, 1, EXPAND|FILL, SHRINK, 1, 2);
+ level_tbl->attach (*solo_cut_control, 2, 4, 1, 2, EXPAND|FILL, SHRINK, 1, 2);
+ level_tbl->attach (*solo_cut_display, 2, 4, 2, 3, EXPAND , SHRINK, 1, 2);
+
+ level_tbl->attach (*dim_label, 1, 3, 3, 4, EXPAND|FILL, SHRINK, 1, 2);
+ level_tbl->attach (*dim_control, 1, 3, 4, 5, EXPAND|FILL, SHRINK, 1, 2);
+ level_tbl->attach (*dim_display, 1, 3, 5, 6, EXPAND , SHRINK, 1, 2);
+
+ /* note that we don't pack the table_hpacker till later
+ * -> top level channel_table_packer */
+ table_hpacker.pack_start (channel_table, true, true);
+
+ // mono, dim
+ HBox* mono_dim_box = manage (new HBox);
+ mono_dim_box->set_spacing (PX_SCALE(4));
+ mono_dim_box->set_homogeneous (true);
+ mono_dim_box->pack_start (mono_button, true, true);
+ mono_dim_box->pack_end (dim_all_button, true, true);
+
+ // master gain
+ Label* spin_label = manage (new Label (_("Monitor")));
+ VBox* spin_packer = manage (new VBox);
+ spin_packer->set_spacing (PX_SCALE(2));
+ spin_packer->pack_start (*spin_label, false, false);
+ spin_packer->pack_start (*gain_control, false, false);
+ spin_packer->pack_start (*gain_display, false, false);
+
+ master_packer.pack_start (*spin_packer, true, false);
+
+ // combined gain section (channels, mute, dim)
+ VBox* lower_packer = manage (new VBox);
+ lower_packer->pack_start (channel_table_header, false, false, PX_SCALE(0));
+ lower_packer->pack_start (channel_table_packer, false, false, PX_SCALE(8));
+ lower_packer->pack_start (*mono_dim_box, false, false, PX_SCALE(2));
+ lower_packer->pack_start (cut_all_button, false, false, PX_SCALE(2));
+
+ // output port select
+ VBox* out_packer = manage (new VBox);
+ out_packer->set_spacing (PX_SCALE(2));
+ out_packer->pack_start (*output_label, false, false);
+ out_packer->pack_start (*output_button, false, false);
+
+ /****************************************************************************
+ * TOP LEVEL LAYOUT
+ */
+ vpacker.set_border_width (PX_SCALE(3));
+ vpacker.pack_start (*rude_box, false, false, PX_SCALE(3));
+ vpacker.pack_start (rude_audition_button, false, false, 0);
+ vpacker.pack_start (*solo_tbl, false, false, PX_SCALE(8));
+ vpacker.pack_start (*insert_box, true, true, PX_SCALE(8));
+ vpacker.pack_start (*level_tbl, false, false, PX_SCALE(8));
+ vpacker.pack_start (*lower_packer, false, false, PX_SCALE(8));
+ vpacker.pack_start (master_packer, false, false, PX_SCALE(10));
+ vpacker.pack_end (*out_packer, false, false, PX_SCALE(3));
+
+ hpacker.set_spacing (0);
+ hpacker.pack_start (vpacker, true, true);
+
+ add (hpacker);
+
+ gain_control->show_all ();
+ gain_display->show_all ();
+ dim_control->show_all ();
+ dim_display->show_all();
+ solo_boost_control->show_all ();
+ solo_boost_display->show_all();
+
+ mono_dim_box->show ();
+ spin_packer->show ();
+ master_packer.show ();
+ channel_table.show ();
+
+ rude_box->show();
+ solo_tbl->show_all();
+ level_tbl->show();
+ lower_packer->show ();
+ out_packer->show ();
+
+ vpacker.show ();
+ hpacker.show ();
+
+ populate_buttons ();
+ map_state ();
+ assign_controllables ();
+
+ output_button->signal_button_press_event().connect (sigc::mem_fun(*this, &MonitorSection::output_press), false);
+ output_button->signal_button_release_event().connect (sigc::mem_fun(*this, &MonitorSection::output_release), false);
+
+ signal_enter_notify_event().connect (sigc::mem_fun (*this, &MonitorSection::enter_handler));
+ signal_leave_notify_event().connect (sigc::mem_fun (*this, &MonitorSection::leave_handler));
+ set_flags (CAN_FOCUS);
+
+ _tearoff = new TearOff (*this);
+
+ if (!UIConfiguration::instance().get_floating_monitor_section()) {
+ /* if torn off, make this a normal window
+ * (default is WINDOW_TYPE_HINT_UTILITY in libs/gtkmm2ext/tearoff.cc)
+ */
+ _tearoff->tearoff_window().set_type_hint (Gdk::WINDOW_TYPE_HINT_NORMAL);
+ }
+ _tearoff->tearoff_window().set_title (X_("Monitor"));
+ _tearoff->tearoff_window().signal_key_press_event().connect (sigc::bind (sigc::ptr_fun (relay_key_press), (Gtk::Window*) &_tearoff->tearoff_window()), false);
+
+ update_output_display ();
+ update_processor_box ();
+ _ui_initialized = true;
+
+ /* catch changes that affect us */
+ AudioEngine::instance()->PortConnectedOrDisconnected.connect (
+ *this, invalidator (*this), boost::bind (&MonitorSection::port_connected_or_disconnected, this, _1, _3), gui_context ()
+ );
+ Config->ParameterChanged.connect (config_connection, invalidator (*this), boost::bind (&MonitorSection::parameter_changed, this, _1), gui_context());
+}