new style for Gtk::Entry widgets
[ardour.git] / gtk2_ardour / vca_master_strip.cc
index 4ef1e4adaf5eaf5f5ccbea6e5fef92577de3f56f..c0ade152af86525329303d0d1c108aa9a5733de2 100644 (file)
@@ -52,17 +52,14 @@ PBD::Signal1<void,VCAMasterStrip*> VCAMasterStrip::CatchDeletion;
 VCAMasterStrip::VCAMasterStrip (Session* s, boost::shared_ptr<VCA> v)
        : SessionHandlePtr (s)
        , _vca (v)
-       , gain_meter (s, 254)
+       , gain_meter (s, 254) /* magic number, don't adjust blindly */
        , context_menu (0)
        , delete_dialog (0)
        , control_slave_ui (s)
 {
+       /* set color for the VCA, if not already done. */
 
-       PresentationInfo::color_t c = _vca->presentation_info().color ();
-
-       /* XXX need a (better) test of "has a color" */
-
-       if (c == 0) {
+       if (!_vca->presentation_info().color_set()) {
                _vca->presentation_info().set_color (gdk_color_to_rgba (unique_random_color()));
        }
 
@@ -231,14 +228,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 +379,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
@@ -500,3 +494,19 @@ VCAMasterStrip::finish_color_edit (int response, Gtk::ColorSelectionDialog* dial
 
        delete_when_idle (dialog);
 }
+
+bool
+VCAMasterStrip::marked_for_display () const
+{
+       return !_vca->presentation_info().hidden();
+}
+
+bool
+VCAMasterStrip::set_marked_for_display (bool yn)
+{
+       if (yn == _vca->presentation_info().hidden()) {
+               _vca->presentation_info().set_hidden (!yn);
+               return true; // things changed
+       }
+       return false;
+}