Skip to content
Snippets Groups Projects
Commit 84cc8833 authored by Tristan Matthews's avatar Tristan Matthews
Browse files

* #9782: GainControl::limit should be const

parent ec08da89
No related branches found
No related tags found
No related merge requests found
...@@ -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_;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment