diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2016-03-04 10:06:36 -0500 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2016-05-31 15:30:39 -0400 |
commit | 0c5e5f54a0a6eff1e516683eda55ef02ae32c1ac (patch) | |
tree | 57528e5ae2f7aaa39a0cb3c7a5501dd0a735b4e6 /libs/ardour/ardour/gain_control.h | |
parent | a38aabfce38e0977df3c06076c80118488857942 (diff) |
change master-record management to use std::map to avoid const iterators; drop connection to master Changed signal when unassigning
Diffstat (limited to 'libs/ardour/ardour/gain_control.h')
-rw-r--r-- | libs/ardour/ardour/gain_control.h | 27 |
1 files changed, 9 insertions, 18 deletions
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 <string> -#include <set> +#include <map> #include <boost/shared_ptr.hpp> #include <glibmm/threads.h> @@ -70,34 +70,25 @@ class LIBARDOUR_API GainControl : public AutomationControl { private: class MasterRecord { public: - MasterRecord (boost::shared_ptr<GainControl> gc, uint32_t n, double r) + MasterRecord (boost::shared_ptr<GainControl> gc, double r) : _master (gc) - , _number (n) , _ratio (r) {} boost::shared_ptr<GainControl> 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<GainControl> _master; - const uint32_t _number; + PBD::ScopedConnection connection; + + private: + boost::shared_ptr<GainControl> _master; double _ratio; + }; mutable Glib::Threads::RWLock master_lock; - typedef std::set<MasterRecord> Masters; + typedef std::map<uint32_t,MasterRecord> 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<VCA>); void recompute_masters_ratios (double val); - + void _set_value (double val, PBD::Controllable::GroupControlDisposition group_override); }; |