summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorChiwen Chang <rock1104.tw@yahoo.com.tw>2014-08-22 23:30:35 +1000
committerGerrit Rockbox <gerrit@rockbox.org>2015-01-19 19:34:01 +0100
commit3ae0f32ac3d6693a9528703c5f1b3586a9d79601 (patch)
treef34f7a90ac4cdaa1e1bf31574e8e4967916616a4 /apps
parent2cdfc43f10e3d755018ea508b64b209608d71864 (diff)
downloadrockbox-3ae0f32ac3d6693a9528703c5f1b3586a9d79601.zip
rockbox-3ae0f32ac3d6693a9528703c5f1b3586a9d79601.tar.gz
rockbox-3ae0f32ac3d6693a9528703c5f1b3586a9d79601.tar.bz2
rockbox-3ae0f32ac3d6693a9528703c5f1b3586a9d79601.tar.xz
three new DSPs
perceptual bass enhancement - a bbe-ish group delay corrction with Biophonic EQ boost. - precut auditory fatigue reduction -reduce signal in frequency that may trigger temporary threshold shift haas surround -frequency between f(x1) and f(x2) is always bypassed. -can apply to side only. Change-Id: Icb6355ce9b1c99bf2c58c9385c3c411c0ae209d3
Diffstat (limited to 'apps')
-rw-r--r--apps/lang/english.lang119
-rw-r--r--apps/menus/sound_menu.c23
-rw-r--r--apps/settings.c7
-rw-r--r--apps/settings.h12
-rw-r--r--apps/settings_list.c45
5 files changed, 205 insertions, 1 deletions
diff --git a/apps/lang/english.lang b/apps/lang/english.lang
index 1135705..ca5e687 100644
--- a/apps/lang/english.lang
+++ b/apps/lang/english.lang
@@ -13254,3 +13254,122 @@
swcodec: "Q"
</voice>
</phrase>
+<phrase>
+ id: LANG_PBE
+ desc: in sound settings
+ user: core
+ <source>
+ *: none
+ swcodec: "Perceptual Bass Enhancement"
+ </source>
+ <dest>
+ *: none
+ swcodec: "Perceptual Bass Enhancement"
+ </dest>
+ <voice>
+ *: none
+ swcodec: "Perceptual Bass Enhancement"
+ </voice>
+</phrase>
+<phrase>
+ id: LANG_AFR
+ desc: in sound settings
+ user: core
+ <source>
+ *: none
+ swcodec: "Auditory Fatigue Reduction"
+ </source>
+ <dest>
+ *: none
+ swcodec: "Auditory Fatigue Reduction"
+ </dest>
+ <voice>
+ *: none
+ swcodec: "Auditory Fatigue Reduction"
+ </voice>
+</phrase>
+<phrase>
+ id: LANG_SURROUND
+ desc: in the sound settings menu
+ user: core
+ <source>
+ *: none
+ swcodec: "Haas Surround"
+ </source>
+ <dest>
+ *: none
+ swcodec: "Haas Surround"
+ </dest>
+ <voice>
+ *: none
+ swcodec: "Haas Surround"
+ </voice>
+</phrase>
+<phrase>
+ id: LANG_SURROUND_FX1
+ desc: in sound settings
+ user: core
+ <source>
+ *: none
+ swcodec: "f(x1)"
+ </source>
+ <dest>
+ *: none
+ swcodec: "f(x1)"
+ </dest>
+ <voice>
+ *: none
+ swcodec: "f(x1)"
+ </voice>
+</phrase>
+<phrase>
+ id: LANG_SURROUND_FX2
+ desc: in sound settings
+ user: core
+ <source>
+ *: none
+ swcodec: "f(x2)"
+ </source>
+ <dest>
+ *: none
+ swcodec: "f(x2)"
+ </dest>
+ <voice>
+ *: none
+ swcodec: "f(x2)"
+ </voice>
+</phrase>
+<phrase>
+ id: LANG_SURROUND_METHOD2
+ desc: in sound settings
+ user: core
+ <source>
+ *: none
+ swcodec: "SIDE ONLY"
+ </source>
+ <dest>
+ *: none
+ swcodec: "SIDE ONLY"
+ </dest>
+ <voice>
+ *: none
+ swcodec: "SIDE ONLY"
+ </voice>
+</phrase>
+<phrase>
+ id: LANG_SURROUND_MIX
+ desc: in sound settings
+ user: core
+ <source>
+ *: none
+ swcodec: "Dry / Wet Mix"
+ </source>
+ <dest>
+ *: none
+ swcodec: "Dry / Wet Mix"
+ </dest>
+ <voice>
+ *: none
+ swcodec: "Dry / Wet Mix"
+ </voice>
+</phrase>
diff --git a/apps/menus/sound_menu.c b/apps/menus/sound_menu.c
index 8913266..7c04662 100644
--- a/apps/menus/sound_menu.c
+++ b/apps/menus/sound_menu.c
@@ -166,6 +166,28 @@ static int timestretch_callback(int action,const struct menu_item_ex *this_item)
MENUITEM_SETTING(dithering_enabled,
&global_settings.dithering_enabled, lowlatency_callback);
+ MENUITEM_SETTING(afr_enabled,
+ &global_settings.afr_enabled, lowlatency_callback);
+ MENUITEM_SETTING(pbe,
+ &global_settings.pbe, lowlatency_callback);
+ MENUITEM_SETTING(pbe_precut,
+ &global_settings.pbe_precut, lowlatency_callback);
+ MAKE_MENU(pbe_menu,ID2P(LANG_PBE), NULL, Icon_NOICON,
+ &pbe,&pbe_precut);
+ MENUITEM_SETTING(surround_enabled,
+ &global_settings.surround_enabled, lowlatency_callback);
+ MENUITEM_SETTING(surround_balance,
+ &global_settings.surround_balance, lowlatency_callback);
+ MENUITEM_SETTING(surround_fx1,
+ &global_settings.surround_fx1, lowlatency_callback);
+ MENUITEM_SETTING(surround_fx2,
+ &global_settings.surround_fx2, lowlatency_callback);
+ MENUITEM_SETTING(surround_method2,
+ &global_settings.surround_method2, lowlatency_callback);
+ MENUITEM_SETTING(surround_mix,
+ &global_settings.surround_mix, lowlatency_callback);
+ MAKE_MENU(surround_menu,ID2P(LANG_SURROUND), NULL, Icon_NOICON,
+ &surround_enabled,&surround_balance,&surround_fx1,&surround_fx2,&surround_method2,&surround_mix);
/* compressor submenu */
MENUITEM_SETTING(compressor_threshold,
@@ -236,6 +258,7 @@ MAKE_MENU(sound_settings, ID2P(LANG_SOUND_SETTINGS), NULL, Icon_Audio,
#endif
#if CONFIG_CODEC == SWCODEC
,&crossfeed_menu, &equalizer_menu, &dithering_enabled
+ ,&surround_menu, &pbe_menu, &afr_enabled
#ifdef HAVE_PITCHCONTROL
,&timestretch_enabled
#endif
diff --git a/apps/settings.c b/apps/settings.c
index 16d572e..f144a4a 100644
--- a/apps/settings.c
+++ b/apps/settings.c
@@ -1034,6 +1034,13 @@ void settings_apply(bool read_disk)
}
dsp_dither_enable(global_settings.dithering_enabled);
+ dsp_surround_set_balance(global_settings.surround_balance);
+ dsp_surround_set_cutoff(global_settings.surround_fx1, global_settings.surround_fx2);
+ dsp_surround_mix(global_settings.surround_mix);
+ dsp_surround_enable(global_settings.surround_enabled);
+ dsp_afr_enable(global_settings.afr_enabled);
+ dsp_pbe_precut(global_settings.pbe_precut);
+ dsp_pbe_enable(global_settings.pbe);
#ifdef HAVE_PITCHCONTROL
dsp_timestretch_enable(global_settings.timestretch_enabled);
#endif
diff --git a/apps/settings.h b/apps/settings.h
index 3ec5ee6..3029026 100644
--- a/apps/settings.h
+++ b/apps/settings.h
@@ -838,6 +838,18 @@ struct user_settings
int play_frequency; /* core audio output frequency selection */
#endif
int volume_limit; /* maximum volume limit */
+
+ int surround_enabled;
+ int surround_balance;
+ int surround_fx1;
+ int surround_fx2;
+ bool surround_method2;
+ int surround_mix;
+
+ int pbe;
+ int pbe_precut;
+
+ int afr_enabled;
};
/** global variables **/
diff --git a/apps/settings_list.c b/apps/settings_list.c
index cddc062..abdb512 100644
--- a/apps/settings_list.c
+++ b/apps/settings_list.c
@@ -446,6 +446,12 @@ static void crossfeed_cross_set(int val)
global_settings.crossfeed_hf_cutoff);
}
+static void surround_set_factor(int val)
+{
+ (void)val;
+ dsp_surround_set_cutoff(global_settings.surround_fx1, global_settings.surround_fx2);
+}
+
static void compressor_set(int val)
{
(void)val;
@@ -1667,7 +1673,44 @@ const struct settings_list settings[] = {
/* dithering */
OFFON_SETTING(F_SOUNDSETTING, dithering_enabled, LANG_DITHERING, false,
"dithering enabled", dsp_dither_enable),
-
+ /* surround */
+ TABLE_SETTING(F_SOUNDSETTING, surround_enabled,
+ LANG_SURROUND, 0, "surround enabled", "off",
+ UNIT_MS, formatter_unit_0_is_off, getlang_unit_0_is_off,
+ dsp_surround_enable, 6,
+ 0,5,8,10,15,30),
+ INT_SETTING_NOWRAP(F_SOUNDSETTING, surround_balance,
+ LANG_BALANCE, 35,
+ "surround balance", UNIT_PERCENT, 0, 99,
+ 1, NULL, NULL, dsp_surround_set_balance),
+ INT_SETTING_NOWRAP(F_SOUNDSETTING, surround_fx1,
+ LANG_SURROUND_FX1, 3400,
+ "surround_fx1", UNIT_HERTZ, 600, 8000,
+ 200, NULL, NULL, surround_set_factor),
+ INT_SETTING_NOWRAP(F_SOUNDSETTING, surround_fx2,
+ LANG_SURROUND_FX2, 320,
+ "surround_fx2", UNIT_HERTZ, 40, 400,
+ 40, NULL, NULL, surround_set_factor),
+ OFFON_SETTING(F_SOUNDSETTING, surround_method2, LANG_SURROUND_METHOD2, false,
+ "side only", dsp_surround_side_only),
+ INT_SETTING_NOWRAP(F_SOUNDSETTING, surround_mix,
+ LANG_SURROUND_MIX, 50,
+ "surround mix", UNIT_PERCENT, 0, 100,
+ 5, NULL, NULL, dsp_surround_mix),
+ /* auditory fatigue reduction */
+ CHOICE_SETTING(F_SOUNDSETTING|F_NO_WRAP, afr_enabled,
+ LANG_AFR, 0,"afr enabled",
+ "off,weak,moderate,strong", dsp_afr_enable, 4,
+ ID2P(LANG_OFF), ID2P(LANG_WEAK),ID2P(LANG_MODERATE),ID2P(LANG_STRONG)),
+ /* PBE */
+ INT_SETTING_NOWRAP(F_SOUNDSETTING, pbe,
+ LANG_PBE, 0,
+ "pbe", UNIT_PERCENT, 0, 100,
+ 25, NULL, NULL, dsp_pbe_enable),
+ INT_SETTING_NOWRAP(F_SOUNDSETTING, pbe_precut,
+ LANG_EQUALIZER_PRECUT, -25,
+ "pbe precut", UNIT_DB, -45, 0,
+ 1, db_format, NULL, dsp_pbe_precut),
#ifdef HAVE_PITCHCONTROL
/* timestretch */
OFFON_SETTING(F_SOUNDSETTING, timestretch_enabled, LANG_TIMESTRETCH, false,