forked from len0rd/rockbox
Add DAC's oversampling filter roll-off selection to sound settings.
Change-Id: I1258ba50dd9308f49d97965562f3a423c9bfb785
This commit is contained in:
parent
f6e179bd8e
commit
0519f7e5ab
9 changed files with 96 additions and 0 deletions
|
@ -13114,3 +13114,45 @@
|
||||||
*: "Select directories to scan"
|
*: "Select directories to scan"
|
||||||
</voice>
|
</voice>
|
||||||
</phrase>
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
id: LANG_FILTER_ROLL_OFF
|
||||||
|
desc: in sound settings
|
||||||
|
user: core
|
||||||
|
<source>
|
||||||
|
*: "DAC's filter roll-off"
|
||||||
|
</source>
|
||||||
|
<dest>
|
||||||
|
*: "DAC's filter roll-off"
|
||||||
|
</dest>
|
||||||
|
<voice>
|
||||||
|
*: "DAC's filter roll-off"
|
||||||
|
</voice>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
id: LANG_FILTER_SHARP
|
||||||
|
desc: in sound settings
|
||||||
|
user: core
|
||||||
|
<source>
|
||||||
|
*: "Sharp"
|
||||||
|
</source>
|
||||||
|
<dest>
|
||||||
|
*: "Sharp"
|
||||||
|
</dest>
|
||||||
|
<voice>
|
||||||
|
*: "Sharp"
|
||||||
|
</voice>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
id: LANG_FILTER_SLOW
|
||||||
|
desc: in sound settings
|
||||||
|
user: core
|
||||||
|
<source>
|
||||||
|
*: "Slow"
|
||||||
|
</source>
|
||||||
|
<dest>
|
||||||
|
*: "Slow"
|
||||||
|
</dest>
|
||||||
|
<voice>
|
||||||
|
*: "Slow"
|
||||||
|
</voice>
|
||||||
|
</phrase>
|
||||||
|
|
|
@ -88,6 +88,10 @@ MENUITEM_SETTING(stereo_width, &global_settings.stereo_width,
|
||||||
MENUITEM_SETTING(depth_3d, &global_settings.depth_3d, NULL);
|
MENUITEM_SETTING(depth_3d, &global_settings.depth_3d, NULL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef AUDIOHW_HAVE_FILTER_ROLL_OFF
|
||||||
|
MENUITEM_SETTING(roll_off, &global_settings.roll_off, NULL);
|
||||||
|
#endif
|
||||||
|
|
||||||
#if CONFIG_CODEC == SWCODEC
|
#if CONFIG_CODEC == SWCODEC
|
||||||
/* Crossfeed Submenu */
|
/* Crossfeed Submenu */
|
||||||
MENUITEM_SETTING(crossfeed, &global_settings.crossfeed, lowlatency_callback);
|
MENUITEM_SETTING(crossfeed, &global_settings.crossfeed, lowlatency_callback);
|
||||||
|
@ -183,6 +187,9 @@ MAKE_MENU(sound_settings, ID2P(LANG_SOUND_SETTINGS), NULL, Icon_Audio,
|
||||||
#ifdef AUDIOHW_HAVE_DEPTH_3D
|
#ifdef AUDIOHW_HAVE_DEPTH_3D
|
||||||
,&depth_3d
|
,&depth_3d
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef AUDIOHW_HAVE_FILTER_ROLL_OFF
|
||||||
|
,&roll_off
|
||||||
|
#endif
|
||||||
#if CONFIG_CODEC == SWCODEC
|
#if CONFIG_CODEC == SWCODEC
|
||||||
,&crossfeed_menu, &equalizer_menu, &dithering_enabled
|
,&crossfeed_menu, &equalizer_menu, &dithering_enabled
|
||||||
#ifdef HAVE_PITCHCONTROL
|
#ifdef HAVE_PITCHCONTROL
|
||||||
|
|
|
@ -753,6 +753,9 @@ void sound_settings_apply(void)
|
||||||
#ifdef AUDIOHW_HAVE_DEPTH_3D
|
#ifdef AUDIOHW_HAVE_DEPTH_3D
|
||||||
sound_set(SOUND_DEPTH_3D, global_settings.depth_3d);
|
sound_set(SOUND_DEPTH_3D, global_settings.depth_3d);
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef AUDIOHW_HAVE_FILTER_ROLL_OFF
|
||||||
|
sound_set(SOUND_FILTER_ROLL_OFF, global_settings.roll_off);
|
||||||
|
#endif
|
||||||
#ifdef AUDIOHW_HAVE_EQ
|
#ifdef AUDIOHW_HAVE_EQ
|
||||||
int b;
|
int b;
|
||||||
|
|
||||||
|
|
|
@ -790,6 +790,10 @@ struct user_settings
|
||||||
int depth_3d;
|
int depth_3d;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef AUDIOHW_HAVE_FILTER_ROLL_OFF
|
||||||
|
int roll_off;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef AUDIOHW_HAVE_EQ
|
#ifdef AUDIOHW_HAVE_EQ
|
||||||
/** Hardware EQ tone controls **/
|
/** Hardware EQ tone controls **/
|
||||||
struct hw_eq_band
|
struct hw_eq_band
|
||||||
|
|
|
@ -778,6 +778,13 @@ const struct settings_list settings[] = {
|
||||||
SOUND_SETTING(0,depth_3d, LANG_DEPTH_3D, "3-d enhancement",
|
SOUND_SETTING(0,depth_3d, LANG_DEPTH_3D, "3-d enhancement",
|
||||||
SOUND_DEPTH_3D),
|
SOUND_DEPTH_3D),
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef AUDIOHW_HAVE_FILTER_ROLL_OFF
|
||||||
|
CHOICE_SETTING(F_SOUNDSETTING, roll_off, LANG_FILTER_ROLL_OFF, 0,
|
||||||
|
"roll_off", "sharp,slow", sound_set_filter_roll_off,
|
||||||
|
2, ID2P(LANG_FILTER_SHARP), ID2P(LANG_FILTER_SLOW)),
|
||||||
|
#endif
|
||||||
|
|
||||||
/* playback */
|
/* playback */
|
||||||
OFFON_SETTING(0, playlist_shuffle, LANG_SHUFFLE, false, "shuffle", NULL),
|
OFFON_SETTING(0, playlist_shuffle, LANG_SHUFFLE, false, "shuffle", NULL),
|
||||||
SYSTEM_SETTING(NVRAM(4), resume_index, -1),
|
SYSTEM_SETTING(NVRAM(4), resume_index, -1),
|
||||||
|
|
|
@ -40,6 +40,7 @@
|
||||||
#define MONO_VOL_CAP (1 << 10)
|
#define MONO_VOL_CAP (1 << 10)
|
||||||
#define LIN_GAIN_CAP (1 << 11)
|
#define LIN_GAIN_CAP (1 << 11)
|
||||||
#define MIC_GAIN_CAP (1 << 12)
|
#define MIC_GAIN_CAP (1 << 12)
|
||||||
|
#define FILTER_ROLL_OFF_CAP (1 << 13)
|
||||||
|
|
||||||
/* Used by every driver to export its min/max/default values for its audio
|
/* Used by every driver to export its min/max/default values for its audio
|
||||||
settings. */
|
settings. */
|
||||||
|
@ -269,6 +270,11 @@ enum AUDIOHW_EQ_SETTINGS
|
||||||
#define AUDIOHW_HAVE_MIC_GAIN
|
#define AUDIOHW_HAVE_MIC_GAIN
|
||||||
#endif
|
#endif
|
||||||
#endif /* HAVE_RECORDING */
|
#endif /* HAVE_RECORDING */
|
||||||
|
|
||||||
|
#if (AUDIOHW_CAPS & FILTER_ROLL_OFF_CAP)
|
||||||
|
#define AUDIOHW_HAVE_FILTER_ROLL_OFF
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* AUDIOHW_CAPS */
|
#endif /* AUDIOHW_CAPS */
|
||||||
|
|
||||||
#ifdef HAVE_SW_TONE_CONTROLS
|
#ifdef HAVE_SW_TONE_CONTROLS
|
||||||
|
@ -454,6 +460,16 @@ void audiohw_set_eq_band_width(unsigned int band, int val);
|
||||||
void audiohw_set_depth_3d(int val);
|
void audiohw_set_depth_3d(int val);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef AUDIOHW_HAVE_FILTER_ROLL_OFF
|
||||||
|
/**
|
||||||
|
* Set DAC's oversampling filter roll-off.
|
||||||
|
* @param val 0 - sharp roll-off, 1 - slow roll-off.
|
||||||
|
* NOTE: AUDIOHW_CAPS need to contain
|
||||||
|
* FILTER_ROLL_OFF_CAP
|
||||||
|
*/
|
||||||
|
void audiohw_set_filter_roll_off(int val);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
void audiohw_set_frequency(int fsel);
|
void audiohw_set_frequency(int fsel);
|
||||||
|
|
||||||
|
|
|
@ -110,6 +110,9 @@ AUDIOHW_SETTINGS(
|
||||||
#if defined(AUDIOHW_HAVE_DEPTH_3D)
|
#if defined(AUDIOHW_HAVE_DEPTH_3D)
|
||||||
AUDIOHW_SETTING_ENT(DEPTH_3D, sound_set_depth_3d)
|
AUDIOHW_SETTING_ENT(DEPTH_3D, sound_set_depth_3d)
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(AUDIOHW_HAVE_FILTER_ROLL_OFF)
|
||||||
|
AUDIOHW_SETTING_ENT(FILTER_ROLL_OFF, sound_set_filter_roll_off)
|
||||||
|
#endif
|
||||||
/* Hardware EQ tone controls */
|
/* Hardware EQ tone controls */
|
||||||
#if defined(AUDIOHW_HAVE_EQ)
|
#if defined(AUDIOHW_HAVE_EQ)
|
||||||
AUDIOHW_SETTING_ENT(EQ_BAND1_GAIN, sound_set_hw_eq_band1_gain)
|
AUDIOHW_SETTING_ENT(EQ_BAND1_GAIN, sound_set_hw_eq_band1_gain)
|
||||||
|
|
|
@ -51,6 +51,10 @@ void sound_set_treble_cutoff(int value);
|
||||||
void sound_set_depth_3d(int value);
|
void sound_set_depth_3d(int value);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(AUDIOHW_HAVE_FILTER_ROLL_OFF)
|
||||||
|
void sound_set_filter_roll_off(int value);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef AUDIOHW_HAVE_EQ
|
#ifdef AUDIOHW_HAVE_EQ
|
||||||
/*
|
/*
|
||||||
* band = SOUND_EQ_BANDb
|
* band = SOUND_EQ_BANDb
|
||||||
|
|
|
@ -314,6 +314,16 @@ void sound_set_depth_3d(int value)
|
||||||
}
|
}
|
||||||
#endif /* AUDIOHW_HAVE_DEPTH_3D */
|
#endif /* AUDIOHW_HAVE_DEPTH_3D */
|
||||||
|
|
||||||
|
#if defined(AUDIOHW_HAVE_FILTER_ROLL_OFF)
|
||||||
|
void sound_set_filter_roll_off(int value)
|
||||||
|
{
|
||||||
|
if (!audio_is_initialized)
|
||||||
|
return;
|
||||||
|
|
||||||
|
audiohw_set_filter_roll_off(value);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(AUDIOHW_HAVE_EQ)
|
#if defined(AUDIOHW_HAVE_EQ)
|
||||||
int sound_enum_hw_eq_band_setting(unsigned int band,
|
int sound_enum_hw_eq_band_setting(unsigned int band,
|
||||||
unsigned int band_setting)
|
unsigned int band_setting)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue