diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2015-10-21 22:31:30 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2015-10-21 22:31:35 -0400 |
commit | 8d3a8ca9136c3fb8a8bd24dd5d99c8e2e76699bd (patch) | |
tree | 86e9cb3829a6a49647c57ae6a9a2d0b15c665a38 /libs/ardour/ardour/automation_control.h | |
parent | 6ca3a1593e1467e057637e5ba863ca613e576eb8 (diff) |
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.
Diffstat (limited to 'libs/ardour/ardour/automation_control.h')
-rw-r--r-- | libs/ardour/ardour/automation_control.h | 12 |
1 files changed, 12 insertions, 0 deletions
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; } |