OSC: Further fixes so multiple controls can touch at once.
[ardour.git] / libs / surfaces / osc / osc.cc
index 3f5721b0d38809989408db95aa71aba920d594c6..70b02a7501c324e83cd3f053283c434bfd0591ef 100644 (file)
@@ -100,6 +100,7 @@ OSC::OSC (Session& s, uint32_t port)
        , default_gainmode (0)
        , tick (true)
        , bank_dirty (false)
+       , scrub_speed (0)
        , gui (0)
 {
        _instance = this;
@@ -244,9 +245,6 @@ OSC::start ()
        periodic_connection = periodic_timeout->connect (sigc::mem_fun (*this, &OSC::periodic));
        periodic_timeout->attach (main_loop()->get_context());
 
-       // catch changes to selection for GUI_select mode
-       StripableSelectionChanged.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&OSC::gui_selection_changed, this), this);
-
        // catch track reordering
        // receive routes added
        session->RouteAdded.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&OSC::notify_routes_added, this, _1), this);
@@ -421,6 +419,9 @@ OSC::register_callbacks()
                REGISTER_CALLBACK (serv, "/goto_start", "f", goto_start);
                REGISTER_CALLBACK (serv, "/goto_end", "", goto_end);
                REGISTER_CALLBACK (serv, "/goto_end", "f", goto_end);
+               REGISTER_CALLBACK (serv, "/scrub", "f", scrub);
+               REGISTER_CALLBACK (serv, "/jog", "f", jog);
+               REGISTER_CALLBACK (serv, "/jog/mode", "f", jog_mode);
                REGISTER_CALLBACK (serv, "/rewind", "", rewind);
                REGISTER_CALLBACK (serv, "/rewind", "f", rewind);
                REGISTER_CALLBACK (serv, "/ffwd", "", ffwd);
@@ -478,7 +479,6 @@ OSC::register_callbacks()
                REGISTER_CALLBACK (serv, "/set_loop_range", "f", set_loop_range);
                REGISTER_CALLBACK (serv, "/set_session_range", "", set_session_range);
                REGISTER_CALLBACK (serv, "/set_session_range", "f", set_session_range);
-               // /toggle_monitor_* not working (comented out)
                REGISTER_CALLBACK (serv, "/toggle_monitor_mute", "", toggle_monitor_mute);
                REGISTER_CALLBACK (serv, "/toggle_monitor_mute", "f", toggle_monitor_mute);
                REGISTER_CALLBACK (serv, "/toggle_monitor_dim", "", toggle_monitor_dim);
@@ -542,6 +542,9 @@ OSC::register_callbacks()
                REGISTER_CALLBACK (serv, "/master/pan_stereo_position", "f", master_set_pan_stereo_position);
                REGISTER_CALLBACK (serv, "/monitor/gain", "f", monitor_set_gain);
                REGISTER_CALLBACK (serv, "/monitor/fader", "f", monitor_set_fader);
+               REGISTER_CALLBACK (serv, "/monitor/mute", "i", monitor_set_mute);
+               REGISTER_CALLBACK (serv, "/monitor/dim", "i", monitor_set_dim);
+               REGISTER_CALLBACK (serv, "/monitor/mono", "i", monitor_set_mono);
 
                // Controls for the Selected strip
                REGISTER_CALLBACK (serv, "/select/recenable", "i", sel_recenable);
@@ -700,7 +703,7 @@ OSC::listen_to_route (boost::shared_ptr<Stripable> strip, lo_address addr)
 
        OSCSurface *s = get_surface(addr);
        uint32_t ssid = get_sid (strip, addr);
-       OSCRouteObserver* o = new OSCRouteObserver (strip, addr, ssid, s->gainmode, s->feedback);
+       OSCRouteObserver* o = new OSCRouteObserver (strip, addr, ssid, s);
        route_observers.push_back (o);
 
        strip->DropReferences.connect (*this, MISSING_INVALIDATOR, boost::bind (&OSC::route_lost, this, boost::weak_ptr<Stripable> (strip)), this);
@@ -856,6 +859,14 @@ OSC::catchall (const char *path, const char* types, lo_arg **argv, int argc, lo_
 
        len = strlen (path);
 
+       if (strstr (path, "/automation")) {
+               ret = set_automation (path, argv, argc, msg);
+
+       } else
+       if (strstr (path, "/touch")) {
+               ret = touch_detect (path, argv, argc, msg);
+
+       } else
        if (len >= 17 && !strcmp (&path[len-15], "/#current_value")) {
                current_value_query (path, len, argv, argc, msg);
                ret = 0;
@@ -863,21 +874,21 @@ OSC::catchall (const char *path, const char* types, lo_arg **argv, int argc, lo_
        } else
        if (!strncmp (path, "/cue/", 5)) {
 
-               cue_parse (path, types, argv, argc, msg);
+               ret = cue_parse (path, types, argv, argc, msg);
 
-               ret = 0;
        } else
        if (!strncmp (path, "/access_action/", 15)) {
+               check_surface (msg);
                if (!(argc && !argv[0]->i)) {
                        std::string action_path = path;
 
                        access_action (action_path.substr(15));
-                       std::cout << "access_action path = " << action_path.substr(15) << "\n";
                }
 
                ret = 0;
        } else
        if (strcmp (path, "/strip/listen") == 0) {
+               check_surface (msg);
 
                cerr << "set up listener\n";
 
@@ -909,6 +920,7 @@ OSC::catchall (const char *path, const char* types, lo_arg **argv, int argc, lo_
 
        } else
        if (strcmp (path, "/strip/ignore") == 0) {
+               check_surface (msg);
 
                for (int n = 0; n < argc; ++n) {
 
@@ -924,99 +936,83 @@ OSC::catchall (const char *path, const char* types, lo_arg **argv, int argc, lo_
        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;
+               ret = route_set_gain_dB (ssid, argv[0]->f, msg);
        }
        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;
+               ret = route_set_gain_fader (ssid, argv[0]->f, msg);
        }
        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;
+               ret = route_set_trim_dB (ssid, argv[0]->f, msg);
        }
        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;
+               ret = route_set_pan_stereo_position (ssid, argv[0]->f, msg);
        }
        else if (!strncmp (path, "/strip/mute/", 12) && strlen (path) > 12) {
                int ssid = atoi (&path[12]);
-               route_mute (ssid, argv[0]->i, msg);
-               ret = 0;
+               ret = route_mute (ssid, argv[0]->i, msg);
        }
        else if (!strncmp (path, "/strip/solo/", 12) && strlen (path) > 12) {
                int ssid = atoi (&path[12]);
-               route_solo (ssid, argv[0]->i, msg);
-               ret = 0;
+               ret = route_solo (ssid, argv[0]->i, msg);
        }
        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;
+               ret = route_monitor_input (ssid, argv[0]->i, msg);
        }
        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;
+               ret = route_monitor_disk (ssid, argv[0]->i, msg);
        }
        else if (!strncmp (path, "/strip/recenable/", 17) && strlen (path) > 17) {
                int ssid = atoi (&path[17]);
-               route_recenable (ssid, argv[0]->i, msg);
-               ret = 0;
+               ret = route_recenable (ssid, argv[0]->i, msg);
        }
        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;
+               ret = route_recsafe (ssid, argv[0]->i, msg);
        }
        else if (!strncmp (path, "/strip/expand/", 14) && strlen (path) > 14) {
                int ssid = atoi (&path[14]);
-               strip_expand (ssid, argv[0]->i, msg);
-               ret = 0;
+               ret = strip_expand (ssid, argv[0]->i, msg);
        }
        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;
+               ret = strip_gui_select (ssid, argv[0]->i, msg);
        }
        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;
+               ret = sel_sendgain (ssid, argv[0]->f, msg);
        }
        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;
+               ret = sel_sendfader (ssid, argv[0]->f, msg);
        }
        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;
+               ret = sel_sendenable (ssid, argv[0]->f, msg);
        }
        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;
+               ret = sel_eq_gain (ssid, argv[0]->f, msg);
        }
        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;
+               ret = sel_eq_freq (ssid, argv[0]->f , msg);
        }
        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;
+               ret = sel_eq_q (ssid, argv[0]->f, msg);
        }
        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;
+               ret = sel_eq_shape (ssid, argv[0]->f, msg);
+       }
+       if (ret) {
+               check_surface (msg);
        }
 
        if ((ret && _debugmode != Off)) {
@@ -1172,41 +1168,65 @@ OSC::routes_list (lo_message msg)
        if (!session) {
                return;
        }
-       for (int n = 0; n < (int) session->nroutes(); ++n) {
+       OSCSurface *sur = get_surface(get_address (msg));
+       sur->no_clear = true;
 
-               boost::shared_ptr<Route> r = session->get_remote_nth_route (n);
+       for (int n = 0; n < (int) sur->nstrips; ++n) {
 
-               if (r) {
+               boost::shared_ptr<Stripable> s = get_strip (n + 1, get_address (msg));
+
+               if (s) {
+                       // some things need the route
+                       boost::shared_ptr<Route> r = boost::dynamic_pointer_cast<Route> (s);
 
                        lo_message reply = lo_message_new ();
 
-                       if (boost::dynamic_pointer_cast<AudioTrack>(r)) {
+                       if (s->presentation_info().flags() & PresentationInfo::AudioTrack) {
                                lo_message_add_string (reply, "AT");
-                       } else if (boost::dynamic_pointer_cast<MidiTrack>(r)) {
+                       } else if (s->presentation_info().flags() & PresentationInfo::MidiTrack) {
                                lo_message_add_string (reply, "MT");
-                       } else {
-                               lo_message_add_string (reply, "B");
+                       } else if (s->presentation_info().flags() & PresentationInfo::AudioBus) {
+                               // r->feeds (session->master_out()) may make more sense
+                               if (r->direct_feeds_according_to_reality (session->master_out())) {
+                                       // this is a bus
+                                       lo_message_add_string (reply, "B");
+                               } else {
+                                       // this is an Aux out
+                                       lo_message_add_string (reply, "AX");
+                               }
+                       } else if (s->presentation_info().flags() & PresentationInfo::MidiBus) {
+                               lo_message_add_string (reply, "MB");
+                       } else if (s->presentation_info().flags() & PresentationInfo::VCA) {
+                               lo_message_add_string (reply, "V");
                        }
 
-                       lo_message_add_string (reply, r->name().c_str());
-                       lo_message_add_int32 (reply, r->n_inputs().n_audio());
-                       lo_message_add_int32 (reply, r->n_outputs().n_audio());
-                       lo_message_add_int32 (reply, r->muted());
-                       lo_message_add_int32 (reply, r->soloed());
-                       /* XXX Can only use order at this point */
-                       //lo_message_add_int32 (reply, r->presentation_info().order());
-                       // try this instead.
-                       lo_message_add_int32 (reply, get_sid (r, get_address (msg)));
-
-                       if (boost::dynamic_pointer_cast<AudioTrack>(r)
-                                       || boost::dynamic_pointer_cast<MidiTrack>(r)) {
-
-                               boost::shared_ptr<Track> t = boost::dynamic_pointer_cast<Track>(r);
-                               lo_message_add_int32 (reply, (int32_t) t->rec_enable_control()->get_value());
+                       lo_message_add_string (reply, s->name().c_str());
+                       if (r) {
+                               // routes have inputs and outputs
+                               lo_message_add_int32 (reply, r->n_inputs().n_audio());
+                               lo_message_add_int32 (reply, r->n_outputs().n_audio());
+                       } else {
+                               // non-routes like VCAs don't
+                               lo_message_add_int32 (reply, 0);
+                               lo_message_add_int32 (reply, 0);
+                       }
+                       if (s->mute_control()) {
+                               lo_message_add_int32 (reply, s->mute_control()->get_value());
+                       } else {
+                               lo_message_add_int32 (reply, 0);
+                       }
+                       if (s->solo_control()) {
+                               lo_message_add_int32 (reply, s->solo_control()->get_value());
+                       } else {
+                               lo_message_add_int32 (reply, 0);
+                       }
+                       lo_message_add_int32 (reply, n + 1);
+                       if (s->rec_enable_control()) {
+                               lo_message_add_int32 (reply, s->rec_enable_control()->get_value());
                        }
 
-                       //Automatically listen to routes listed
-                       listen_to_route(r, get_address (msg));
+                       //Automatically listen to stripables listed
+                       listen_to_route(s, get_address (msg));
 
                        lo_send_message (get_address (msg), "#reply", reply);
                        lo_message_free (reply);
@@ -1219,6 +1239,12 @@ OSC::routes_list (lo_message msg)
        lo_message_add_string (reply, "end_route_list");
        lo_message_add_int64 (reply, session->frame_rate());
        lo_message_add_int64 (reply, session->current_end_frame());
+       if (session->monitor_out()) {
+               // this session has a monitor section
+               lo_message_add_int32 (reply, 1);
+       } else {
+               lo_message_add_int32 (reply, 0);
+       }
 
        lo_send_message (get_address (msg), "#reply", reply);
 
@@ -1250,6 +1276,7 @@ OSC::refresh_surface (lo_message msg)
 {
        if (address_only) {
                // get rid of all surfaces and observers.
+               // needs change to only clear those for this address on all ports
                clear_devices();
        }
        OSCSurface *s = get_surface(get_address (msg));
@@ -1294,6 +1321,17 @@ OSC::clear_devices ()
                        delete so;
                }
        }
+       // delete cue observers
+       for (CueObservers::iterator x = cue_observers.begin(); x != cue_observers.end();) {
+               OSCCueObserver* co;
+               if ((co = dynamic_cast<OSCCueObserver*>(*x)) != 0) {
+                       delete *x;
+                       x = cue_observers.erase (x);
+               } else {
+                       ++x;
+               }
+       }
+
        // clear out surfaces
        _surface.clear();
 }
@@ -1365,11 +1403,27 @@ OSC::set_surface_gainmode (uint32_t gm, lo_message msg)
        return 0;
 }
 
+int
+OSC::check_surface (lo_message msg)
+{
+       if (!session) {
+               return -1;
+       }
+       get_surface(get_address (msg));
+       return 0;
+}
+
 OSC::OSCSurface *
 OSC::get_surface (lo_address addr)
 {
        string r_url;
        char * rurl;
+       if (address_only) {
+               string host = lo_address_get_hostname (addr);
+               int protocol = lo_address_get_protocol (addr);
+               addr = lo_address_new_with_proto (protocol, host.c_str(), remote_port.c_str());
+       }
+
        rurl = lo_address_get_url (addr);
        r_url = rurl;
        free (rurl);
@@ -1388,6 +1442,8 @@ OSC::get_surface (lo_address addr)
        // No surface create one with default values
        OSCSurface s;
        s.remote_url = r_url;
+       s.no_clear = false;
+       s.jogmode = JOG;
        s.bank = 1;
        s.bank_size = default_banksize; // need to find out how many strips there are
        s.strip_types = default_strip; // 159 is tracks, busses, and VCAs (no master/monitor)
@@ -1397,11 +1453,18 @@ OSC::get_surface (lo_address addr)
        s.expand = 0;
        s.expand_enable = false;
        s.cue = false;
+       s.aux = 0;
        s.strips = get_sorted_stripables(s.strip_types, s.cue);
 
        s.nstrips = s.strips.size();
        _surface.push_back (s);
 
+       // set bank and strip feedback
+       _set_bank(s.bank, addr);
+
+       // Set global/master feedback
+       global_feedback (s.feedback, addr, s.gainmode);
+
        return &_surface[_surface.size() - 1];
 }
 
@@ -1474,6 +1537,13 @@ OSC::_recalcbanks ()
                } else {
                        _set_bank (sur->bank, addr);
                }
+               if (sur->no_clear) {
+                       // This surface uses /strip/list tell it routes have changed
+                       lo_message reply;
+                       reply = lo_message_new ();
+                       lo_send_message (addr, "/strip/list", reply);
+                       lo_message_free (reply);
+               }
        }
 }
 
@@ -1544,7 +1614,7 @@ OSC::_set_bank (uint32_t bank_start, lo_address addr)
                // top bank is always filled if there are enough strips for at least one bank
                bank_start = (uint32_t)((s->nstrips - b_size) + 1);
        }
-       //save bank in case we have had to change it
+       //save bank after bank limit checks
        s->bank = bank_start;
 
        if (s->feedback[0] || s->feedback[1]) {
@@ -1562,8 +1632,7 @@ OSC::_set_bank (uint32_t bank_start, lo_address addr)
                }
        }
        // light bankup or bankdown buttons if it is possible to bank in that direction
-       if (s->feedback[4]) {
-               // these two messages could be bundled
+       if (s->feedback[4] && !s->no_clear) {
                lo_message reply;
                reply = lo_message_new ();
                if ((s->bank > (s->nstrips - s->bank_size)) || (s->nstrips < s->bank_size)) {
@@ -1658,6 +1727,7 @@ OSC::transport_frame (lo_message msg)
        if (!session) {
                return;
        }
+       check_surface (msg);
        framepos_t pos = session->transport_frame ();
 
        lo_message reply = lo_message_new ();
@@ -1674,6 +1744,7 @@ OSC::transport_speed (lo_message msg)
        if (!session) {
                return;
        }
+       check_surface (msg);
        double ts = session->transport_speed ();
 
        lo_message reply = lo_message_new ();
@@ -1690,6 +1761,7 @@ OSC::record_enabled (lo_message msg)
        if (!session) {
                return;
        }
+       check_surface (msg);
        int re = (int)session->get_record_enabled ();
 
        lo_message reply = lo_message_new ();
@@ -1700,6 +1772,177 @@ OSC::record_enabled (lo_message msg)
        lo_message_free (reply);
 }
 
+int
+OSC::scrub (float delta, lo_message msg)
+{
+       if (!session) return -1;
+       check_surface (msg);
+
+       scrub_place = session->transport_frame ();
+
+       float speed;
+
+       int64_t now = ARDOUR::get_microseconds ();
+       int64_t diff = now - scrub_time;
+       if (diff > 35000) {
+               // speed 1 (or 0 if jog wheel supports touch)
+               speed = delta;
+       } else if ((diff > 20000) && (fabs(scrub_speed) == 1)) {
+               // add some hysteresis to stop excess speed jumps
+               speed = delta;
+       } else {
+               speed = (int)(delta * 2);
+       }
+       scrub_time = now;
+       if (scrub_speed == speed) {
+               // Already at that speed no change
+               return 0;
+       }
+       scrub_speed = speed;
+
+       if (speed > 0) {
+               if (speed == 1) {
+                       session->request_transport_speed (.5);
+               } else {
+                       session->request_transport_speed (1);
+               }
+       } else if (speed < 0) {
+               if (speed == -1) {
+                       session->request_transport_speed (-.5);
+               } else {
+                       session->request_transport_speed (-1);
+               }
+       } else {
+               session->request_transport_speed (0);
+       }
+
+       return 0;
+}
+
+int
+OSC::jog (float delta, lo_message msg)
+{
+       if (!session) return -1;
+
+       OSCSurface *s = get_surface(get_address (msg));
+
+       string path = "/jog/mode/name";
+       switch(s->jogmode)
+       {
+               case JOG  :
+                       text_message (path, "Jog", get_address (msg));
+                       if (delta) {
+                               jump_by_seconds (delta / 5);
+                       }
+                       break;
+               case SCRUB:
+                       text_message (path, "Scrub", get_address (msg));
+                       scrub (delta, msg);
+                       break;
+               case SHUTTLE:
+                       text_message (path, "Shuttle", get_address (msg));
+                       if (delta) {
+                               double speed = get_transport_speed ();
+                               set_transport_speed (speed + (delta / 8));
+                       } else {
+                               set_transport_speed (0);
+                       }
+                       break;
+               case SCROLL:
+                       text_message (path, "Scroll", get_address (msg));
+                       if (delta > 0) {
+                               access_action ("Editor/scroll-forward");
+                       } else if (delta < 0) {
+                               access_action ("Editor/scroll-backward");
+                       }
+                       break;
+               case TRACK:
+                       text_message (path, "Track", get_address (msg));
+                       if (delta > 0) {
+                               set_bank (s->bank + 1, msg);
+                       } else if (delta < 0) {
+                               set_bank (s->bank - 1, msg);
+                       }
+                       break;
+               case BANK:
+                       text_message (path, "Bank", get_address (msg));
+                       if (delta > 0) {
+                               bank_up (msg);
+                       } else if (delta < 0) {
+                               bank_down (msg);
+                       }
+                       break;
+               case NUDGE:
+                       text_message (path, "Nudge", get_address (msg));
+                       if (delta > 0) {
+                               access_action ("Common/nudge-playhead-forward");
+                       } else if (delta < 0) {
+                               access_action ("Common/nudge-playhead-backward");
+                       }
+                       break;
+               case MARKER:
+                       text_message (path, "Marker", get_address (msg));
+                       if (delta > 0) {
+                               next_marker ();
+                       } else if (delta < 0) {
+                               prev_marker ();
+                       }
+                       break;
+               default:
+                       break;
+
+       }
+       return 0;
+
+}
+
+int
+OSC::jog_mode (float mode, lo_message msg)
+{
+       if (!session) return -1;
+
+       OSCSurface *s = get_surface(get_address (msg));
+
+       switch((uint32_t)mode)
+       {
+               case JOG  :
+                       s->jogmode = JOG;
+                       break;
+               case SCRUB:
+                       s->jogmode = SCRUB;
+                       break;
+               case SHUTTLE:
+                       s->jogmode = SHUTTLE;
+                       break;
+               case SCROLL:
+                       s->jogmode = SCROLL;
+                       break;
+               case TRACK:
+                       s->jogmode = TRACK;
+                       break;
+               case BANK:
+                       s->jogmode = BANK;
+                       break;
+               case NUDGE:
+                       s->jogmode = NUDGE;
+                       break;
+               case MARKER:
+                       s->jogmode = MARKER;
+                       break;
+               default:
+                       PBD::warning << "Jog Mode: " << mode << " is not valid." << endmsg;
+                       break;
+       lo_message reply = lo_message_new ();
+       lo_message_add_int32 (reply, s->jogmode);
+       lo_send_message (get_address(msg), "/jog/mode", reply);
+       lo_message_free (reply);
+
+       }
+       jog (0, msg);
+       return 0;
+
+}
+
 // master and monitor calls
 int
 OSC::master_set_gain (float dB)
@@ -1744,6 +1987,7 @@ int
 OSC::master_set_pan_stereo_position (float position, lo_message msg)
 {
        if (!session) return -1;
+       OSCSurface *sur = get_surface(get_address (msg));
 
        float endposition = .5;
        boost::shared_ptr<Stripable> s = session->master_out();
@@ -1754,7 +1998,6 @@ OSC::master_set_pan_stereo_position (float position, lo_message msg)
                        endposition = s->pan_azimuth_control()->internal_to_interface (s->pan_azimuth_control()->get_value ());
                }
        }
-       OSCSurface *sur = get_surface(get_address (msg));
 
        if (sur->feedback[4]) {
                lo_message reply = lo_message_new ();
@@ -1808,6 +2051,42 @@ OSC::monitor_set_fader (float position)
        return 0;
 }
 
+int
+OSC::monitor_set_mute (uint32_t state)
+{
+       if (!session) return -1;
+
+       if (session->monitor_out()) {
+               boost::shared_ptr<MonitorProcessor> mon = session->monitor_out()->monitor_control();
+               mon->set_cut_all (state);
+       }
+       return 0;
+}
+
+int
+OSC::monitor_set_dim (uint32_t state)
+{
+       if (!session) return -1;
+
+       if (session->monitor_out()) {
+               boost::shared_ptr<MonitorProcessor> mon = session->monitor_out()->monitor_control();
+               mon->set_dim_all (state);
+       }
+       return 0;
+}
+
+int
+OSC::monitor_set_mono (uint32_t state)
+{
+       if (!session) return -1;
+
+       if (session->monitor_out()) {
+               boost::shared_ptr<MonitorProcessor> mon = session->monitor_out()->monitor_control();
+               mon->set_mono (state);
+       }
+       return 0;
+}
+
 int
 OSC::route_get_sends(lo_message msg) {
        if (!session) {
@@ -1849,7 +2128,8 @@ OSC::route_get_sends(lo_message msg) {
                        lo_message_add_int32(reply, p->active() ? 1 : 0);
                }
        }
-       // if used dedicated message path to identify this reply in async operation. Naming it #reply wont help the client to identify the content.
+       // if used dedicated message path to identify this reply in async operation.
+       // Naming it #reply wont help the client to identify the content.
        lo_send_message(get_address (msg), "/strip/sends", reply);
 
        lo_message_free(reply);
@@ -1911,13 +2191,182 @@ OSC::route_get_receives(lo_message msg) {
                }
        }
 
-       // I have used a dedicated message path to identify this reply in async operation. Naming it #reply wont help the client to identify the content.
+       // I have used a dedicated message path to identify this reply in async operation.
+       // Naming it #reply wont help the client to identify the content.
        lo_send_message(get_address (msg), "/strip/receives", reply);
        lo_message_free(reply);
        return 0;
 }
 
 // strip calls
+
+int
+OSC::set_automation (const char *path, lo_arg **argv, int argc, lo_message msg)
+{
+       if (!session) return -1;
+
+       int ret = 1;
+       OSCSurface *sur = get_surface(get_address (msg));
+       boost::shared_ptr<Stripable> strp = boost::shared_ptr<Stripable>();
+       uint32_t ctr = 0;
+       uint32_t aut = 0;
+
+       if (argc) {
+               if (argv[argc - 1]->f) {
+                       aut = (int)argv[argc - 1]->f;
+               } else {
+                       aut = argv[argc - 1]->i;
+               }
+       }
+
+       //parse path first to find stripable
+       if (!strncmp (path, "/strip/", 7)) {
+               // find ssid and stripable
+               if (argc > 1) {
+                       strp = get_strip (argv[0]->i, get_address (msg));
+               } else {
+                       uint32_t ssid = atoi (&(strrchr (path, '/' ))[1]);
+                       strp = get_strip (ssid, get_address (msg));
+               }
+               ctr = 7;
+       } else if (!strncmp (path, "/select/", 8)) {
+               if (sur->expand_enable && sur->expand) {
+                       strp = get_strip (sur->expand, get_address (msg));
+               } else {
+                       strp = ControlProtocol::first_selected_stripable();
+               }
+               ctr = 8;
+       } else {
+               return ret;
+       }
+       if (strp) {
+               boost::shared_ptr<AutomationControl> control = boost::shared_ptr<AutomationControl>();
+               // other automatable controls can be added by repeating the next 6.5 lines
+               if ((!strncmp (&path[ctr], "fader", 5)) || (!strncmp (&path[ctr], "gain", 4))) {
+                       if (strp->gain_control ()) {
+                               control = strp->gain_control ();
+                       } else {
+                               PBD::warning << "No fader for this strip" << endmsg;
+                       }
+               } else {
+                       PBD::warning << "Automation not available for " << path << endmsg;
+               }
+
+               if (control) {
+
+                       switch (aut) {
+                               case 0:
+                                       control->set_automation_state (ARDOUR::Off);
+                                       ret = 0;
+                                       break;
+                               case 1:
+                                       control->set_automation_state (ARDOUR::Play);
+                                       ret = 0;
+                                       break;
+                               case 2:
+                                       control->set_automation_state (ARDOUR::Write);
+                                       ret = 0;
+                                       break;
+                               case 3:
+                                       control->set_automation_state (ARDOUR::Touch);
+                                       ret = 0;
+                                       break;
+                               default:
+                                       break;
+                       }
+               }
+       }
+
+       return ret;
+}
+
+int
+OSC::touch_detect (const char *path, lo_arg **argv, int argc, lo_message msg)
+{
+       if (!session) return -1;
+
+       int ret = 1;
+       OSCSurface *sur = get_surface(get_address (msg));
+       boost::shared_ptr<Stripable> strp = boost::shared_ptr<Stripable>();
+       uint32_t ctr = 0;
+       uint32_t touch = 0;
+
+       if (argc) {
+               if (argv[argc - 1]->f) {
+                       touch = (int)argv[argc - 1]->f;
+               } else {
+                       touch = argv[argc - 1]->i;
+               }
+       }
+
+       //parse path first to find stripable
+       if (!strncmp (path, "/strip/", 7)) {
+               // find ssid and stripable
+               if (argc > 1) {
+                       strp = get_strip (argv[0]->i, get_address (msg));
+               } else {
+                       uint32_t ssid = atoi (&(strrchr (path, '/' ))[1]);
+                       strp = get_strip (ssid, get_address (msg));
+               }
+               ctr = 7;
+       } else if (!strncmp (path, "/select/", 8)) {
+               if (sur->expand_enable && sur->expand) {
+                       strp = get_strip (sur->expand, get_address (msg));
+               } else {
+                       strp = ControlProtocol::first_selected_stripable();
+               }
+               ctr = 8;
+       } else {
+               return ret;
+       }
+       if (strp) {
+               boost::shared_ptr<AutomationControl> control = boost::shared_ptr<AutomationControl>();
+               // other automatable controls can be added by repeating the next 6.5 lines
+               if ((!strncmp (&path[ctr], "fader", 5)) || (!strncmp (&path[ctr], "gain", 4))) {
+                       if (strp->gain_control ()) {
+                               control = strp->gain_control ();
+                       } else {
+                               PBD::warning << "No fader for this strip" << endmsg;
+                       }
+               } else {
+                       PBD::warning << "Automation not available for " << path << endmsg;
+               }
+
+               if (control) {
+                       if (touch) {
+                               //start touch
+                               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
+                       FakeTouchMap::iterator x = _touch_timeout.find(control);
+                       if (x != _touch_timeout.end()) {
+                               _touch_timeout.erase (x);
+                       }
+               }
+       }
+
+       return ret;
+}
+
+int
+OSC::fake_touch (boost::shared_ptr<ARDOUR::AutomationControl> ctrl)
+{
+       if (ctrl) {
+               //start touch
+               if (ctrl->automation_state() == Touch && !ctrl->touching ()) {
+               ctrl->start_touch (ctrl->session().transport_frame());
+               _touch_timeout[ctrl] = 10;
+               }
+       }
+
+       return 0;
+}
+
 int
 OSC::route_mute (int ssid, int yn, lo_message msg)
 {
@@ -2403,6 +2852,7 @@ OSC::route_set_gain_abs (int ssid, float level, lo_message msg)
 
        if (s) {
                if (s->gain_control()) {
+                       fake_touch (s->gain_control());
                        s->gain_control()->set_value (level, PBD::Controllable::NoGroup);
                } else {
                        return 1;
@@ -2451,6 +2901,7 @@ OSC::sel_gain (float val, lo_message msg)
                        abs = dB_to_coefficient (val);
                }
                if (s->gain_control()) {
+                       fake_touch (s->gain_control());
                        s->gain_control()->set_value (abs, PBD::Controllable::NoGroup);
                        return 0;
                }
@@ -2487,6 +2938,7 @@ OSC::sel_fader (float val, lo_message msg)
                float abs;
                abs = slider_position_to_gain_with_max (val, 2.0);
                if (s->gain_control()) {
+                       fake_touch (s->gain_control());
                        s->gain_control()->set_value (abs, PBD::Controllable::NoGroup);
                        return 0;
                }
@@ -2589,6 +3041,7 @@ OSC::route_set_pan_stereo_position (int ssid, float pos, lo_message msg)
        if (s) {
                if(s->pan_azimuth_control()) {
                        s->pan_azimuth_control()->set_value (s->pan_azimuth_control()->interface_to_internal (pos), PBD::Controllable::NoGroup);
+                       return 0;
                }
        }
 
@@ -3341,13 +3794,14 @@ OSC::sel_eq_hpf (float val, lo_message msg)
                s = _select;
        }
        if (s) {
-               if (s->eq_hpf_controllable()) {
-                       s->eq_hpf_controllable()->set_value (s->eq_hpf_controllable()->interface_to_internal (val), PBD::Controllable::NoGroup);
+               if (s->filter_freq_controllable(true)) {
+                       s->filter_freq_controllable(true)->set_value (s->filter_freq_controllable(true)->interface_to_internal (val), PBD::Controllable::NoGroup);
                        return 0;
                }
        }
        return sel_fail ("eq_hpf", 0, get_address (msg));
 }
+// need to add two more filter controls
 
 int
 OSC::sel_eq_gain (int id, float val, lo_message msg)
@@ -3476,6 +3930,18 @@ OSC::periodic (void)
                }
        }
 
+       if (scrub_speed != 0) {
+               // for those jog wheels that don't have 0 on release (touch), time out.
+               int64_t now = ARDOUR::get_microseconds ();
+               int64_t diff = now - scrub_time;
+               if (diff > 120000) {
+                       scrub_speed = 0;
+                       session->request_transport_speed (0);
+                       // locate to the place PH was at last tick
+                       session->request_locate (scrub_place, false);
+               }
+       }
+
        for (GlobalObservers::iterator x = global_observers.begin(); x != global_observers.end(); x++) {
 
                OSCGlobalObserver* go;
@@ -3507,6 +3973,17 @@ OSC::periodic (void)
                        co->tick();
                }
        }
+       for (FakeTouchMap::iterator x = _touch_timeout.begin(); x != _touch_timeout.end();) {
+               _touch_timeout[(*x).first] = (*x).second - 1;
+               if (!(*x).second) {
+                       boost::shared_ptr<ARDOUR::AutomationControl> ctrl = (*x).first;
+                       // turn touch off
+                       ctrl->stop_touch (true, ctrl->session().transport_frame());
+                       _touch_timeout.erase (x++);
+               } else {
+                       x++;
+               }
+       }
        return true;
 }
 
@@ -3586,23 +4063,23 @@ XMLNode&
 OSC::get_state ()
 {
        XMLNode& node (ControlProtocol::get_state());
-       node.add_property("debugmode", (int) _debugmode); // TODO: enum2str
-       node.add_property ("address-only", address_only);
-       node.add_property ("remote-port", remote_port);
-       node.add_property ("banksize", default_banksize);
-       node.add_property ("striptypes", default_strip);
-       node.add_property ("feedback", default_feedback);
-       node.add_property ("gainmode", default_gainmode);
+       node.set_property ("debugmode", (int32_t) _debugmode); // TODO: enum2str
+       node.set_property ("address-only", address_only);
+       node.set_property ("remote-port", remote_port);
+       node.set_property ("banksize", default_banksize);
+       node.set_property ("striptypes", default_strip);
+       node.set_property ("feedback", default_feedback);
+       node.set_property ("gainmode", default_gainmode);
        if (_surface.size()) {
                XMLNode* config = new XMLNode (X_("Configurations"));
                for (uint32_t it = 0; it < _surface.size(); ++it) {
                        OSCSurface* sur = &_surface[it];
                        XMLNode* devnode = new XMLNode (X_("Configuration"));
-                       devnode->add_property (X_("url"), sur->remote_url);
-                       devnode->add_property (X_("bank-size"), sur->bank_size);
-                       devnode->add_property (X_("strip-types"), sur->strip_types.to_ulong());
-                       devnode->add_property (X_("feedback"), sur->feedback.to_ulong());
-                       devnode->add_property (X_("gainmode"), sur->gainmode);
+                       devnode->set_property (X_("url"), sur->remote_url);
+                       devnode->set_property (X_("bank-size"), sur->bank_size);
+                       devnode->set_property (X_("strip-types"), (uint64_t)sur->strip_types.to_ulong());
+                       devnode->set_property (X_("feedback"), (uint64_t)sur->feedback.to_ulong());
+                       devnode->set_property (X_("gainmode"), sur->gainmode);
                        config->add_child_nocopy (*devnode);
                }
                node.add_child_nocopy (*config);
@@ -3616,68 +4093,52 @@ OSC::set_state (const XMLNode& node, int version)
        if (ControlProtocol::set_state (node, version)) {
                return -1;
        }
-       XMLProperty const * p = node.property (X_("debugmode"));
-       if (p) {
-               _debugmode = OSCDebugMode (PBD::atoi(p->value ()));
-       }
-       p = node.property (X_("address-only"));
-       if (p) {
-               address_only = OSCDebugMode (PBD::atoi(p->value ()));
-       }
-       p = node.property (X_("remote-port"));
-       if (p) {
-               remote_port = p->value ();
-       }
-       p = node.property (X_("banksize"));
-       if (p) {
-               default_banksize = OSCDebugMode (PBD::atoi(p->value ()));
-       }
-       p = node.property (X_("striptypes"));
-       if (p) {
-               default_strip = OSCDebugMode (PBD::atoi(p->value ()));
-       }
-       p = node.property (X_("feedback"));
-       if (p) {
-               default_feedback = OSCDebugMode (PBD::atoi(p->value ()));
-       }
-       p = node.property (X_("gainmode"));
-       if (p) {
-               default_gainmode = OSCDebugMode (PBD::atoi(p->value ()));
+       int32_t debugmode;
+       if (node.get_property (X_("debugmode"), debugmode)) {
+               _debugmode = OSCDebugMode (debugmode);
        }
+
+       node.get_property (X_("address-only"), address_only);
+       node.get_property (X_("remote-port"), remote_port);
+       node.get_property (X_("banksize"), default_banksize);
+       node.get_property (X_("striptypes"), default_strip);
+       node.get_property (X_("feedback"), default_feedback);
+       node.get_property (X_("gainmode"), default_gainmode);
+
        XMLNode* cnode = node.child (X_("Configurations"));
 
        if (cnode) {
                XMLNodeList const& devices = cnode->children();
                for (XMLNodeList::const_iterator d = devices.begin(); d != devices.end(); ++d) {
-                       XMLProperty const * prop = (*d)->property (X_("url"));
-                       if (prop) {
-                               OSCSurface s;
-                               bank_dirty = true;
-                               s.remote_url = prop->value();
-                               prop = (*d)->property (X_("bank-size"));
-                               if (prop) {
-                                       s.bank_size = atoi (prop->value().c_str());
-                               }
-                               prop = (*d)->property (X_("strip-types"));
-                               if (prop) {
-                                       s.strip_types = atoi (prop->value().c_str());
-                               }
-                               prop = (*d)->property (X_("feedback"));
-                               if (prop) {
-                                       s.feedback = atoi (prop->value().c_str());
-                               }
-                               prop = (*d)->property (X_("gainmode"));
-                               if (prop) {
-                                       s.gainmode = atoi (prop->value().c_str());
-                               }
-                               s.bank = 1;
-                               s.sel_obs = 0;
-                               s.expand = 0;
-                               s.expand_enable = false;
-                               s.strips = get_sorted_stripables(s.strip_types, s.cue);
-                               s.nstrips = s.strips.size();
-                               _surface.push_back (s);
+                       OSCSurface s;
+                       if (!(*d)->get_property (X_("url"), s.remote_url)) {
+                               continue;
+                       }
+
+                       bank_dirty = true;
+
+                       (*d)->get_property (X_("bank-size"), s.bank_size);
+
+                       uint64_t bits;
+                       if ((*d)->get_property (X_ ("strip-types"), bits)) {
+                               s.strip_types = bits;
                        }
+                       if ((*d)->get_property (X_("feedback"), bits)) {
+                               s.feedback = bits;
+                       }
+                       (*d)->get_property (X_("gainmode"), s.gainmode);
+
+                       s.bank = 1;
+                       s.sel_obs = 0;
+                       s.expand = 0;
+                       s.expand_enable = false;
+                       s.strips = get_sorted_stripables (s.strip_types, s.cue);
+                       s.nstrips = s.strips.size ();
+                       s.no_clear = false;
+                       s.jogmode = JOG;
+                       s.cue = false;
+                       s.aux = 0;
+                       _surface.push_back (s);
                }
        }
        global_init = true;
@@ -3743,17 +4204,13 @@ OSC::get_sorted_stripables(std::bitset<32> types, bool cue)
                                                sorted.push_back (s);
                                        }
                                }
-                       } else
-                       if (types[3] && (s->presentation_info().flags() & PresentationInfo::MidiBus)) {
+                       } else if (types[3] && (s->presentation_info().flags() & PresentationInfo::MidiBus)) {
                                sorted.push_back (s);
-                       } else
-                       if (types[4] && (s->presentation_info().flags() & PresentationInfo::VCA)) {
+                       } else if (types[4] && (s->presentation_info().flags() & PresentationInfo::VCA)) {
                                sorted.push_back (s);
-                       } else
-                       if (types[8] && (s->presentation_info().flags() & PresentationInfo::Selected)) {
+                       } else if (types[8] && (s->is_selected())) {
                                sorted.push_back (s);
-                       } else
-                       if (types[9] && (s->presentation_info().flags() & PresentationInfo::Hidden)) {
+                       } else if (types[9] && (s->presentation_info().flags() & PresentationInfo::Hidden)) {
                                sorted.push_back (s);
                        }
                }
@@ -3776,47 +4233,39 @@ 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
-               cue_set (argv[0]->i, msg);
-               ret = 0;
+               ret = cue_set (argv[0]->i, msg);
        }
        else if (!strncmp (path, "/cue/connect", 12)) {
-               // switch to next Aux bus
-               cue_set (0, msg);
-               ret = 0;
+               // Connect to default Aux bus
+               if ((!argc) || argv[0]->i) {
+                       ret = cue_set (1, msg);
+               }
        }
        else if (!strncmp (path, "/cue/next_aux", 13)) {
                // switch to next Aux bus
-               cue_next (msg);
-               ret = 0;
+               if ((!argc) || argv[0]->i) {
+                       ret = cue_next (msg);
+               }
        }
        else if (!strncmp (path, "/cue/previous_aux", 17)) {
                // switch to previous Aux bus
-               cue_previous (msg);
-               ret = 0;
+               if ((!argc) || argv[0]->i) {
+                       ret = cue_previous (msg);
+               }
        }
        else if (!strncmp (path, "/cue/send/fader/", 16) && strlen (path) > 16) {
                int id = atoi (&path[16]);
-               cue_send_fader (id, argv[0]->f, msg);
-               ret = 0;
+               ret = cue_send_fader (id, argv[0]->f, msg);
        }
        else if (!strncmp (path, "/cue/send/enable/", 17) && strlen (path) > 17) {
                int id = atoi (&path[17]);
-               cue_send_enable (id, argv[0]->f, msg);
-               ret = 0;
+               ret = cue_send_enable (id, argv[0]->f, msg);
        }
        else if (!strncmp (path, "/cue/fader", 10)) {
-               cue_aux_fader (argv[0]->f, msg);
-               ret = 0;
+               ret = cue_aux_fader (argv[0]->f, msg);
        }
        else if (!strncmp (path, "/cue/mute", 9)) {
-               cue_aux_mute (argv[0]->f, msg);
-               ret = 0;
-       }
-
-       if ((ret && _debugmode == Unhandled)) {
-               debugmsg (_("Unhandled OSC cue message"), path, types, argv, argc);
-       } else if ((!ret && _debugmode == All)) {
-               debugmsg (_("OSC cue"), path, types, argv, argc);
+               ret = cue_aux_mute (argv[0]->f, msg);
        }
 
        return ret;
@@ -3831,18 +4280,26 @@ OSC::cue_set (uint32_t aux, lo_message msg)
 int
 OSC::_cue_set (uint32_t aux, lo_address addr)
 {
+       int ret = 1;
        OSCSurface *s = get_surface(addr);
        s->bank_size = 0;
        s->strip_types = 128;
        s->feedback = 0;
        s->gainmode = 1;
        s->cue = true;
-       s->aux = aux;
        s->strips = get_sorted_stripables(s->strip_types, s->cue);
 
        s->nstrips = s->strips.size();
+
+       if (aux < 1) {
+               aux = 1;
+       } else if (aux > s->nstrips) {
+               aux = s->nstrips;
+       }
+       s->aux = aux;
+
        // get rid of any old CueObsevers for this address
-       cueobserver_connections.drop_connections ();
+       //cueobserver_connections.drop_connections ();
        CueObservers::iterator x;
        for (x = cue_observers.begin(); x != cue_observers.end();) {
 
@@ -3878,34 +4335,44 @@ OSC::_cue_set (uint32_t aux, lo_address addr)
                                // start cue observer
                                OSCCueObserver* co = new OSCCueObserver (stp, s->sends, addr);
                                cue_observers.push_back (co);
+                               ret = 0;
                        }
 
                }
        }
 
-       return 0;
+       return ret;
 }
 
 int
 OSC::cue_next (lo_message msg)
 {
        OSCSurface *s = get_surface(get_address (msg));
+       int ret = 1;
+
+       if (!s->cue) {
+               ret = cue_set (1, msg);
+       }
        if (s->aux < s->nstrips) {
-               cue_set (s->aux + 1, msg);
+               ret = cue_set (s->aux + 1, msg);
        } else {
-               cue_set (s->nstrips, msg);
+               ret = cue_set (s->nstrips, msg);
        }
-       return 0;
+       return ret;
 }
 
 int
 OSC::cue_previous (lo_message msg)
 {
        OSCSurface *s = get_surface(get_address (msg));
+       int ret = 1;
+       if (!s->cue) {
+               ret = cue_set (1, msg);
+       }
        if (s->aux > 1) {
-               cue_set (s->aux - 1, msg);
+               ret = cue_set (s->aux - 1, msg);
        }
-       return 0;
+       return ret;
 }
 
 boost::shared_ptr<Send>
@@ -3943,7 +4410,8 @@ OSC::cue_aux_fader (float position, lo_message msg)
                        }
                }
        }
-       return cue_float_message ("/cue/fader", 0, get_address (msg));
+       cue_float_message ("/cue/fader", 0, get_address (msg));
+       return -1;
 }
 
 int
@@ -3963,7 +4431,8 @@ OSC::cue_aux_mute (float state, lo_message msg)
                        }
                }
        }
-       return cue_float_message ("/cue/mute", 0, get_address (msg));
+       cue_float_message ("/cue/mute", 0, get_address (msg));
+       return -1;
 }
 
 int
@@ -3981,7 +4450,8 @@ OSC::cue_send_fader (uint32_t id, float val, lo_message msg)
                        return 0;
                }
        }
-       return cue_float_message (string_compose ("/cue/send/fader/%1", id), 0, get_address (msg));
+       cue_float_message (string_compose ("/cue/send/fader/%1", id), 0, get_address (msg));
+       return -1;
 }
 
 int
@@ -3998,7 +4468,8 @@ OSC::cue_send_enable (uint32_t id, float state, lo_message msg)
                }
                return 0;
        }
-       return cue_float_message (string_compose ("/cue/send/enable/%1", id), 0, get_address (msg));
+       cue_float_message (string_compose ("/cue/send/enable/%1", id), 0, get_address (msg));
+       return -1;
 }
 
 int