summaryrefslogtreecommitdiff
path: root/apps/settings_list.c
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/settings_list.c
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/settings_list.c')
-rw-r--r--apps/settings_list.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/apps/settings_list.c b/apps/settings_list.c
index 60ac4192fa..315f39b21f 100644
--- a/apps/settings_list.c
+++ b/apps/settings_list.c
@@ -40,6 +40,7 @@
40#include "powermgmt.h" 40#include "powermgmt.h"
41#include "kernel.h" 41#include "kernel.h"
42#include "open_plugin.h" 42#include "open_plugin.h"
43#include "misc.h"
43#ifdef HAVE_REMOTE_LCD 44#ifdef HAVE_REMOTE_LCD
44#include "lcd-remote.h" 45#include "lcd-remote.h"
45#endif 46#endif
@@ -1057,6 +1058,16 @@ const struct settings_list settings[] = {
1057 MAX_FILES_IN_DIR_STEP /* min */, MAX_FILES_IN_DIR_MAX, 1058 MAX_FILES_IN_DIR_STEP /* min */, MAX_FILES_IN_DIR_MAX,
1058 MAX_FILES_IN_DIR_STEP, 1059 MAX_FILES_IN_DIR_STEP,
1059 NULL, NULL, NULL), 1060 NULL, NULL, NULL),
1061#ifdef HAVE_PERCEPTUAL_VOLUME
1062 CHOICE_SETTING(0, volume_adjust_mode, LANG_VOLUME_ADJUST_MODE,
1063 VOLUME_ADJUST_DIRECT, "volume adjustment mode",
1064 "direct,perceptual", NULL, 2,
1065 ID2P(LANG_DIRECT), ID2P(LANG_PERCEPTUAL)),
1066 INT_SETTING_NOWRAP(0, volume_adjust_norm_steps, LANG_VOLUME_ADJUST_NORM_STEPS,
1067 50, "perceptual volume step count", UNIT_INT,
1068 MIN_NORM_VOLUME_STEPS, MAX_NORM_VOLUME_STEPS, 5,
1069 NULL, NULL, NULL),
1070#endif
1060/* use this setting for user code even if there's no exchangable battery 1071/* use this setting for user code even if there's no exchangable battery
1061 * support enabled */ 1072 * support enabled */
1062#if BATTERY_CAPACITY_INC > 0 1073#if BATTERY_CAPACITY_INC > 0