diff options
Diffstat (limited to 'libs/ardour/ardour')
-rw-r--r-- | libs/ardour/ardour/dB.h | 2 | ||||
-rw-r--r-- | libs/ardour/ardour/monitor_processor.h | 5 | ||||
-rw-r--r-- | libs/ardour/ardour/proxy_controllable.h | 8 |
3 files changed, 9 insertions, 6 deletions
diff --git a/libs/ardour/ardour/dB.h b/libs/ardour/ardour/dB.h index 209ab11edc..e5865aabd8 100644 --- a/libs/ardour/ardour/dB.h +++ b/libs/ardour/ardour/dB.h @@ -34,4 +34,6 @@ static inline float accurate_coefficient_to_dB (float coeff) { return 20.0f * log10 (coeff); } +static const double zero_db_as_fraction = 0.781787; + #endif /* __ardour_dB_h__ */ diff --git a/libs/ardour/ardour/monitor_processor.h b/libs/ardour/ardour/monitor_processor.h index 023dacb619..5b724b5e8d 100644 --- a/libs/ardour/ardour/monitor_processor.h +++ b/libs/ardour/ardour/monitor_processor.h @@ -20,6 +20,7 @@ #ifndef __ardour_monitor_processor_h__ #define __ardour_monitor_processor_h__ +#include <algorithm> #include <iostream> #include <vector> @@ -52,7 +53,7 @@ public: void set_value (double v) { T newval = (T) v; if (newval != _value) { - _value = newval; + _value = std::max (_lower, std::min (_upper, newval)); Changed(); /* EMIT SIGNAL */ } } @@ -68,7 +69,7 @@ public: MPControl& operator=(const T& v) { if (v != _value) { - _value = v; + _value = std::max (_lower, std::min (_upper, v)); Changed (); /* EMIT SIGNAL */ } return *this; diff --git a/libs/ardour/ardour/proxy_controllable.h b/libs/ardour/ardour/proxy_controllable.h index cbbdcbd6ca..169f60f9f5 100644 --- a/libs/ardour/ardour/proxy_controllable.h +++ b/libs/ardour/ardour/proxy_controllable.h @@ -33,18 +33,18 @@ namespace ARDOUR { class ProxyControllable : public PBD::Controllable { public: ProxyControllable (const std::string& name, PBD::Controllable::Flag flags, - boost::function1<void,double> setter, + boost::function1<bool,double> setter, boost::function0<double> getter) : PBD::Controllable (name, flags) , _setter (setter) , _getter (getter) {} - void set_value (double v) { _setter (v); } - double get_value () const { return _getter (); } + void set_value (double v) { if (_setter (v)) { Changed(); /* EMIT SIGNAL */ } } + double get_value () const { return _getter (); } private: - boost::function1<void,double> _setter; + boost::function1<bool,double> _setter; boost::function0<double> _getter; }; |