mirror of
https://github.com/clementine-player/Clementine
synced 2025-02-02 12:26:48 +01:00
Fix bounds checking and scaling of stereo balance.
This commit is contained in:
parent
37078350b9
commit
848a64eea5
@ -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() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user