properly retain LV2PluginInfo
[ardour.git] / libs / ardour / ardour / monitor_processor.h
index 33b3e9c366ded42a3b8da233cef04f8d1ba3fff3..c7d73dca001609ac68addc7a631bae21ab5d6961 100644 (file)
@@ -32,6 +32,8 @@
 #include "ardour/types.h"
 #include "ardour/processor.h"
 
+#include "ardour/dB.h"
+
 class XMLNode;
 
 namespace ARDOUR {
@@ -47,6 +49,7 @@ public:
                , _value (initial)
                , _lower (lower)
                , _upper (upper)
+               , _normal (initial)
        {}
 
        /* Controllable API */
@@ -63,8 +66,18 @@ 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()));
+               return std::string(theBuf);
+       }
+
        double lower () const { return _lower; }
        double upper () const { return _upper; }
+       double normal () const { return _normal; }
 
        /* "access as T" API */
 
@@ -103,6 +116,7 @@ protected:
        T _value;
        T _lower;
        T _upper;
+       T _normal;
 };
 
 class LIBARDOUR_API MonitorProcessor : public Processor