OSC: fix scrub to not use boost ptime.
authorLen Ovens <len@ovenwerks.net>
Mon, 1 May 2017 20:45:47 +0000 (13:45 -0700)
committerLen Ovens <len@ovenwerks.net>
Mon, 1 May 2017 20:45:47 +0000 (13:45 -0700)
libs/surfaces/osc/osc.cc
libs/surfaces/osc/osc.h

index 20d89edfe28c2b73a0820cfb71b917952505ce7f..c2956fa551b4f3f96530ab7deecb0ff0501ec187 100644 (file)
@@ -1760,12 +1760,12 @@ OSC::scrub (float delta, lo_message msg)
 
        float speed;
 
-       boost::posix_time::ptime now = boost::posix_time::microsec_clock::local_time();
-       boost::posix_time::time_duration diff = now - scrub_time;
-       if (diff.total_milliseconds() > 35) {
+       int64_t now = ARDOUR::get_microseconds ();
+       int64_t diff = now - scrub_time;
+       if (diff > 35) {
                // speed 1 (or 0 if jog wheel supports touch)
                speed = delta;
-       } else if ((diff.total_milliseconds() > 20) && (fabs(scrub_speed) == 1)) {
+       } else if ((diff > 20) && (fabs(scrub_speed) == 1)) {
                // add some hysteresis to stop excess speed jumps
                speed = delta;
        } else {
@@ -3614,9 +3614,9 @@ OSC::periodic (void)
 
        if (scrub_speed != 0) {
                // for those jog wheels that don't have 0 on release (touch), time out.
-               boost::posix_time::ptime now = boost::posix_time::microsec_clock::local_time();
-               boost::posix_time::time_duration diff = now - scrub_time;
-               if (diff.total_milliseconds() > 100) {
+               int64_t now = ARDOUR::get_microseconds ();
+               int64_t diff = now - scrub_time;
+               if (diff > 100) {
                        scrub_speed = 0;
                        session->request_transport_speed (0);
                        // locate to the place PH was at last tick
index 2157b0e27840a6792df1a1e6a84b5bf994cbc7a7..97f2c4e5eb9d173eaafe2f8913a0707c6b35a7b4 100644 (file)
@@ -186,7 +186,7 @@ class OSC : public ARDOUR::ControlProtocol, public AbstractUI<OSCUIRequest>
        bool bank_dirty;
        float scrub_speed;                      // Current scrub speed
        double scrub_place;                     // place of play head at latest jog/scrub wheel tick
-       boost::posix_time::ptime scrub_time;    // when did the wheel move last?
+       int64_t scrub_time;     // when did the wheel move last?
        bool global_init;
        boost::shared_ptr<ARDOUR::Stripable> _select;   // which stripable out of /surface/stripables is gui selected