diff options
author | Len Ovens <len@ovenwerks.net> | 2017-05-01 13:45:47 -0700 |
---|---|---|
committer | Len Ovens <len@ovenwerks.net> | 2017-05-01 13:45:47 -0700 |
commit | e5182f3eb46e8ccad23aa61b8ed3ae528f3ec540 (patch) | |
tree | ba189dc0cc1f663c2871ad450a2f3b2e6aba2b4e | |
parent | 5f06ae43d87b441363afca3752c95ad5ed90f885 (diff) |
OSC: fix scrub to not use boost ptime.
-rw-r--r-- | libs/surfaces/osc/osc.cc | 14 | ||||
-rw-r--r-- | libs/surfaces/osc/osc.h | 2 |
2 files changed, 8 insertions, 8 deletions
diff --git a/libs/surfaces/osc/osc.cc b/libs/surfaces/osc/osc.cc index 20d89edfe2..c2956fa551 100644 --- a/libs/surfaces/osc/osc.cc +++ b/libs/surfaces/osc/osc.cc @@ -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 diff --git a/libs/surfaces/osc/osc.h b/libs/surfaces/osc/osc.h index 2157b0e278..97f2c4e5eb 100644 --- a/libs/surfaces/osc/osc.h +++ b/libs/surfaces/osc/osc.h @@ -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 |