Remove internal_to_user/user_to_internal API
authorRobin Gareus <robin@gareus.org>
Wed, 21 Jun 2017 15:08:59 +0000 (17:08 +0200)
committerRobin Gareus <robin@gareus.org>
Wed, 21 Jun 2017 16:13:46 +0000 (18:13 +0200)
Also GainControl can just use the AutomationControl's implementation of
get_user_string()

libs/ardour/ardour/gain_control.h
libs/ardour/ardour/monitor_processor.h
libs/ardour/ardour/proxy_controllable.h
libs/ardour/gain_control.cc
libs/pbd/pbd/controllable.h

index 42465cc225ab725413608ef5196cf559ba6aa468..7fe5cc7bababa60c451bf4098c167bd757af29f1 100644 (file)
@@ -39,15 +39,6 @@ class LIBARDOUR_API GainControl : public SlavableAutomationControl {
        GainControl (Session& session, const Evoral::Parameter &param,
                     boost::shared_ptr<AutomationList> al = boost::shared_ptr<AutomationList>());
 
-       double internal_to_interface (double) const;
-       double interface_to_internal (double) const;
-       double internal_to_user (double) const;
-       double user_to_internal (double) const;
-       std::string get_user_string () const;
-
-       double lower_db;
-       double range_db;
-
        void inc_gain (gain_t);
 
 protected:
index d369cb9c282002b8330d02330260dea509bce53b..70f0761a4961661031c6a1deb0495d7ebd025ab7 100644 (file)
@@ -66,9 +66,6 @@ public:
                return (float) _value;
        }
 
-       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()));
index 22761d7dba1ce49d229592b6c491da1ef1828998..e89cd17f0e32d29c04ce5f1d7925a9fbfa82f30f 100644 (file)
@@ -43,9 +43,6 @@ class LIBARDOUR_API ProxyControllable : public PBD::Controllable {
        void set_value (double v, PBD::Controllable::GroupControlDisposition gcd) { if (_setter (v)) { Changed (true, gcd); /* EMIT SIGNAL */ } }
        double get_value () const { return _getter (); }
 
-       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);
index 36a161059cd804bc0de669ef3819749ab0ba261c..b734dedd016cba78b115ed31881ffb0bba53b431 100644 (file)
@@ -40,47 +40,6 @@ GainControl::GainControl (Session& session, const Evoral::Parameter &param, boos
                                     param.type() == GainAutomation ? X_("gaincontrol") : X_("trimcontrol"),
                                     Controllable::GainLike)
 {
-       lower_db = accurate_coefficient_to_dB (_desc.lower);
-       range_db = accurate_coefficient_to_dB (_desc.upper) - lower_db;
-}
-
-double
-GainControl::internal_to_interface (double v) const
-{
-       if (_desc.type == GainAutomation) {
-               return gain_to_slider_position_with_max (v, _desc.upper);
-       } else {
-               return (accurate_coefficient_to_dB (v) - lower_db) / range_db;
-       }
-}
-
-double
-GainControl::interface_to_internal (double v) const
-{
-       if (_desc.type == GainAutomation) {
-               return slider_position_to_gain_with_max (v, _desc.upper);
-       } else {
-               return dB_to_coefficient (lower_db + v * range_db);
-       }
-}
-
-double
-GainControl::internal_to_user (double v) const
-{
-       return accurate_coefficient_to_dB (v);
-}
-
-double
-GainControl::user_to_internal (double u) const
-{
-       return dB_to_coefficient (u);
-}
-
-std::string
-GainControl::get_user_string () const
-{
-       char theBuf[32]; sprintf( theBuf, _("%3.1f dB"), accurate_coefficient_to_dB (get_value()));
-       return std::string(theBuf);
 }
 
 void
index a255bd628459a83c77cb5db6277c2023eaefc46b..da50db3b3c67156020d03c303989aa545149c002 100644 (file)
@@ -114,16 +114,11 @@ class LIBPBD_API Controllable : public PBD::StatefulDestructible {
        /** Conversions between `internal', 'interface', and 'user' values */
        virtual double internal_to_interface (double i) const {return  (i-lower())/(upper() - lower());}  //by default, the interface range is just a linear interpolation between lower and upper values
        virtual double interface_to_internal (double i) const {return lower() + i*(upper() - lower());}
-       virtual double internal_to_user (double i) const {return i;}  //by default the internal value is the same as the user value
-       virtual double user_to_internal (double i) const {return i;}  //by default the internal value is the same as the user value
 
        /** Get and Set `interface' value  (typically, fraction of knob travel) */
        virtual float get_interface() const { return (internal_to_interface(get_value())); }
        virtual void set_interface (float fraction) { fraction = min( max(0.0f, fraction), 1.0f);  set_value(interface_to_internal(fraction), NoGroup); }
 
-       /** Get and Set `user' value  ( dB or milliseconds, etc.  This MIGHT be the same as the internal value, but in a few cases it is not ) */
-       virtual float get_user() const { return (internal_to_user(get_value())); }
-       virtual void set_user (float user_v) { set_value(user_to_internal(user_v), NoGroup); }
        virtual std::string get_user_string() const { return std::string(); }
 
        PBD::Signal0<void> LearningFinished;