OSC: same fix for /select/*
[ardour.git] / libs / surfaces / osc / osc.cc
index e581876216115b414ad15053fe4fa4ba253317c8..9eee330949f0408e168ba035a8a9de72de55fa8c 100644 (file)
@@ -964,6 +964,10 @@ OSC::catchall (const char *path, const char* types, lo_arg **argv, int argc, lo_
 
                ret = 0;
        } else
+       if (strstr (path, "/strip") && (argc != 1)) {
+               // All of the strip commands below require 1 parameter
+               PBD::warning << "OSC: Wrong number of parameters." << endmsg;
+       } else
        if (!strncmp (path, "/strip/gain/", 12) && strlen (path) > 12) {
                // in dB
                int ssid = atoi (&path[12]);
@@ -1037,6 +1041,10 @@ OSC::catchall (const char *path, const char* types, lo_arg **argv, int argc, lo_
        else if (!strncmp (path, "/strip/select/", 14) && strlen (path) > 14) {
                int ssid = atoi (&path[14]);
                ret = strip_gui_select (ssid, argv[0]->i, msg);
+       } else
+       if (strstr (path, "/select") && (argc != 1)) {
+               // All of the select commands below require 1 parameter
+               PBD::warning << "OSC: Wrong number of parameters." << endmsg;
        }
        else if (!strncmp (path, "/select/send_gain/", 18) && strlen (path) > 18) {
                int ssid = atoi (&path[18]);
@@ -5096,24 +5104,34 @@ OSC::cue_parse (const char *path, const char* types, lo_arg **argv, int argc, lo
 
        if (!strncmp (path, "/cue/aux", 8)) {
                // set our Aux bus
-               ret = cue_set (argv[0]->f, msg);
+               if (argv[0]->f) {
+                       ret = cue_set (argv[0]->f, msg);
+               } else {
+                       ret = 0;
+               }
        }
        else if (!strncmp (path, "/cue/connect", 12)) {
                // Connect to default Aux bus
                if ((!argc) || argv[0]->f) {
                        ret = cue_set (1, msg);
+               } else {
+                       ret = 0;
                }
        }
        else if (!strncmp (path, "/cue/next_aux", 13)) {
                // switch to next Aux bus
                if ((!argc) || argv[0]->f) {
                        ret = cue_next (msg);
+               } else {
+                       ret = 0;
                }
        }
        else if (!strncmp (path, "/cue/previous_aux", 17)) {
                // switch to previous Aux bus
                if ((!argc) || argv[0]->f) {
                        ret = cue_previous (msg);
+               } else {
+                       ret = 0;
                }
        }
        else if (!strncmp (path, "/cue/send/fader/", 16) && strlen (path) > 16) {