diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2017-08-12 14:38:56 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2017-08-12 14:40:21 -0400 |
commit | 840253749326472cb7aecae70bcdd5a54c9ee842 (patch) | |
tree | 273ffab55063faa71c03a3796344cbee8a9e93d9 /libs/ardour/automation_list.cc | |
parent | 3ff352be7950726876c4818d7f6cf2311235ac6d (diff) |
use a lock to set/get AutomationList automation state
It isn't 100% clear that we should use the list's data lock, but it seems quite likely
that this is the correct design, because of the interlock between data being present
and automation state
Diffstat (limited to 'libs/ardour/automation_list.cc')
-rw-r--r-- | libs/ardour/automation_list.cc | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/libs/ardour/automation_list.cc b/libs/ardour/automation_list.cc index d92e65288f..3ffc040b62 100644 --- a/libs/ardour/automation_list.cc +++ b/libs/ardour/automation_list.cc @@ -192,16 +192,28 @@ AutomationList::maybe_signal_changed () } } +AutoState +AutomationList::automation_state() const +{ + Glib::Threads::RWLock::ReaderLock lm (Evoral::ControlList::_lock); + return _state; +} + void AutomationList::set_automation_state (AutoState s) { - if (s == _state) { - return; - } - _state = s; - if (s == Write && _desc.toggled) { - snapshot_history (true); + { + Glib::Threads::RWLock::ReaderLock lm (Evoral::ControlList::_lock); + + if (s == _state) { + return; + } + _state = s; + if (s == Write && _desc.toggled) { + snapshot_history (true); + } } + automation_state_changed (s); /* EMIT SIGNAL */ } @@ -588,4 +600,3 @@ AutomationListProperty::clone () const boost::shared_ptr<AutomationList> (new AutomationList (*this->_current.get())) ); } - |