summaryrefslogtreecommitdiff
path: root/libs/ardour/automatable.cc
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-06-30 18:41:50 +0000
committerDavid Robillard <d@drobilla.net>2007-06-30 18:41:50 +0000
commitbbf41757133a29df0d37905f2fdce091878d2ffd (patch)
tree2506ed83985d406019236c68704df0b9542dbe3a /libs/ardour/automatable.cc
parent685fa95e729e5d510b28b4c715da062e9db580d9 (diff)
Another not-quite-there-but-better commit.
Brought plugin automation into the fold of new automation system. Fixed plugin automation, broke panner automation :] (pending Panner work). Made AutomationController better at automatically following it's controller value (mimic what gain meter does). Fixed some visible automation track bugs (but still broken WRT serialization). git-svn-id: svn://localhost/ardour2/trunk@2092 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/automatable.cc')
-rw-r--r--libs/ardour/automatable.cc36
1 files changed, 27 insertions, 9 deletions
diff --git a/libs/ardour/automatable.cc b/libs/ardour/automatable.cc
index d7c570ecdf..8c061ad296 100644
--- a/libs/ardour/automatable.cc
+++ b/libs/ardour/automatable.cc
@@ -127,8 +127,6 @@ Automatable::add_control(boost::shared_ptr<AutomationControl> ac)
cerr << _name << ": added parameter " << param.to_string() << endl;
- // FIXME: sane default behaviour?
- _visible_controls.insert(param);
_can_automate_list.insert(param);
// Sync everything (derived classes) up to initial values
@@ -355,17 +353,22 @@ Automatable::set_parameter_automation_state (ParamID param, AutoState s)
}
AutoState
-Automatable::get_parameter_automation_state (ParamID param)
+Automatable::get_parameter_automation_state (ParamID param, bool lock)
{
- Glib::Mutex::Lock lm (_automation_lock);
+ AutoState result = Off;
+
+ if (lock)
+ _automation_lock.lock();
boost::shared_ptr<AutomationControl> c = control(param);
- if (c) {
- return c->list()->automation_state();
- } else {
- return Off;
- }
+ if (c)
+ result = c->list()->automation_state();
+
+ if (lock)
+ _automation_lock.unlock();
+
+ return result;
}
void
@@ -434,3 +437,18 @@ Automatable::automation_snapshot (nframes_t now)
}
}
+void
+Automatable::transport_stopped (nframes_t now)
+{
+ for (Controls::iterator li = _controls.begin(); li != _controls.end(); ++li) {
+
+ boost::shared_ptr<AutomationControl> c = li->second;
+
+ c->list()->reposition_for_rt_add (now);
+
+ if (c->list()->automation_state() != Off) {
+ c->set_value(c->list()->eval(now));
+ }
+ }
+}
+