diff options
author | Len Ovens <len@ovenwerks.net> | 2017-05-20 10:17:31 -0700 |
---|---|---|
committer | Len Ovens <len@ovenwerks.net> | 2017-05-20 10:17:31 -0700 |
commit | b3fb75feadf28e35c302149778b544172f808a09 (patch) | |
tree | 711b3ea761a031f994663752b23c15ae796e0cf9 /libs | |
parent | ab069b13729bef775544fb3f2d71ba9bd4b1a910 (diff) |
OSC: Further fixes so multiple controls can touch at once.
Diffstat (limited to 'libs')
-rw-r--r-- | libs/surfaces/osc/osc.cc | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/libs/surfaces/osc/osc.cc b/libs/surfaces/osc/osc.cc index 05eeab5b0c..70b02a7501 100644 --- a/libs/surfaces/osc/osc.cc +++ b/libs/surfaces/osc/osc.cc @@ -2343,11 +2343,9 @@ OSC::touch_detect (const char *path, lo_arg **argv, int argc, lo_message msg) control->stop_touch (true, control->session().transport_frame()); } // just in case some crazy surface starts sending control values before touch - for (FakeTouchMap::iterator x = _touch_timeout.begin(); x != _touch_timeout.end(); x++) { - if ((*x).first == control) { - _touch_timeout.erase (x); - break; - } + FakeTouchMap::iterator x = _touch_timeout.find(control); + if (x != _touch_timeout.end()) { + _touch_timeout.erase (x); } } } @@ -3975,14 +3973,15 @@ OSC::periodic (void) co->tick(); } } - for (FakeTouchMap::iterator x = _touch_timeout.begin(); x != _touch_timeout.end(); x++) { + for (FakeTouchMap::iterator x = _touch_timeout.begin(); x != _touch_timeout.end();) { _touch_timeout[(*x).first] = (*x).second - 1; if (!(*x).second) { boost::shared_ptr<ARDOUR::AutomationControl> ctrl = (*x).first; // turn touch off ctrl->stop_touch (true, ctrl->session().transport_frame()); - _touch_timeout.erase (x); - break; + _touch_timeout.erase (x++); + } else { + x++; } } return true; |