diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2017-01-26 19:20:36 +0100 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2017-01-27 22:17:53 +0100 |
commit | 8cb3c42548e10539c1ccb1252189d65075132828 (patch) | |
tree | e9ae135c360781c7cde84a11bc971d51639b54f7 /libs/ardour/ardour | |
parent | 0938b6a9c12f5eec8d8e14912e95dbde9ac04b70 (diff) |
use RAII for class-wide PresentationInfo::Change signal, along with properties to describe what changed
Diffstat (limited to 'libs/ardour/ardour')
-rw-r--r-- | libs/ardour/ardour/presentation_info.h | 26 | ||||
-rw-r--r-- | libs/ardour/ardour/stripable.h | 2 |
2 files changed, 23 insertions, 5 deletions
diff --git a/libs/ardour/ardour/presentation_info.h b/libs/ardour/ardour/presentation_info.h index 612187e376..aa94cfd7aa 100644 --- a/libs/ardour/ardour/presentation_info.h +++ b/libs/ardour/ardour/presentation_info.h @@ -232,16 +232,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 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); @@ -249,6 +263,10 @@ class LIBARDOUR_API PresentationInfo : public PBD::Stateful order_t _order; Flag _flags; color_t _color; + + static PBD::PropertyChange _pending_static_changes; + static int _change_signal_suspended; + static void send_static_change (const PBD::PropertyChange&); }; } diff --git a/libs/ardour/ardour/stripable.h b/libs/ardour/ardour/stripable.h index 942b48815b..92cf7bdced 100644 --- a/libs/ardour/ardour/stripable.h +++ b/libs/ardour/ardour/stripable.h @@ -77,7 +77,7 @@ class LIBARDOUR_API Stripable : public SessionObject { /* set just the order */ - void set_presentation_order (PresentationInfo::order_t, bool notify_class_listeners = true); + void set_presentation_order (PresentationInfo::order_t); struct PresentationOrderSorter { bool operator() (boost::shared_ptr<Stripable> a, boost::shared_ptr<Stripable> b) { |