*/
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)
, _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;
};