change API of Controllable::Changed signal to include (from_self, GroupControlDisposi...
[ardour.git] / libs / ardour / ardour / proxy_controllable.h
index 066f2aac81f9266552f0871cd6c69f44b98e71f9..22761d7dba1ce49d229592b6c491da1ef1828998 100644 (file)
@@ -31,7 +31,7 @@ namespace ARDOUR {
 */
 
 class LIBARDOUR_API ProxyControllable : public PBD::Controllable {
-public:
+  public:
        ProxyControllable (const std::string& name, PBD::Controllable::Flag flags,
                           boost::function1<bool,double> setter,
                           boost::function0<double> getter)
@@ -40,10 +40,18 @@ public:
                , _getter (getter)
        {}
 
-        void set_value (double v) { if (_setter (v)) { Changed(); /* EMIT SIGNAL */ } }
-        double get_value () const { return _getter (); }
+       void set_value (double v, PBD::Controllable::GroupControlDisposition gcd) { if (_setter (v)) { Changed (true, gcd); /* EMIT SIGNAL */ } }
+       double get_value () const { return _getter (); }
 
-private:
+       double internal_to_user (double i) const { return accurate_coefficient_to_dB (i);}
+       double user_to_internal (double u) const { return dB_to_coefficient(u) ;}
+
+       std::string get_user_string () const {
+               char theBuf[32]; sprintf( theBuf, "%3.1f dB", accurate_coefficient_to_dB (get_value()));
+               return std::string(theBuf);
+       }
+
+  private:
        boost::function1<bool,double> _setter;
        boost::function0<double> _getter;
 };