mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 18:17:39 -04:00
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
This commit is contained in:
parent
15c4447b66
commit
5b27e2255a
17 changed files with 240 additions and 35 deletions
14
apps/misc.h
14
apps/misc.h
|
@ -137,8 +137,22 @@ void check_bootfile(bool do_rolo);
|
|||
#endif
|
||||
#endif
|
||||
|
||||
enum volume_adjust_mode
|
||||
{
|
||||
VOLUME_ADJUST_DIRECT, /* adjust in units of the volume step size */
|
||||
VOLUME_ADJUST_PERCEPTUAL, /* adjust using perceptual steps */
|
||||
};
|
||||
|
||||
/* min/max values for global_settings.volume_adjust_norm_steps */
|
||||
#define MIN_NORM_VOLUME_STEPS 10
|
||||
#define MAX_NORM_VOLUME_STEPS 100
|
||||
|
||||
/* check range, set volume and save settings */
|
||||
void setvol(void);
|
||||
void set_normalized_volume(int vol);
|
||||
int get_normalized_volume(void);
|
||||
void adjust_volume(int steps);
|
||||
void adjust_volume_ex(int steps, enum volume_adjust_mode mode);
|
||||
|
||||
#ifdef HAVE_LCD_COLOR
|
||||
int hex_to_rgb(const char* hex, int* color);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue