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/automation_control.cc | |
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/automation_control.cc')
-rw-r--r-- | libs/ardour/automation_control.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libs/ardour/automation_control.cc b/libs/ardour/automation_control.cc index 0e2355e708..671cd6e977 100644 --- a/libs/ardour/automation_control.cc +++ b/libs/ardour/automation_control.cc @@ -25,6 +25,7 @@ #include "ardour/session.h" #include "pbd/memento_command.h" +#include "pbd/stacktrace.h" #include "i18n.h" @@ -48,6 +49,16 @@ AutomationControl::~AutomationControl () { } +bool +AutomationControl::writable() const +{ + boost::shared_ptr<AutomationList> al = alist(); + if (al) { + return al->automation_state() != Play; + } + return true; +} + /** Get the current effective `user' value based on automation state */ double AutomationControl::get_value() const |