summaryrefslogtreecommitdiff
path: root/libs/surfaces
diff options
context:
space:
mode:
authorLen Ovens <len@ovenwerks.net>2016-10-23 18:45:25 -0700
committerLen Ovens <len@ovenwerks.net>2016-10-23 18:45:25 -0700
commitdd015e09a7265e2b274c58ead9c63cfe55ed1a2c (patch)
treeec56a9b38b53ac356a75d0d8f7d6488ce39992e2 /libs/surfaces
parent53e9337eba17236550cee4c04cec41bcaf204fcf (diff)
OSC Accept int in first parameter in path commands as well as float.
Diffstat (limited to 'libs/surfaces')
-rw-r--r--libs/surfaces/osc/osc.cc197
1 files changed, 99 insertions, 98 deletions
diff --git a/libs/surfaces/osc/osc.cc b/libs/surfaces/osc/osc.cc
index 1ce3568a44..9d09c97d8d 100644
--- a/libs/surfaces/osc/osc.cc
+++ b/libs/surfaces/osc/osc.cc
@@ -886,108 +886,109 @@ OSC::catchall (const char *path, const char* types, lo_arg **argv, int argc, lo_
}
ret = 0;
- } else if (argc == 1 && types[0] == 'f') { // single float -- probably TouchOSC
- if (!strncmp (path, "/strip/gain/", 12) && strlen (path) > 12) {
- // in dB
- int ssid = atoi (&path[12]);
- route_set_gain_dB (ssid, argv[0]->f, msg);
- ret = 0;
- }
- else if (!strncmp (path, "/strip/fader/", 13) && strlen (path) > 13) {
- // in fader position
- int ssid = atoi (&path[13]);
- route_set_gain_fader (ssid, argv[0]->f, msg);
- ret = 0;
- }
- else if (!strncmp (path, "/strip/trimdB/", 14) && strlen (path) > 14) {
- int ssid = atoi (&path[14]);
- route_set_trim_dB (ssid, argv[0]->f, msg);
- ret = 0;
- }
- else if (!strncmp (path, "/strip/pan_stereo_position/", 27) && strlen (path) > 27) {
- int ssid = atoi (&path[27]);
- route_set_pan_stereo_position (ssid, argv[0]->f, msg);
- ret = 0;
- }
- else if (!strncmp (path, "/strip/mute/", 12) && strlen (path) > 12) {
- int ssid = atoi (&path[12]);
- route_mute (ssid, argv[0]->f == 1.0, msg);
- ret = 0;
- }
- else if (!strncmp (path, "/strip/solo/", 12) && strlen (path) > 12) {
- int ssid = atoi (&path[12]);
- route_solo (ssid, argv[0]->f == 1.0, msg);
- ret = 0;
- }
- else if (!strncmp (path, "/strip/monitor_input/", 21) && strlen (path) > 21) {
- int ssid = atoi (&path[21]);
- route_monitor_input (ssid, argv[0]->f == 1.0, msg);
- ret = 0;
- }
- else if (!strncmp (path, "/strip/monitor_disk/", 20) && strlen (path) > 20) {
- int ssid = atoi (&path[20]);
- route_monitor_disk (ssid, argv[0]->f == 1.0, msg);
- ret = 0;
- }
- else if (!strncmp (path, "/strip/recenable/", 17) && strlen (path) > 17) {
- int ssid = atoi (&path[17]);
- route_recenable (ssid, argv[0]->f == 1.0, msg);
- ret = 0;
- }
- else if (!strncmp (path, "/strip/record_safe/", 19) && strlen (path) > 19) {
- int ssid = atoi (&path[19]);
- route_recsafe (ssid, argv[0]->f == 1.0, msg);
- ret = 0;
- }
- else if (!strncmp (path, "/strip/expand/", 14) && strlen (path) > 14) {
- int ssid = atoi (&path[14]);
- strip_expand (ssid, argv[0]->f == 1.0, msg);
- ret = 0;
- }
- else if (!strncmp (path, "/strip/select/", 14) && strlen (path) > 14) {
- int ssid = atoi (&path[14]);
- strip_gui_select (ssid, argv[0]->f == 1.0, msg);
- ret = 0;
- }
- else if (!strncmp (path, "/select/send_gain/", 18) && strlen (path) > 18) {
- int ssid = atoi (&path[18]);
- sel_sendgain (ssid, argv[0]->f, msg);
- ret = 0;
- }
- else if (!strncmp (path, "/select/send_fader/", 19) && strlen (path) > 19) {
- int ssid = atoi (&path[19]);
- sel_sendfader (ssid, argv[0]->f, msg);
- ret = 0;
- }
- else if (!strncmp (path, "/select/send_enable/", 20) && strlen (path) > 20) {
- int ssid = atoi (&path[20]);
- sel_sendenable (ssid, argv[0]->f, msg);
- ret = 0;
- }
- else if (!strncmp (path, "/select/eq_gain/", 16) && strlen (path) > 16) {
- int ssid = atoi (&path[16]);
- sel_eq_gain (ssid, argv[0]->f, msg);
- ret = 0;
- }
- else if (!strncmp (path, "/select/eq_freq/", 16) && strlen (path) > 16) {
- int ssid = atoi (&path[16]);
- sel_eq_freq (ssid, argv[0]->f , msg);
- ret = 0;
- }
- else if (!strncmp (path, "/select/eq_q/", 13) && strlen (path) > 13) {
- int ssid = atoi (&path[13]);
- sel_eq_q (ssid, argv[0]->f, msg);
- ret = 0;
- }
- else if (!strncmp (path, "/select/eq_shape/", 17) && strlen (path) > 17) {
- int ssid = atoi (&path[17]);
- sel_eq_shape (ssid, argv[0]->f, msg);
- ret = 0;
- }
+ } else
+ if (!strncmp (path, "/strip/gain/", 12) && strlen (path) > 12) {
+ // in dB
+ int ssid = atoi (&path[12]);
+ route_set_gain_dB (ssid, argv[0]->f, msg);
+ ret = 0;
+ }
+ else if (!strncmp (path, "/strip/fader/", 13) && strlen (path) > 13) {
+ // in fader position
+ int ssid = atoi (&path[13]);
+ route_set_gain_fader (ssid, argv[0]->f, msg);
+ ret = 0;
+ }
+ else if (!strncmp (path, "/strip/trimdB/", 14) && strlen (path) > 14) {
+ int ssid = atoi (&path[14]);
+ route_set_trim_dB (ssid, argv[0]->f, msg);
+ ret = 0;
+ }
+ else if (!strncmp (path, "/strip/pan_stereo_position/", 27) && strlen (path) > 27) {
+ int ssid = atoi (&path[27]);
+ route_set_pan_stereo_position (ssid, argv[0]->f, msg);
+ ret = 0;
+ }
+ else if (!strncmp (path, "/strip/mute/", 12) && strlen (path) > 12) {
+ int ssid = atoi (&path[12]);
+ route_mute (ssid, argv[0]->i, msg);
+ ret = 0;
+ }
+ else if (!strncmp (path, "/strip/solo/", 12) && strlen (path) > 12) {
+ int ssid = atoi (&path[12]);
+ route_solo (ssid, argv[0]->i, msg);
+ ret = 0;
+ }
+ else if (!strncmp (path, "/strip/monitor_input/", 21) && strlen (path) > 21) {
+ int ssid = atoi (&path[21]);
+ route_monitor_input (ssid, argv[0]->i, msg);
+ ret = 0;
+ }
+ else if (!strncmp (path, "/strip/monitor_disk/", 20) && strlen (path) > 20) {
+ int ssid = atoi (&path[20]);
+ route_monitor_disk (ssid, argv[0]->i, msg);
+ ret = 0;
+ }
+ else if (!strncmp (path, "/strip/recenable/", 17) && strlen (path) > 17) {
+ int ssid = atoi (&path[17]);
+ route_recenable (ssid, argv[0]->i, msg);
+ ret = 0;
+ }
+ else if (!strncmp (path, "/strip/record_safe/", 19) && strlen (path) > 19) {
+ int ssid = atoi (&path[19]);
+ route_recsafe (ssid, argv[0]->i, msg);
+ ret = 0;
+ }
+ else if (!strncmp (path, "/strip/expand/", 14) && strlen (path) > 14) {
+ int ssid = atoi (&path[14]);
+ strip_expand (ssid, argv[0]->i, msg);
+ ret = 0;
+ }
+ else if (!strncmp (path, "/strip/select/", 14) && strlen (path) > 14) {
+ int ssid = atoi (&path[14]);
+ strip_gui_select (ssid, argv[0]->i, msg);
+ ret = 0;
+ }
+ else if (!strncmp (path, "/select/send_gain/", 18) && strlen (path) > 18) {
+ int ssid = atoi (&path[18]);
+ sel_sendgain (ssid, argv[0]->f, msg);
+ ret = 0;
+ }
+ else if (!strncmp (path, "/select/send_fader/", 19) && strlen (path) > 19) {
+ int ssid = atoi (&path[19]);
+ sel_sendfader (ssid, argv[0]->f, msg);
+ ret = 0;
+ }
+ else if (!strncmp (path, "/select/send_enable/", 20) && strlen (path) > 20) {
+ int ssid = atoi (&path[20]);
+ sel_sendenable (ssid, argv[0]->f, msg);
+ ret = 0;
+ }
+ else if (!strncmp (path, "/select/eq_gain/", 16) && strlen (path) > 16) {
+ int ssid = atoi (&path[16]);
+ sel_eq_gain (ssid, argv[0]->f, msg);
+ ret = 0;
+ }
+ else if (!strncmp (path, "/select/eq_freq/", 16) && strlen (path) > 16) {
+ int ssid = atoi (&path[16]);
+ sel_eq_freq (ssid, argv[0]->f , msg);
+ ret = 0;
+ }
+ else if (!strncmp (path, "/select/eq_q/", 13) && strlen (path) > 13) {
+ int ssid = atoi (&path[13]);
+ sel_eq_q (ssid, argv[0]->f, msg);
+ ret = 0;
+ }
+ else if (!strncmp (path, "/select/eq_shape/", 17) && strlen (path) > 17) {
+ int ssid = atoi (&path[17]);
+ sel_eq_shape (ssid, argv[0]->f, msg);
+ ret = 0;
}
if ((ret && _debugmode == Unhandled)) {
debugmsg (_("Unhandled OSC message"), path, types, argv, argc);
+ } else if ((!ret && _debugmode != Unhandled)) {
+ debugmsg (_("OSC"), path, types, argv, argc);
}
return ret;