summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorLen Ovens <len@ovenwerks.net>2017-05-19 15:48:36 -0700
committerLen Ovens <len@ovenwerks.net>2017-05-19 15:48:36 -0700
commit6926b7eb75ccd26a6a39d24cea8ea45c7bd7101b (patch)
tree4f9b6ef40d5f3060fb8c02fbe99fe279957b8aa8 /libs
parent84e1a216bc60130092108269c80799a7ced97d06 (diff)
OSC: Catch case of surface sending fader move before touch
Diffstat (limited to 'libs')
-rw-r--r--libs/surfaces/osc/osc.cc15
1 files changed, 11 insertions, 4 deletions
diff --git a/libs/surfaces/osc/osc.cc b/libs/surfaces/osc/osc.cc
index fc72e96d6f..d23fe21ad1 100644
--- a/libs/surfaces/osc/osc.cc
+++ b/libs/surfaces/osc/osc.cc
@@ -2335,14 +2335,21 @@ OSC::touch_detect (const char *path, lo_arg **argv, int argc, lo_message msg)
if (control) {
if (touch) {
//start touch
- if (!control->touching ()) {
+ if (control->automation_state() == Touch && !control->touching ()) {
control->start_touch (control->session().transport_frame());
}
} else {
// end touch
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();) {
+ if ((*x).first == control) {
+ x = _touch_timeout.erase (x);
+ } else {
+ ++x;
+ }
+ }
}
}
@@ -2354,10 +2361,10 @@ OSC::fake_touch (boost::shared_ptr<ARDOUR::AutomationControl> ctrl)
{
if (ctrl) {
//start touch
- if (!ctrl->touching ()) {
+ if (ctrl->automation_state() == Touch && !ctrl->touching ()) {
ctrl->start_touch (ctrl->session().transport_frame());
- }
_touch_timeout[ctrl] = 10;
+ }
}
return 0;