ignore negative value locates and MMC locate commands
[ardour.git] / libs / ardour / automation_watch.cc
index 0fa98f2133a5469ac30e170b919a7353e7584015..5fa7285c674f11b585ac6beecf24259df72e9217 100644 (file)
@@ -19,6 +19,8 @@
 
 #include <iostream>
 
+#include <glibmm/timer.h>
+
 #include "pbd/compose.h"
 
 #include "ardour/automation_control.h"
@@ -72,8 +74,10 @@ AutomationWatch::add_automation_watch (boost::shared_ptr<AutomationControl> ac)
         */
 
        if (_session && _session->transport_rolling() && ac->alist()->automation_write()) {
-               DEBUG_TRACE (DEBUG::Automation, string_compose ("\ttransport is rolling @ %1, so enter write pass\n", _session->transport_speed()));
-               ac->list()->set_in_write_pass (true);
+               DEBUG_TRACE (DEBUG::Automation, string_compose ("\ttransport is rolling @ %1, audible = %2so enter write pass\n", 
+                                                               _session->transport_speed(), _session->audible_frame()));
+               /* add a guard point since we are already moving */
+               ac->list()->set_in_write_pass (true, true, _session->audible_frame());
        }
 
        /* we can't store shared_ptr<Destructible> in connections because it
@@ -120,7 +124,7 @@ AutomationWatch::timer ()
 
                for (AutomationWatches::iterator aw = automation_watches.begin(); aw != automation_watches.end(); ++aw) {
                        if ((*aw)->alist()->automation_write()) {
-                               (*aw)->list()->add (time, (*aw)->user_double());
+                               (*aw)->list()->add (time, (*aw)->user_double(), true);
                        }
                }
        }
@@ -132,7 +136,7 @@ void
 AutomationWatch::thread ()
 {
        while (_run_thread) {
-               usleep ((useconds_t) floor (Config->get_automation_interval_msecs() * 1000));
+               Glib::usleep ((gulong) floor (Config->get_automation_interval_msecs() * 1000));
                timer ();
        }
 }