13
0

OSC: fix scrub to not use boost ptime.

This commit is contained in:
Len Ovens 2017-05-01 13:45:47 -07:00
parent 5f06ae43d8
commit e5182f3eb4
2 changed files with 8 additions and 8 deletions

View 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

View 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