From 0c5e5f54a0a6eff1e516683eda55ef02ae32c1ac Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 4 Mar 2016 10:06:36 -0500 Subject: change master-record management to use std::map to avoid const iterators; drop connection to master Changed signal when unassigning --- libs/ardour/ardour/gain_control.h | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) (limited to 'libs/ardour/ardour/gain_control.h') diff --git a/libs/ardour/ardour/gain_control.h b/libs/ardour/ardour/gain_control.h index 15be6d684f..f833163383 100644 --- a/libs/ardour/ardour/gain_control.h +++ b/libs/ardour/ardour/gain_control.h @@ -20,7 +20,7 @@ #define __ardour_gain_control_h__ #include -#include +#include #include #include @@ -70,34 +70,25 @@ class LIBARDOUR_API GainControl : public AutomationControl { private: class MasterRecord { public: - MasterRecord (boost::shared_ptr gc, uint32_t n, double r) + MasterRecord (boost::shared_ptr gc, double r) : _master (gc) - , _number (n) , _ratio (r) {} boost::shared_ptr master() const { return _master; } double ratio () const { return _ratio; } - uint32_t number() const { return _number; } - - bool operator== (MasterRecord const& other) const { - return _number == other._number; - } - - bool operator< (MasterRecord const& other) const { - return _number < other._number; - } - void reset_ratio (double r) { _ratio = r; } - private: - const boost::shared_ptr _master; - const uint32_t _number; + PBD::ScopedConnection connection; + + private: + boost::shared_ptr _master; double _ratio; + }; mutable Glib::Threads::RWLock master_lock; - typedef std::set Masters; + typedef std::map Masters; Masters _masters; PBD::ScopedConnectionList masters_connections; std::string _masters_state_string (); @@ -105,7 +96,7 @@ class LIBARDOUR_API GainControl : public AutomationControl { gain_t get_master_gain_locked () const; void master_going_away (boost::weak_ptr); void recompute_masters_ratios (double val); - + void _set_value (double val, PBD::Controllable::GroupControlDisposition group_override); }; -- cgit v1.2.3