summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libs/ardour/ardour/automation_watch.h2
-rw-r--r--libs/ardour/automation_watch.cc24
-rw-r--r--libs/ardour/session_transport.cc2
3 files changed, 28 insertions, 0 deletions
diff --git a/libs/ardour/ardour/automation_watch.h b/libs/ardour/ardour/automation_watch.h
index febbe10398..6822a38b4a 100644
--- a/libs/ardour/ardour/automation_watch.h
+++ b/libs/ardour/ardour/automation_watch.h
@@ -27,6 +27,7 @@
#include "pbd/signals.h"
#include "ardour/session_handle.h"
+#include "ardour/types.h"
namespace ARDOUR {
@@ -38,6 +39,7 @@ class LIBARDOUR_API AutomationWatch : public sigc::trackable, public ARDOUR::Ses
void add_automation_watch (boost::shared_ptr<ARDOUR::AutomationControl>);
void remove_automation_watch (boost::shared_ptr<ARDOUR::AutomationControl>);
+ void transport_stop_automation_watches (ARDOUR::framepos_t);
void set_session (ARDOUR::Session*);
gint timer ();
diff --git a/libs/ardour/automation_watch.cc b/libs/ardour/automation_watch.cc
index 4152c5d5b7..954b65120b 100644
--- a/libs/ardour/automation_watch.cc
+++ b/libs/ardour/automation_watch.cc
@@ -111,6 +111,30 @@ AutomationWatch::remove_automation_watch (boost::shared_ptr<AutomationControl> a
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 ()
{
diff --git a/libs/ardour/session_transport.cc b/libs/ardour/session_transport.cc
index 4a729700ab..4818cfaab3 100644
--- a/libs/ardour/session_transport.cc
+++ b/libs/ardour/session_transport.cc
@@ -37,6 +37,7 @@
#include "ardour/audioengine.h"
#include "ardour/auditioner.h"
+#include "ardour/automation_watch.h"
#include "ardour/butler.h"
#include "ardour/click.h"
#include "ardour/debug.h"
@@ -932,6 +933,7 @@ Session::non_realtime_stop (bool abort, int on_entry, bool& finished)
PositionChanged (_transport_frame); /* EMIT SIGNAL */
DEBUG_TRACE (DEBUG::Transport, string_compose ("send TSC with speed = %1\n", _transport_speed));
TransportStateChange (); /* EMIT SIGNAL */
+ AutomationWatch::instance().transport_stop_automation_watches (_transport_frame);
/* and start it up again if relevant */