son't try to select non-existent notes after editing (and thus crash).
[ardour.git] / gtk2_ardour / vca_master_strip.cc
index aa8b93a3e9c1ec8661fef65aa817a7465884c50e..8363f6d67d27b12aba3c03fec01d69d165673fa9 100644 (file)
@@ -38,7 +38,7 @@
 #include "utils.h"
 #include "vca_master_strip.h"
 
-#include "i18n.h"
+#include "pbd/i18n.h"
 
 using namespace ARDOUR;
 using namespace ARDOUR_UI_UTILS;
@@ -57,9 +57,6 @@ VCAMasterStrip::VCAMasterStrip (Session* s, boost::shared_ptr<VCA> v)
        , delete_dialog (0)
        , control_slave_ui (s)
 {
-
-       PresentationInfo::color_t c = _vca->presentation_info().color ();
-
        /* set color for the VCA, if not already done. */
 
        if (!_vca->presentation_info().color_set()) {
@@ -98,7 +95,7 @@ VCAMasterStrip::VCAMasterStrip (Session* s, boost::shared_ptr<VCA> v)
        number_label.set_alignment (.5, .5);
        number_label.set_fallthrough_to_parent (true);
 
-       bottom_padding.set_size_request (-1, 32); /* this one is a hack. there's no trivial way to compute it */
+       bottom_padding.set_size_request (-1, 55); /* this one is a hack. there's no trivial way to compute it */
 
        //Glib::RefPtr<Pango::Layout> layout = vertical_button.get_layout ();
        // layout->set_justify (JUSTIFY_CENTER);
@@ -110,10 +107,6 @@ VCAMasterStrip::VCAMasterStrip (Session* s, boost::shared_ptr<VCA> v)
        vertical_button.set_active_color (_vca->presentation_info().color ());
        set_tooltip (vertical_button, _("Click to show slaves only")); /* tooltip updated dynamically */
 
-       drop_button.set_text(_("drop"));
-       drop_button.signal_clicked.connect (sigc::mem_fun (*this, &VCAMasterStrip::drop_button_press));
-       set_tooltip (drop_button, _("Unassign all slaves from this control master"));
-
        global_vpacker.set_border_width (1);
        global_vpacker.set_spacing (0);
 
@@ -123,7 +116,6 @@ VCAMasterStrip::VCAMasterStrip (Session* s, boost::shared_ptr<VCA> v)
        global_vpacker.pack_start (solo_mute_box, false, false);
        global_vpacker.pack_start (gain_meter, false, false, 2);
        global_vpacker.pack_start (control_slave_ui, false, false);
-       global_vpacker.pack_start (drop_button, false, false);
        global_vpacker.pack_start (bottom_padding, false, false);
 
        global_frame.add (global_vpacker);
@@ -142,7 +134,6 @@ VCAMasterStrip::VCAMasterStrip (Session* s, boost::shared_ptr<VCA> v)
        gain_meter.show ();
        solo_mute_box.show_all ();
        control_slave_ui.show ();
-       drop_button.show ();
 
        /* force setting of visible selected status */
 
@@ -231,14 +222,7 @@ VCAMasterStrip::name() const
 void
 VCAMasterStrip::hide_clicked ()
 {
-       if (!delete_dialog) {
-               delete_dialog = new MessageDialog (_("Removing a Master will deassign all slaves. Remove it anyway?"),
-                                                  true, MESSAGE_WARNING, BUTTONS_YES_NO, true);
-               delete_dialog->signal_response().connect (sigc::mem_fun (*this, &VCAMasterStrip::hide_confirmation));
-       }
-
-       delete_dialog->set_position (Gtk::WIN_POS_MOUSE);
-       delete_dialog->present ();
+       _vca->presentation_info().set_hidden (true);
 }
 
 void
@@ -389,6 +373,10 @@ VCAMasterStrip::vca_property_changed (PropertyChange const & what_changed)
        if (what_changed.contains (ARDOUR::Properties::color)) {
                vertical_button.set_active_color (_vca->presentation_info().color ());
        }
+
+       if (what_changed.contains (ARDOUR::Properties::hidden)) {
+
+       }
 }
 
 void
@@ -454,12 +442,6 @@ VCAMasterStrip::drop_all_slaves ()
        }
 }
 
-void
-VCAMasterStrip::drop_button_press ()
-{
-       drop_all_slaves ();
-}
-
 Gdk::Color
 VCAMasterStrip::color () const
 {
@@ -516,3 +498,15 @@ VCAMasterStrip::set_marked_for_display (bool yn)
        }
        return false;
 }
+
+PresentationInfo const &
+VCAMasterStrip::presentation_info () const
+{
+       return _vca->presentation_info();
+}
+
+boost::shared_ptr<Stripable>
+VCAMasterStrip::stripable () const
+{
+       return _vca;
+}