OSC Accept int in first parameter in path commands as well as float.

This commit is contained in:
Len Ovens 2016-10-23 18:45:25 -07:00
parent 53e9337eba
commit dd015e09a7

View file

@ -886,108 +886,109 @@ OSC::catchall (const char *path, const char* types, lo_arg **argv, int argc, lo_
} }
ret = 0; ret = 0;
} else if (argc == 1 && types[0] == 'f') { // single float -- probably TouchOSC } else
if (!strncmp (path, "/strip/gain/", 12) && strlen (path) > 12) { if (!strncmp (path, "/strip/gain/", 12) && strlen (path) > 12) {
// in dB // in dB
int ssid = atoi (&path[12]); int ssid = atoi (&path[12]);
route_set_gain_dB (ssid, argv[0]->f, msg); route_set_gain_dB (ssid, argv[0]->f, msg);
ret = 0; ret = 0;
} }
else if (!strncmp (path, "/strip/fader/", 13) && strlen (path) > 13) { else if (!strncmp (path, "/strip/fader/", 13) && strlen (path) > 13) {
// in fader position // in fader position
int ssid = atoi (&path[13]); int ssid = atoi (&path[13]);
route_set_gain_fader (ssid, argv[0]->f, msg); route_set_gain_fader (ssid, argv[0]->f, msg);
ret = 0; ret = 0;
} }
else if (!strncmp (path, "/strip/trimdB/", 14) && strlen (path) > 14) { else if (!strncmp (path, "/strip/trimdB/", 14) && strlen (path) > 14) {
int ssid = atoi (&path[14]); int ssid = atoi (&path[14]);
route_set_trim_dB (ssid, argv[0]->f, msg); route_set_trim_dB (ssid, argv[0]->f, msg);
ret = 0; ret = 0;
} }
else if (!strncmp (path, "/strip/pan_stereo_position/", 27) && strlen (path) > 27) { else if (!strncmp (path, "/strip/pan_stereo_position/", 27) && strlen (path) > 27) {
int ssid = atoi (&path[27]); int ssid = atoi (&path[27]);
route_set_pan_stereo_position (ssid, argv[0]->f, msg); route_set_pan_stereo_position (ssid, argv[0]->f, msg);
ret = 0; ret = 0;
} }
else if (!strncmp (path, "/strip/mute/", 12) && strlen (path) > 12) { else if (!strncmp (path, "/strip/mute/", 12) && strlen (path) > 12) {
int ssid = atoi (&path[12]); int ssid = atoi (&path[12]);
route_mute (ssid, argv[0]->f == 1.0, msg); route_mute (ssid, argv[0]->i, msg);
ret = 0; ret = 0;
} }
else if (!strncmp (path, "/strip/solo/", 12) && strlen (path) > 12) { else if (!strncmp (path, "/strip/solo/", 12) && strlen (path) > 12) {
int ssid = atoi (&path[12]); int ssid = atoi (&path[12]);
route_solo (ssid, argv[0]->f == 1.0, msg); route_solo (ssid, argv[0]->i, msg);
ret = 0; ret = 0;
} }
else if (!strncmp (path, "/strip/monitor_input/", 21) && strlen (path) > 21) { else if (!strncmp (path, "/strip/monitor_input/", 21) && strlen (path) > 21) {
int ssid = atoi (&path[21]); int ssid = atoi (&path[21]);
route_monitor_input (ssid, argv[0]->f == 1.0, msg); route_monitor_input (ssid, argv[0]->i, msg);
ret = 0; ret = 0;
} }
else if (!strncmp (path, "/strip/monitor_disk/", 20) && strlen (path) > 20) { else if (!strncmp (path, "/strip/monitor_disk/", 20) && strlen (path) > 20) {
int ssid = atoi (&path[20]); int ssid = atoi (&path[20]);
route_monitor_disk (ssid, argv[0]->f == 1.0, msg); route_monitor_disk (ssid, argv[0]->i, msg);
ret = 0; ret = 0;
} }
else if (!strncmp (path, "/strip/recenable/", 17) && strlen (path) > 17) { else if (!strncmp (path, "/strip/recenable/", 17) && strlen (path) > 17) {
int ssid = atoi (&path[17]); int ssid = atoi (&path[17]);
route_recenable (ssid, argv[0]->f == 1.0, msg); route_recenable (ssid, argv[0]->i, msg);
ret = 0; ret = 0;
} }
else if (!strncmp (path, "/strip/record_safe/", 19) && strlen (path) > 19) { else if (!strncmp (path, "/strip/record_safe/", 19) && strlen (path) > 19) {
int ssid = atoi (&path[19]); int ssid = atoi (&path[19]);
route_recsafe (ssid, argv[0]->f == 1.0, msg); route_recsafe (ssid, argv[0]->i, msg);
ret = 0; ret = 0;
} }
else if (!strncmp (path, "/strip/expand/", 14) && strlen (path) > 14) { else if (!strncmp (path, "/strip/expand/", 14) && strlen (path) > 14) {
int ssid = atoi (&path[14]); int ssid = atoi (&path[14]);
strip_expand (ssid, argv[0]->f == 1.0, msg); strip_expand (ssid, argv[0]->i, msg);
ret = 0; ret = 0;
} }
else if (!strncmp (path, "/strip/select/", 14) && strlen (path) > 14) { else if (!strncmp (path, "/strip/select/", 14) && strlen (path) > 14) {
int ssid = atoi (&path[14]); int ssid = atoi (&path[14]);
strip_gui_select (ssid, argv[0]->f == 1.0, msg); strip_gui_select (ssid, argv[0]->i, msg);
ret = 0; ret = 0;
} }
else if (!strncmp (path, "/select/send_gain/", 18) && strlen (path) > 18) { else if (!strncmp (path, "/select/send_gain/", 18) && strlen (path) > 18) {
int ssid = atoi (&path[18]); int ssid = atoi (&path[18]);
sel_sendgain (ssid, argv[0]->f, msg); sel_sendgain (ssid, argv[0]->f, msg);
ret = 0; ret = 0;
} }
else if (!strncmp (path, "/select/send_fader/", 19) && strlen (path) > 19) { else if (!strncmp (path, "/select/send_fader/", 19) && strlen (path) > 19) {
int ssid = atoi (&path[19]); int ssid = atoi (&path[19]);
sel_sendfader (ssid, argv[0]->f, msg); sel_sendfader (ssid, argv[0]->f, msg);
ret = 0; ret = 0;
} }
else if (!strncmp (path, "/select/send_enable/", 20) && strlen (path) > 20) { else if (!strncmp (path, "/select/send_enable/", 20) && strlen (path) > 20) {
int ssid = atoi (&path[20]); int ssid = atoi (&path[20]);
sel_sendenable (ssid, argv[0]->f, msg); sel_sendenable (ssid, argv[0]->f, msg);
ret = 0; ret = 0;
} }
else if (!strncmp (path, "/select/eq_gain/", 16) && strlen (path) > 16) { else if (!strncmp (path, "/select/eq_gain/", 16) && strlen (path) > 16) {
int ssid = atoi (&path[16]); int ssid = atoi (&path[16]);
sel_eq_gain (ssid, argv[0]->f, msg); sel_eq_gain (ssid, argv[0]->f, msg);
ret = 0; ret = 0;
} }
else if (!strncmp (path, "/select/eq_freq/", 16) && strlen (path) > 16) { else if (!strncmp (path, "/select/eq_freq/", 16) && strlen (path) > 16) {
int ssid = atoi (&path[16]); int ssid = atoi (&path[16]);
sel_eq_freq (ssid, argv[0]->f , msg); sel_eq_freq (ssid, argv[0]->f , msg);
ret = 0; ret = 0;
} }
else if (!strncmp (path, "/select/eq_q/", 13) && strlen (path) > 13) { else if (!strncmp (path, "/select/eq_q/", 13) && strlen (path) > 13) {
int ssid = atoi (&path[13]); int ssid = atoi (&path[13]);
sel_eq_q (ssid, argv[0]->f, msg); sel_eq_q (ssid, argv[0]->f, msg);
ret = 0; ret = 0;
} }
else if (!strncmp (path, "/select/eq_shape/", 17) && strlen (path) > 17) { else if (!strncmp (path, "/select/eq_shape/", 17) && strlen (path) > 17) {
int ssid = atoi (&path[17]); int ssid = atoi (&path[17]);
sel_eq_shape (ssid, argv[0]->f, msg); sel_eq_shape (ssid, argv[0]->f, msg);
ret = 0; ret = 0;
}
} }
if ((ret && _debugmode == Unhandled)) { if ((ret && _debugmode == Unhandled)) {
debugmsg (_("Unhandled OSC message"), path, types, argv, argc); debugmsg (_("Unhandled OSC message"), path, types, argv, argc);
} else if ((!ret && _debugmode != Unhandled)) {
debugmsg (_("OSC"), path, types, argv, argc);
} }
return ret; return ret;