+ s->config.ParameterChanged.connect (*this, invalidator (*this), boost::bind (&VCAMasterStrip::parameter_changed, this, _1), gui_context());
+ Config->ParameterChanged.connect (*this, invalidator (*this), boost::bind (&VCAMasterStrip::parameter_changed, this, _1), gui_context());
+ UIConfiguration::instance().ParameterChanged.connect (sigc::mem_fun (*this, &VCAMasterStrip::parameter_changed));
+}
+
+VCAMasterStrip::~VCAMasterStrip ()
+{
+ if ((_session && !_session->deletion_in_progress()) && Mixer_UI::instance()->showing_spill_for (_vca)) {
+ /* cancel spill for this VCA */
+ Mixer_UI::instance()->show_spill (boost::shared_ptr<Stripable>());
+ }
+
+ delete delete_dialog;
+ delete context_menu;
+
+ CatchDeletion (this); /* EMIT SIGNAL */
+}
+
+void
+VCAMasterStrip::self_delete ()
+{
+ if ((_session && !_session->deletion_in_progress()) && Mixer_UI::instance()->showing_spill_for (_vca)) {
+ /* cancel spill for this VCA */
+ Mixer_UI::instance()->show_spill (boost::shared_ptr<Stripable>());
+ }
+ /* Drop reference immediately, delete self when idle */
+ _vca.reset ();
+ gain_meter.set_controls (boost::shared_ptr<Route>(),
+ boost::shared_ptr<PeakMeter>(),
+ boost::shared_ptr<Amp>(),
+ boost::shared_ptr<GainControl>());
+ delete_when_idle (this);
+}
+
+void
+VCAMasterStrip::parameter_changed (std::string const & p)
+{
+ if (p == "use-monitor-bus" || p == "solo-control-is-listen-control" || p == "listen-position") {
+ set_button_names ();
+ } else if (p == "mixer-element-visibility") {
+ update_bottom_padding ();
+ }
+}
+
+void
+VCAMasterStrip::set_button_names ()
+{
+ if (Config->get_solo_control_is_listen_control()) {
+ switch (Config->get_listen_position()) {
+ case AfterFaderListen:
+ solo_button.set_text (S_("AfterFader|A"));
+ set_tooltip (solo_button, _("After-fade listen (AFL)"));
+ break;
+ case PreFaderListen:
+ solo_button.set_text (S_("PreFader|P"));
+ set_tooltip (solo_button, _("Pre-fade listen (PFL)"));
+ break;
+ }
+ } else {
+ solo_button.set_text (S_("Solo|S"));
+ set_tooltip (solo_button, _("Solo"));
+ }
+}
+
+void
+VCAMasterStrip::update_bottom_padding ()
+{
+ std::string viz = UIConfiguration::instance().get_mixer_strip_visibility ();
+
+ ArdourButton output_button (_("Output"));
+ ArdourButton comment_button (_("Comments"));
+
+ output_button.set_name ("mixer strip button");
+ comment_button.set_name ("generic button");
+
+ if (viz.find ("VCA") == std::string::npos) {
+ control_slave_ui.hide ();
+ } else {
+ control_slave_ui.show ();
+ }
+
+ int h = 0;
+ if (viz.find ("Output") != std::string::npos) {
+ Gtk::Window window (WINDOW_TOPLEVEL);
+ window.add (output_button);
+ Gtk::Requisition requisition(output_button.size_request ());
+ h += requisition.height + 2;
+ }
+ if (viz.find ("Comments") != std::string::npos) {
+ Gtk::Window window (WINDOW_TOPLEVEL);
+ window.add (comment_button);
+ Gtk::Requisition requisition(comment_button.size_request ());
+ h += requisition.height + 2;
+ }
+ if (h <= 0) {
+ bottom_padding.set_size_request (-1, 1);
+ bottom_padding.hide ();
+ } else {
+ bottom_padding.set_size_request (-1, h);
+ bottom_padding.show ();
+ }