Fix bounds checking and scaling of stereo balance.

This commit is contained in:
John Maguire 2013-04-27 15:22:57 -07:00
parent 37078350b9
commit 848a64eea5
1 changed files with 2 additions and 9 deletions

View File

@ -238,16 +238,9 @@ Equalizer::Params Equalizer::current_params() const {
return ret;
}
namespace {
float Clamp(float min, float value, float max) {
return qMin(1.0f, qMax(-1.0f, value));
}
}
float Equalizer::stereo_balance() const {
return Clamp(-1.0f, ui_->balance_slider->value(), 1.0f);
return qBound(
-1.0f, ui_->balance_slider->value() / 100.0f, 1.0f);
}
void Equalizer::ParametersChanged() {