X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fardour%2Fmonitor_processor.h;h=c7d73dca001609ac68addc7a631bae21ab5d6961;hb=c4a7d25b34aec71ab7d594af50f7b522518e0221;hp=41e911f57c2a399c3f172406565f4c05e277378b;hpb=b880a381523b2cfdb7ebd17c27fff1adf90fa028;p=ardour.git diff --git a/libs/ardour/ardour/monitor_processor.h b/libs/ardour/ardour/monitor_processor.h index 41e911f57c..c7d73dca00 100644 --- a/libs/ardour/ardour/monitor_processor.h +++ b/libs/ardour/ardour/monitor_processor.h @@ -32,6 +32,8 @@ #include "ardour/types.h" #include "ardour/processor.h" +#include "ardour/dB.h" + class XMLNode; namespace ARDOUR { @@ -39,7 +41,7 @@ namespace ARDOUR { class Session; template -class LIBARDOUR_API MPControl : public PBD::Controllable { +class /*LIBARDOUR_API*/ MPControl : public PBD::Controllable { public: MPControl (T initial, const std::string& name, PBD::Controllable::Flag flag, float lower = 0.0f, float upper = 1.0f) @@ -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