'libs/evoral' - cast the returned pointers from malloc() / g_ptr_array_index() etc...
[ardour.git] / libs / ardour / automation_watch.cc
index 7f67bb2c03860311bab6640a759961e129f9e717..4e5f64bd32cff5336e42534720250260f7755ecb 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
@@ -132,7 +136,7 @@ void
 AutomationWatch::thread ()
 {
        while (_run_thread) {
-               usleep (100000); // Config->get_automation_interval() * 10);
+               Glib::usleep ((useconds_t) floor (Config->get_automation_interval_msecs() * 1000));
                timer ();
        }
 }