Commit 84cc8833 authored by Tristan Matthews's avatar Tristan Matthews

* #9782: GainControl::limit should be const

parent ec08da89
...@@ -82,7 +82,7 @@ double GainControl::DetectionAverage::getAverage(double in) ...@@ -82,7 +82,7 @@ double GainControl::DetectionAverage::getAverage(double in)
GainControl::Limiter::Limiter(double r, double thresh) : ratio_(r), threshold_(thresh) GainControl::Limiter::Limiter(double r, double thresh) : ratio_(r), threshold_(thresh)
{} {}
double GainControl::Limiter::limit(double in) double GainControl::Limiter::limit(double in) const
{ {
double out = (in > threshold_ ? (ratio_ * (in - threshold_)) + threshold_ : double out = (in > threshold_ ? (ratio_ * (in - threshold_)) + threshold_ :
in < -threshold_ ? (ratio_ * (in + threshold_)) - threshold_ : in); in < -threshold_ ? (ratio_ * (in + threshold_)) - threshold_ : in);
......
...@@ -80,7 +80,7 @@ class GainControl { ...@@ -80,7 +80,7 @@ class GainControl {
/** /**
* Perform compression on input signal * Perform compression on input signal
*/ */
double limit(double); double limit(double) const;
private: private:
double ratio_; double ratio_;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment