summaryrefslogtreecommitdiff
path: root/libs/surfaces
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2016-01-04 18:18:13 +0100
committerRobin Gareus <robin@gareus.org>2016-01-04 18:18:13 +0100
commitb4560603882e2a5c6652cf086bee34ab7127131b (patch)
treeecc77ff929a54e4f3f85178ba9f6c7a74aaada9b /libs/surfaces
parentd1cfd95591201d35637076a87e624ed8026a432e (diff)
OSC API update for surfaces that always send float parameters.
Diffstat (limited to 'libs/surfaces')
-rw-r--r--libs/surfaces/osc/osc.cc47
-rw-r--r--libs/surfaces/osc/osc.h3
2 files changed, 23 insertions, 27 deletions
diff --git a/libs/surfaces/osc/osc.cc b/libs/surfaces/osc/osc.cc
index c29469667c..8ce7969307 100644
--- a/libs/surfaces/osc/osc.cc
+++ b/libs/surfaces/osc/osc.cc
@@ -362,37 +362,32 @@ OSC::register_callbacks()
REGISTER_CALLBACK (serv, "/ardour/toggle_all_rec_enables", "", toggle_all_rec_enables);
/*
- * NOTE: these messages are provided for (arguably broken) apps
+ * NOTE: these messages are provided for (arguably broken) apps
* that MUST send float args ( TouchOSC and Lemur ).
* Normally these ardour transport messages don't require an argument,
* so we're providing redundant calls with vestigial "float" args.
*
- * Is it really useful to ignore the parameter?
- * http://hexler.net/docs/touchosc-controls-reference suggests that
- * push buttons do send 0,1. We will have to provide semantic equivalents
- * rather than simply ignore the parameter.
- * e.g push & release the button will send
- * .../undo f 1
- * .../undo f 0
- * resulting in two undos.
+ * These controls are active on 1.0 only (to prevent duplicate action on
+ * press "/button 1", and release "/button 0")
+ * http://hexler.net/docs/touchosc-controls-reference
*/
- REGISTER_CALLBACK (serv, "/ardour/unused_argument/loop_toggle", "f", loop_toggle);
- REGISTER_CALLBACK (serv, "/ardour/unused_argument/add_marker", "f", add_marker);
- REGISTER_CALLBACK (serv, "/ardour/unused_argument/goto_start", "f", goto_start);
- REGISTER_CALLBACK (serv, "/ardour/unused_argument/goto_end", "f", goto_end);
- REGISTER_CALLBACK (serv, "/ardour/unused_argument/rewind", "f", rewind);
- REGISTER_CALLBACK (serv, "/ardour/unused_argument/ffwd", "f", ffwd);
- REGISTER_CALLBACK (serv, "/ardour/unused_argument/transport_stop", "f", transport_stop);
- REGISTER_CALLBACK (serv, "/ardour/unused_argument/transport_play", "f", transport_play);
- REGISTER_CALLBACK (serv, "/ardour/unused_argument/save_state", "f", save_state);
- REGISTER_CALLBACK (serv, "/ardour/unused_argument/prev_marker", "f", prev_marker);
- REGISTER_CALLBACK (serv, "/ardour/unused_argument/next_marker", "f", next_marker);
- REGISTER_CALLBACK (serv, "/ardour/unused_argument/undo", "f", undo);
- REGISTER_CALLBACK (serv, "/ardour/unused_argument/redo", "f", redo);
- REGISTER_CALLBACK (serv, "/ardour/unused_argument/toggle_punch_in", "f", toggle_punch_in);
- REGISTER_CALLBACK (serv, "/ardour/unused_argument/toggle_punch_out", "f", toggle_punch_out);
- REGISTER_CALLBACK (serv, "/ardour/unused_argument/rec_enable_toggle", "f", rec_enable_toggle);
- REGISTER_CALLBACK (serv, "/ardour/unused_argument/toggle_all_rec_enables", "f", toggle_all_rec_enables);
+ REGISTER_CALLBACK (serv, "/ardour/pushbutton/loop_toggle", "f", loop_toggle);
+ REGISTER_CALLBACK (serv, "/ardour/pushbutton/add_marker", "f", add_marker);
+ REGISTER_CALLBACK (serv, "/ardour/pushbutton/goto_start", "f", goto_start);
+ REGISTER_CALLBACK (serv, "/ardour/pushbutton/goto_end", "f", goto_end);
+ REGISTER_CALLBACK (serv, "/ardour/pushbutton/rewind", "f", rewind);
+ REGISTER_CALLBACK (serv, "/ardour/pushbutton/ffwd", "f", ffwd);
+ REGISTER_CALLBACK (serv, "/ardour/pushbutton/transport_stop", "f", transport_stop);
+ REGISTER_CALLBACK (serv, "/ardour/pushbutton/transport_play", "f", transport_play);
+ REGISTER_CALLBACK (serv, "/ardour/pushbutton/save_state", "f", save_state);
+ REGISTER_CALLBACK (serv, "/ardour/pushbutton/prev_marker", "f", prev_marker);
+ REGISTER_CALLBACK (serv, "/ardour/pushbutton/next_marker", "f", next_marker);
+ REGISTER_CALLBACK (serv, "/ardour/pushbutton/undo", "f", undo);
+ REGISTER_CALLBACK (serv, "/ardour/pushbutton/redo", "f", redo);
+ REGISTER_CALLBACK (serv, "/ardour/pushbutton/toggle_punch_in", "f", toggle_punch_in);
+ REGISTER_CALLBACK (serv, "/ardour/pushbutton/toggle_punch_out", "f", toggle_punch_out);
+ REGISTER_CALLBACK (serv, "/ardour/pushbutton/rec_enable_toggle", "f", rec_enable_toggle);
+ REGISTER_CALLBACK (serv, "/ardour/pushbutton/toggle_all_rec_enables", "f", toggle_all_rec_enables);
REGISTER_CALLBACK (serv, "/ardour/routes/mute", "ii", route_mute);
REGISTER_CALLBACK (serv, "/ardour/routes/solo", "ii", route_solo);
diff --git a/libs/surfaces/osc/osc.h b/libs/surfaces/osc/osc.h
index 3718d25525..c19a8d0bb4 100644
--- a/libs/surfaces/osc/osc.h
+++ b/libs/surfaces/osc/osc.h
@@ -145,7 +145,8 @@ class OSC : public ARDOUR::ControlProtocol, public AbstractUI<OSCUIRequest>
static int _ ## name (const char *path, const char *types, lo_arg **argv, int argc, void *data, void *user_data) { \
return static_cast<OSC*>(user_data)->cb_ ## name (path, types, argv, argc, data); \
} \
- int cb_ ## name (const char *, const char *, lo_arg **, int, void *) { \
+ int cb_ ## name (const char *, const char *types, lo_arg ** argv, int argc, void *) { \
+ if (argc > 0 && !strcmp (types, "f") && argv[0]->f != 1.0) { return 0; } \
name (); \
return 0; \
}