diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2017-02-21 15:04:20 +0100 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2017-02-21 15:07:07 +0100 |
commit | 1b2a64c391d7f4a81dda85bdbd063fb80329e498 (patch) | |
tree | 05cb2722edf3c24601d0744c6d3e801c34bd6e8e /libs/ardour/ardour/slavable_automation_control.h | |
parent | 9de5c61b9e04e9949ef426663c6542dd13a5e42a (diff) |
redesign VCA control over gain (and theoretically other scalar controls)
master(s) value now just scales the control's own value; a trivial
bit of math at assign/deassign ensures that values do not change
during add/remove master operations
Diffstat (limited to 'libs/ardour/ardour/slavable_automation_control.h')
-rw-r--r-- | libs/ardour/ardour/slavable_automation_control.h | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/libs/ardour/ardour/slavable_automation_control.h b/libs/ardour/ardour/slavable_automation_control.h index 857a8956e1..f1a78891e4 100644 --- a/libs/ardour/ardour/slavable_automation_control.h +++ b/libs/ardour/ardour/slavable_automation_control.h @@ -70,7 +70,7 @@ class LIBARDOUR_API SlavableAutomationControl : public AutomationControl public: MasterRecord (boost::shared_ptr<AutomationControl> gc, double r) : _master (gc) - , _ratio (r) + , _yn (false) {} boost::shared_ptr<AutomationControl> master() const { return _master; } @@ -83,23 +83,12 @@ class LIBARDOUR_API SlavableAutomationControl : public AutomationControl bool yn() const { return _yn; } void set_yn (bool yn) { _yn = yn; } - /* for non-boolean/non-toggled controls, we store a ratio that - * connects the value of the master with the value of this - * slave. See comments in the source for more details on how - * this is computed and used. - */ - - double ratio () const { return _ratio; } - void reset_ratio (double r) { _ratio = r; } - PBD::ScopedConnection connection; private: boost::shared_ptr<AutomationControl> _master; - union { - double _ratio; - bool _yn; - }; + /* holds most recently seen master value for boolean/toggle controls */ + bool _yn; }; mutable Glib::Threads::RWLock master_lock; @@ -109,11 +98,10 @@ class LIBARDOUR_API SlavableAutomationControl : public AutomationControl void master_going_away (boost::weak_ptr<AutomationControl>); double get_value_locked() const; - void actually_set_value (double val, PBD::Controllable::GroupControlDisposition group_override); + void actually_set_value (double value, PBD::Controllable::GroupControlDisposition); void update_boolean_masters_records (boost::shared_ptr<AutomationControl>); virtual void master_changed (bool from_self, GroupControlDisposition gcd, boost::shared_ptr<AutomationControl>); - virtual void recompute_masters_ratios (double val) { /* do nothing by default */} virtual double get_masters_value_locked () const; virtual void pre_remove_master (boost::shared_ptr<AutomationControl>) {} virtual void post_add_master (boost::shared_ptr<AutomationControl>) {} |