summaryrefslogtreecommitdiff
path: root/apps/gui
diff options
context:
space:
mode:
authorAidan MacDonald <amachronic@protonmail.com>2022-11-22 04:10:35 +0000
committerAidan MacDonald <amachronic@protonmail.com>2023-01-22 21:19:57 +0000
commit5b27e2255a8bbb8645f089b8e721343bba5bd396 (patch)
treebd29ddf9d2a0c07b1541ad4bace7ff4aedcb3c14 /apps/gui
parent15c4447b6681cadba960aa9275592049afa96893 (diff)
downloadrockbox-5b27e2255a8bbb8645f089b8e721343bba5bd396.tar.gz
rockbox-5b27e2255a8bbb8645f089b8e721343bba5bd396.zip
Add perceptual volume adjustment
The perceived loudness change of a change in volume depends on the listening volume: at high volumes a 1 dB increment is noticeable, but at low volumes a larger increment is needed to get a comparable change in loudness. Perceptual volume adjustment accounts for this fact, and divides the hardware volume range into a number of steps. Each step changes the dB volume by a variable amount, with most of the steps concentrated at higher volumes. This makes it possible to sweep over the entire hardware volume range quickly, without losing the ability to finely adjust the volume at normal listening levels. Use "Volume Adjustment Mode" in the system settings menu to select perceptual volume mode. The number of steps used is controlled by "Number of Volume Steps". (Number of steps has no effect in direct adjustment mode.) It's still possible to set a specific dB volume level from the sound settings menu when perceptual volume is enabled, and perceptual volume does not affect the volume displayed by themes. Change-Id: I6f91fd3f7c5e2d323a914e47b5653033e92b4b3b
Diffstat (limited to 'apps/gui')
-rw-r--r--apps/gui/list.c6
-rw-r--r--apps/gui/quickscreen.c6
-rw-r--r--apps/gui/wps.c4
3 files changed, 6 insertions, 10 deletions
diff --git a/apps/gui/list.c b/apps/gui/list.c
index 83d12289f2..652279a9de 100644
--- a/apps/gui/list.c
+++ b/apps/gui/list.c
@@ -663,12 +663,10 @@ bool gui_synclist_do_button(struct gui_synclist * lists, int *actionptr)
663 663
664#ifdef HAVE_VOLUME_IN_LIST 664#ifdef HAVE_VOLUME_IN_LIST
665 case ACTION_LIST_VOLUP: 665 case ACTION_LIST_VOLUP:
666 global_settings.volume += sound_steps(SOUND_VOLUME); 666 adjust_volume(1);
667 setvol();
668 return true; 667 return true;
669 case ACTION_LIST_VOLDOWN: 668 case ACTION_LIST_VOLDOWN:
670 global_settings.volume -= sound_steps(SOUND_VOLUME); 669 adjust_volume(-1);
671 setvol();
672 return true; 670 return true;
673#endif 671#endif
674 case ACTION_STD_PREV: 672 case ACTION_STD_PREV:
diff --git a/apps/gui/quickscreen.c b/apps/gui/quickscreen.c
index 356f74b283..221dfe3111 100644
--- a/apps/gui/quickscreen.c
+++ b/apps/gui/quickscreen.c
@@ -378,14 +378,12 @@ static int gui_syncquickscreen_run(struct gui_quickscreen * qs, int button_enter
378 else if (button == button_enter) 378 else if (button == button_enter)
379 can_quit = true; 379 can_quit = true;
380 else if (button == ACTION_QS_VOLUP) { 380 else if (button == ACTION_QS_VOLUP) {
381 global_settings.volume += sound_steps(SOUND_VOLUME); 381 adjust_volume(1);
382 setvol();
383 FOR_NB_SCREENS(i) 382 FOR_NB_SCREENS(i)
384 skin_update(CUSTOM_STATUSBAR, i, SKIN_REFRESH_NON_STATIC); 383 skin_update(CUSTOM_STATUSBAR, i, SKIN_REFRESH_NON_STATIC);
385 } 384 }
386 else if (button == ACTION_QS_VOLDOWN) { 385 else if (button == ACTION_QS_VOLDOWN) {
387 global_settings.volume -= sound_steps(SOUND_VOLUME); 386 adjust_volume(-1);
388 setvol();
389 FOR_NB_SCREENS(i) 387 FOR_NB_SCREENS(i)
390 skin_update(CUSTOM_STATUSBAR, i, SKIN_REFRESH_NON_STATIC); 388 skin_update(CUSTOM_STATUSBAR, i, SKIN_REFRESH_NON_STATIC);
391 } 389 }
diff --git a/apps/gui/wps.c b/apps/gui/wps.c
index 4b0c7c056f..fe656034b9 100644
--- a/apps/gui/wps.c
+++ b/apps/gui/wps.c
@@ -841,9 +841,9 @@ long gui_wps_show(void)
841 case ACTION_WPS_VOLUP: /* fall through */ 841 case ACTION_WPS_VOLUP: /* fall through */
842 case ACTION_WPS_VOLDOWN: 842 case ACTION_WPS_VOLDOWN:
843 if (button == ACTION_WPS_VOLUP) 843 if (button == ACTION_WPS_VOLUP)
844 global_settings.volume += sound_steps(SOUND_VOLUME); 844 adjust_volume(1);
845 else 845 else
846 global_settings.volume -= sound_steps(SOUND_VOLUME); 846 adjust_volume(-1);
847 847
848 setvol(); 848 setvol();
849 FOR_NB_SCREENS(i) 849 FOR_NB_SCREENS(i)