+PluginSelector*
+Mixer_UI::plugin_selector()
+{
+#ifdef DEFER_PLUGIN_SELECTOR_LOAD
+ if (!_plugin_selector)
+ _plugin_selector = new PluginSelector (PluginManager::instance());
+#endif
+
+ return _plugin_selector;
+}
+
+void
+Mixer_UI::setup_track_display ()
+{
+ track_model = ListStore::create (track_columns);
+ track_display.set_model (track_model);
+ track_display.append_column (_("Strips"), track_columns.text);
+ track_display.append_column (_("Show"), track_columns.visible);
+ track_display.get_column (0)->set_data (X_("colnum"), GUINT_TO_POINTER(0));
+ track_display.get_column (1)->set_data (X_("colnum"), GUINT_TO_POINTER(1));
+ track_display.get_column (0)->set_expand(true);
+ track_display.get_column (1)->set_expand(false);
+ track_display.set_name (X_("MixerTrackDisplayList"));
+ track_display.get_selection()->set_mode (Gtk::SELECTION_NONE);
+ track_display.set_reorderable (true);
+ track_display.set_headers_visible (true);
+
+ track_model->signal_row_deleted().connect (sigc::mem_fun (*this, &Mixer_UI::track_list_delete));
+ track_model->signal_row_changed().connect (sigc::mem_fun (*this, &Mixer_UI::track_list_change));
+ track_model->signal_rows_reordered().connect (sigc::mem_fun (*this, &Mixer_UI::track_list_reorder));
+
+ CellRendererToggle* track_list_visible_cell = dynamic_cast<CellRendererToggle*>(track_display.get_column_cell_renderer (1));
+ track_list_visible_cell->property_activatable() = true;
+ track_list_visible_cell->property_radio() = false;
+
+ track_display.signal_button_press_event().connect (sigc::mem_fun (*this, &Mixer_UI::track_display_button_press), false);
+
+ track_display_scroller.add (track_display);
+ track_display_scroller.set_policy (Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC);
+
+ VBox* v = manage (new VBox);
+ v->show ();
+ v->pack_start (track_display_scroller, true, true);
+
+ Button* b = manage (new Button);
+ b->show ();
+ Widget* w = manage (new Image (Stock::ADD, ICON_SIZE_BUTTON));
+ w->show ();
+ b->add (*w);
+
+ b->signal_clicked().connect (sigc::mem_fun (*this, &Mixer_UI::new_track_or_bus));
+
+ v->pack_start (*b, false, false);
+
+ track_display_frame.set_name("BaseFrame");
+ track_display_frame.set_shadow_type (Gtk::SHADOW_IN);
+ track_display_frame.add (*v);
+
+ track_display_scroller.show();
+ track_display_frame.show();
+ track_display.show();
+}
+
+void
+Mixer_UI::new_track_or_bus ()
+{
+ ARDOUR_UI::instance()->add_route (this);
+}
+
+
+void
+Mixer_UI::update_title ()
+{
+ if (_session) {
+ string n;
+
+ if (_session->snap_name() != _session->name()) {
+ n = _session->snap_name ();
+ } else {
+ n = _session->name ();
+ }
+
+ if (_session->dirty ()) {
+ n = "*" + n;
+ }
+
+ WindowTitle title (n);
+ title += S_("Window|Mixer");
+ title += Glib::get_application_name ();
+ set_title (title.get_string());
+
+ } else {
+
+ WindowTitle title (S_("Window|Mixer"));
+ title += Glib::get_application_name ();
+ set_title (title.get_string());
+ }
+}
+
+MixerStrip*
+Mixer_UI::strip_by_x (int x)
+{
+ for (list<MixerStrip*>::iterator i = strips.begin(); i != strips.end(); ++i) {
+ int x1, x2, y;
+
+ (*i)->translate_coordinates (*this, 0, 0, x1, y);
+ x2 = x1 + (*i)->get_width();
+
+ if (x >= x1 && x <= x2) {
+ return (*i);
+ }
+ }
+
+ return 0;
+}
+
+void
+Mixer_UI::set_route_targets_for_operation ()
+{
+ _route_targets.clear ();
+
+ if (!_selection.empty()) {
+ _route_targets = _selection.routes;
+ return;
+ }
+
+ /* try to get mixer strip at mouse */
+
+ int x, y;
+ get_pointer (x, y);
+
+ MixerStrip* ms = strip_by_x (x);
+
+ if (ms) {
+ _route_targets.insert (ms);
+ }
+}
+
+void
+Mixer_UI::monitor_section_going_away ()
+{
+ if (_monitor_section) {
+ out_packer.remove (_monitor_section->tearoff());
+ _monitor_section->set_session (0);
+ }
+}