From 8d3a8ca9136c3fb8a8bd24dd5d99c8e2e76699bd Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 21 Oct 2015 22:31:30 -0400 Subject: Add AutomationControl::set_value_unchecked() and AutomationControl::writable() and use them. Classes derived from AutomationControl now check ::writable() in their ::set_value() methods to ensure that they do not attempt to overwrite data sent to them while automation playback is underway. --- libs/ardour/ardour/automation_control.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'libs/ardour/ardour/automation_control.h') diff --git a/libs/ardour/ardour/automation_control.h b/libs/ardour/ardour/automation_control.h index c634e3474a..9190b71677 100644 --- a/libs/ardour/ardour/automation_control.h +++ b/libs/ardour/ardour/automation_control.h @@ -81,9 +81,21 @@ public: void start_touch(double when); void stop_touch(bool mark, double when); + /* inherited from PBD::Controllable. + * Derived classes MUST call ::writable() to verify + * that writing to the parameter is legal at that time. + */ void set_value (double); double get_value () const; + /* automation related value setting */ + virtual bool writable () const; + /* Call to ::set_value() with no test for writable() because + * this is only used by automation playback. We would like + * to make it pure virtual + */ + virtual void set_value_unchecked (double val) {} + double lower() const { return _desc.lower; } double upper() const { return _desc.upper; } double normal() const { return _desc.normal; } -- cgit v1.2.3