remove getter for Amp::_apply_automation_gain; reset member to false after use, and...
[ardour.git] / libs / ardour / ardour / presentation_info.h
index 6ef0fae7bb6e7dc24e3e2ad177404784cac68fd7..0bcfff9210491f69630ab3ac62306932eb7db535 100644 (file)
@@ -93,11 +93,6 @@ class LIBARDOUR_API PresentationInfo : public PBD::Stateful
         * change after construction (not strictly the constructor itself, but
         * a more generalized notion of construction, as in "ready to use").
         *
-        * SELECTION
-        *
-        * When an object is selected, its _flags member will have the Selected
-        * bit set.
-        *
         * VISIBILITY
         *
         * When an object is hidden, its _flags member will have the Hidden
@@ -119,13 +114,14 @@ class LIBARDOUR_API PresentationInfo : public PBD::Stateful
                /* These are for sharing Stripable states between the GUI and other
                 * user interfaces/control surfaces
                 */
-               Selected = 0x100,
-               Hidden = 0x200,
+               Hidden = 0x100,
                /* single bit indicates that the group order is set */
                OrderSet = 0x400,
 
                /* special mask to delect out "state" bits */
-               StatusMask = (Selected|Hidden)
+               StatusMask = (Hidden),
+               /* special mask to delect select type bits */
+               TypeMask = (AudioBus|AudioTrack|MidiTrack|MidiBus|VCA|MasterOut|MonitorOut|Auditioner)
        };
 
        static const Flag AllStripables; /* mask to use for any route or VCA (but not auditioner) */
@@ -150,15 +146,15 @@ class LIBARDOUR_API PresentationInfo : public PBD::Stateful
        bool color_set() const;
 
        void set_color (color_t);
-       void set_selected (bool yn);
        void set_hidden (bool yn);
        void set_flags (Flag f) { _flags = f; }
 
        bool order_set() const { return _flags & OrderSet; }
 
+       int selection_cnt() const { return _selection_cnt; }
+
        bool hidden() const { return _flags & Hidden; }
-       bool selected() const { return _flags & Selected; }
-       bool special() const { return _flags & (MasterOut|MonitorOut|Auditioner); }
+       bool special(bool with_master = true) const { return _flags & ((with_master ? MasterOut : 0)|MonitorOut|Auditioner); }
 
        bool flag_match (Flag f) const {
                /* no flags, match all */
@@ -205,10 +201,13 @@ class LIBARDOUR_API PresentationInfo : public PBD::Stateful
                        return true;
                }
 
-               /* compare without status mask - we already checked that above 
+               /* check for any matching type bits.
+                *
+                * Do comparisoon without status mask or order set bits - we
+                * already checked that above.
                 */
 
-               return (_flags & (f &~ (StatusMask|OrderSet))) != 0; /* some flag matches */
+               return ((f & TypeMask) & _flags);
        }
 
        int set_state (XMLNode const&, int);
@@ -227,15 +226,30 @@ class LIBARDOUR_API PresentationInfo : public PBD::Stateful
        static Flag get_flags (XMLNode const& node);
        static std::string state_node_name;
 
-       /* for things concerned about *any* PresentationInfo. This is emitted
-        * only at the request of another object that has finished making some
-        * changes (e.g. reordering things)
+       /* for things concerned about *any* PresentationInfo.
         */
 
-       static PBD::Signal0<void> Change;
+       static PBD::Signal1<void,PBD::PropertyChange const &> Change;
+       static void send_static_change (const PBD::PropertyChange&);
 
        static void make_property_quarks ();
 
+  protected:
+       friend class ChangeSuspender;
+       static void suspend_change_signal ();
+       static void unsuspend_change_signal ();
+
+  public:
+       class ChangeSuspender {
+          public:
+               ChangeSuspender() {
+                       PresentationInfo::suspend_change_signal ();
+               }
+               ~ChangeSuspender() {
+                       PresentationInfo::unsuspend_change_signal ();
+               }
+       };
+
   protected:
        friend class Stripable;
        void set_order (order_t order);
@@ -244,6 +258,13 @@ class LIBARDOUR_API PresentationInfo : public PBD::Stateful
        order_t _order;
        Flag    _flags;
        color_t _color;
+       int     _selection_cnt;
+
+       static PBD::PropertyChange _pending_static_changes;
+       static Glib::Threads::Mutex static_signal_lock;
+       static int _change_signal_suspended;
+
+       static int selection_counter;
 };
 
 }