diff --git a/libs/surfaces/osc/osc_route_observer.cc b/libs/surfaces/osc/osc_route_observer.cc index dc7677c331..beea83f84f 100644 --- a/libs/surfaces/osc/osc_route_observer.cc +++ b/libs/surfaces/osc/osc_route_observer.cc @@ -75,12 +75,15 @@ OSCRouteObserver::OSCRouteObserver (boost::shared_ptr s, lo_address a } if (feedback[1]) { // level controls + boost::shared_ptr gain_cont = _strip->gain_control(); if (gainmode) { - _strip->gain_control()->Changed.connect (strip_connections, MISSING_INVALIDATOR, bind (&OSCRouteObserver::send_gain_message, this, X_("/strip/fader"), _strip->gain_control()), OSC::instance()); - send_gain_message ("/strip/fader", _strip->gain_control()); + gain_cont->alist()->automation_state_changed.connect (strip_connections, MISSING_INVALIDATOR, bind (&OSCRouteObserver::gain_automation, this, X_("/strip/fader")), OSC::instance()); + gain_cont->Changed.connect (strip_connections, MISSING_INVALIDATOR, bind (&OSCRouteObserver::send_gain_message, this, X_("/strip/fader"), gain_cont), OSC::instance()); + gain_automation ("/strip/fader"); } else { - _strip->gain_control()->Changed.connect (strip_connections, MISSING_INVALIDATOR, bind (&OSCRouteObserver::send_gain_message, this, X_("/strip/gain"), _strip->gain_control()), OSC::instance()); - send_gain_message ("/strip/gain", _strip->gain_control()); + gain_cont->alist()->automation_state_changed.connect (strip_connections, MISSING_INVALIDATOR, bind (&OSCRouteObserver::gain_automation, this, X_("/strip/gain")), OSC::instance()); + gain_cont->Changed.connect (strip_connections, MISSING_INVALIDATOR, bind (&OSCRouteObserver::send_gain_message, this, X_("/strip/gain"), gain_cont), OSC::instance()); + gain_automation ("/strip/gain"); } boost::shared_ptr trim_controllable = boost::dynamic_pointer_cast(_strip->trim_control()); @@ -358,6 +361,27 @@ OSCRouteObserver::send_gain_message (string path, boost::shared_ptr control = _strip->gain_control(); + lo_message_add_float (msg, control->alist()->automation_state()); + send_gain_message (path, control); + lo_send_message (addr, apath.c_str(), msg); + lo_message_free (msg); +} + + + string OSCRouteObserver::set_path (string path) { diff --git a/libs/surfaces/osc/osc_route_observer.h b/libs/surfaces/osc/osc_route_observer.h index ef9bfb7ba2..a445334b3c 100644 --- a/libs/surfaces/osc/osc_route_observer.h +++ b/libs/surfaces/osc/osc_route_observer.h @@ -65,6 +65,7 @@ class OSCRouteObserver void text_with_id (std::string path, uint32_t id, std::string name); void send_monitor_status (boost::shared_ptr controllable); void send_gain_message (std::string path, boost::shared_ptr controllable); + void gain_automation (std::string path); void send_trim_message (std::string path, boost::shared_ptr controllable); std::string set_path (std::string path); void clear_strip (std::string path, float val);