+void
+OSCRouteObserver::refresh_send (boost::shared_ptr<ARDOUR::Send> new_send, bool force)
+{
+ _init = true;
+ if (_tick_busy) {
+ Glib::usleep(100); // let tick finish
+ }
+ _last_gain =-1.0;
+ _last_trim =-1.0;
+
+ send_select_status (ARDOUR::Properties::selected);
+
+ if ((new_send == _send) && !force) {
+ // no change don't send feedback
+ _init = false;
+ return;
+ }
+ strip_connections.drop_connections ();
+ if (!_strip) {
+ // this strip is blank and should be cleared
+ clear_strip ();
+ return;
+ }
+ _send = new_send;
+ send_clear ();
+ _strip->DropReferences.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCRouteObserver::no_strip, this), OSC::instance());
+ as = ARDOUR::Off;
+
+ if (feedback[0]) { // buttons are separate feedback
+ _strip->PropertyChanged.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCRouteObserver::name_changed, this, boost::lambda::_1), OSC::instance());
+ name_changed (ARDOUR::Properties::name);
+ }
+
+ if (feedback[1]) { // level controls
+ _gain_control = _send->gain_control();
+ _gain_control->alist()->automation_state_changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCRouteObserver::gain_automation, this), OSC::instance());
+ _gain_control->Changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCRouteObserver::send_gain_message, this), OSC::instance());
+ gain_automation ();
+
+ if (_send->pan_outs() > 1) {
+ boost::shared_ptr<Controllable> pan_controllable = boost::dynamic_pointer_cast<Controllable>(_send->panner_shell()->panner()->pannable()->pan_azimuth_control);
+ if (pan_controllable) {
+ pan_controllable->Changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCRouteObserver::send_change_message, this, X_("/strip/pan_stereo_position"), pan_controllable), OSC::instance());
+ send_change_message (X_("/strip/pan_stereo_position"), pan_controllable);
+ }
+ } else {
+ _osc.float_message_with_id (X_("/strip/pan_stereo_position"), ssid, 0.5, in_line, addr);
+ }
+ }
+ _init = false;
+ tick();
+
+}
+