Allow overrides of the user-set visibility stuff and use it to make sure the master...
[ardour.git] / gtk2_ardour / visibility_group.h
index d9e13e1e930c04ec5ec706de8be08980cf499506..940b8bcc528b8077a87275da31059276e8e691ce 100644 (file)
@@ -37,7 +37,14 @@ class VisibilityGroup
 public:
        VisibilityGroup (std::string const &);
        
-       void add (Gtk::Widget *, std::string const &, std::string const &, bool visible = true);
+       void add (
+               Gtk::Widget *,
+               std::string const &,
+               std::string const &,
+               bool visible = 0,
+               boost::function<boost::optional<bool> ()> = 0
+               );
+       
        Gtk::Menu* menu ();
        Gtk::Widget* list_view ();
        bool button_press_event (GdkEventButton *);
@@ -56,6 +63,7 @@ private:
                std::string  id;
                std::string  name;
                bool         visible;
+               boost::function<boost::optional<bool> ()> override;
        };
 
        class ModelColumns : public Gtk::TreeModelColumnRecord {
@@ -74,6 +82,7 @@ private:
        void toggle (std::vector<Member>::iterator);
        void list_view_visible_changed (std::string const &);
        void update_list_view ();
+       bool should_actually_be_visible (Member const &) const;
 
        std::vector<Member> _members;
        std::string _xml_property_name;