From dd2a0aeab03aa3f014411ef63d08d295a45cc3de Mon Sep 17 00:00:00 2001 From: Aidan MacDonald Date: Tue, 22 Nov 2022 23:21:48 +0000 Subject: Use perceptual volume scale for volume bars Display volume bars using a perceptual scale instead of the linear dB scale. This makes adjusting volume with the bar a lot more usable on touchscreen targets. Change-Id: I2db010486e6ba17f9d08202ee74a0b509f2cb434 --- apps/gui/wps.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'apps/gui/wps.c') diff --git a/apps/gui/wps.c b/apps/gui/wps.c index fe656034b9..d35a5ac6d2 100644 --- a/apps/gui/wps.c +++ b/apps/gui/wps.c @@ -182,8 +182,8 @@ static int skintouch_to_wps(void) const int min_vol = sound_min(SOUND_VOLUME); const int max_vol = sound_max(SOUND_VOLUME); const int step_vol = sound_steps(SOUND_VOLUME); - global_settings.volume = (offset * (max_vol - min_vol)) / 1000; - global_settings.volume += min_vol; + + global_settings.volume = from_normalized_volume(offset, min_vol, max_vol, 1000); global_settings.volume -= (global_settings.volume % step_vol); setvol(); } -- cgit v1.2.3