ac->list()->set_in_write_pass (false);
}
+void
+AutomationWatch::transport_stop_automation_watches (framepos_t when)
+{
+ DEBUG_TRACE (DEBUG::Automation, "clear all automation watches\n");
+
+ AutomationWatches tmp;
+
+ {
+ Glib::Threads::Mutex::Lock lm (automation_watch_lock);
+ /* copy automation watches */
+ tmp = automation_watches;
+ /* clear existing container so that each
+ ::remove_automation_watch() call from
+ AutomationControl::stop_touch() is faster.
+ */
+
+ automation_watches.clear ();
+ }
+
+ for (AutomationWatches::iterator i = tmp.begin(); i != tmp.end(); ++i) {
+ (*i)->stop_touch (true, when);
+ }
+}
+
gint
AutomationWatch::timer ()
{
if (time > _last_time) { //we only write automation in the forward direction; this fixes automation-recording in a loop
for (AutomationWatches::iterator aw = automation_watches.begin(); aw != automation_watches.end(); ++aw) {
if ((*aw)->alist()->automation_write()) {
- (*aw)->list()->add (time, (*aw)->user_double(), true);
+ double val = (*aw)->user_double();
+ boost::shared_ptr<SlavableAutomationControl> sc = boost::dynamic_pointer_cast<SlavableAutomationControl> (*aw);
+ if (sc) {
+ val = sc->reduce_by_masters (val, true);
+ }
+ (*aw)->list()->add (time, val, true);
}
}
} else if (time != _last_time) { //transport stopped or reversed. stop the automation pass and start a new one (for bonus points, someday store the previous pass in an undo record)
(*aw)->alist()->automation_write()));
(*aw)->list()->set_in_write_pass (false);
if ( (*aw)->alist()->automation_write() ) {
- (*aw)->list()->set_in_write_pass (true);
+ (*aw)->list()->set_in_write_pass (true, time);
}
}
}