OSC: Allow /bank_up to accept -1 as well as 1 so encoder can work.
[ardour.git] / libs / surfaces / osc / osc_cue_observer.cc
index c846145ebcd8910e7af22565ecb6c946f48fb3fc..d36fdaf3a9f790ea4ee0e7178293421b6f196bc0 100644 (file)
@@ -19,6 +19,8 @@
 
 #include "boost/lambda/lambda.hpp"
 
+#include "pbd/control_math.h"
+
 #include "ardour/track.h"
 #include "ardour/dB.h"
 #include "ardour/meter.h"
@@ -43,11 +45,11 @@ OSCCueObserver::OSCCueObserver (boost::shared_ptr<Stripable> s, std::vector<boos
        _strip->PropertyChanged.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCCueObserver::name_changed, this, boost::lambda::_1, 0), OSC::instance());
        name_changed (ARDOUR::Properties::name, 0);
 
-       _strip->mute_control()->Changed.connect (strip_connections, MISSING_INVALIDATOR, bind (&OSCCueObserver::send_change_message, this, X_("/cue/mute"), 0, _strip->mute_control()), OSC::instance());
+       _strip->mute_control()->Changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCCueObserver::send_change_message, this, X_("/cue/mute"), 0, _strip->mute_control()), OSC::instance());
        send_change_message ("/cue/mute", 0, _strip->mute_control());
 
        gain_timeout.push_back (0);
-       _strip->gain_control()->Changed.connect (strip_connections, MISSING_INVALIDATOR, bind (&OSCCueObserver::send_gain_message, this, 0, _strip->gain_control()), OSC::instance());
+       _strip->gain_control()->Changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCCueObserver::send_gain_message, this, 0, _strip->gain_control()), OSC::instance());
        send_gain_message (0, _strip->gain_control());
 
        send_init ();
@@ -221,7 +223,7 @@ OSCCueObserver::send_gain_message (uint32_t id,  boost::shared_ptr<Controllable>
                path = string_compose ("%1/%2", path, id);
        }
        lo_message msg = lo_message_new ();
-       lo_message_add_float (msg, gain_to_slider_position (controllable->get_value()));
+       lo_message_add_float (msg, controllable->internal_to_interface (controllable->get_value()));
        gain_timeout[id] = 8;
 
        lo_send_message (addr, path.c_str(), msg);