summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/menus/sound_menu.c15
-rw-r--r--apps/settings.c7
-rw-r--r--apps/settings.h13
-rw-r--r--apps/settings_list.c15
4 files changed, 28 insertions, 22 deletions
diff --git a/apps/menus/sound_menu.c b/apps/menus/sound_menu.c
index e93d73b7ed..0817304f8d 100644
--- a/apps/menus/sound_menu.c
+++ b/apps/menus/sound_menu.c
@@ -126,15 +126,20 @@ static int timestretch_callback(int action,const struct menu_item_ex *this_item)
126 126
127 /* compressor submenu */ 127 /* compressor submenu */
128 MENUITEM_SETTING(compressor_threshold, 128 MENUITEM_SETTING(compressor_threshold,
129 &global_settings.compressor_threshold, lowlatency_callback); 129 &global_settings.compressor_settings.threshold,
130 lowlatency_callback);
130 MENUITEM_SETTING(compressor_gain, 131 MENUITEM_SETTING(compressor_gain,
131 &global_settings.compressor_makeup_gain, lowlatency_callback); 132 &global_settings.compressor_settings.makeup_gain,
133 lowlatency_callback);
132 MENUITEM_SETTING(compressor_ratio, 134 MENUITEM_SETTING(compressor_ratio,
133 &global_settings.compressor_ratio, lowlatency_callback); 135 &global_settings.compressor_settings.ratio,
136 lowlatency_callback);
134 MENUITEM_SETTING(compressor_knee, 137 MENUITEM_SETTING(compressor_knee,
135 &global_settings.compressor_knee, lowlatency_callback); 138 &global_settings.compressor_settings.knee,
139 lowlatency_callback);
136 MENUITEM_SETTING(compressor_release, 140 MENUITEM_SETTING(compressor_release,
137 &global_settings.compressor_release_time, lowlatency_callback); 141 &global_settings.compressor_settings.release_time,
142 lowlatency_callback);
138 MAKE_MENU(compressor_menu,ID2P(LANG_COMPRESSOR), NULL, Icon_NOICON, 143 MAKE_MENU(compressor_menu,ID2P(LANG_COMPRESSOR), NULL, Icon_NOICON,
139 &compressor_threshold, &compressor_gain, &compressor_ratio, 144 &compressor_threshold, &compressor_gain, &compressor_ratio,
140 &compressor_knee, &compressor_release); 145 &compressor_knee, &compressor_release);
diff --git a/apps/settings.c b/apps/settings.c
index 13913f2d85..a267f51765 100644
--- a/apps/settings.c
+++ b/apps/settings.c
@@ -781,9 +781,6 @@ void settings_apply(bool read_disk)
781#ifdef HAVE_LCD_BITMAP 781#ifdef HAVE_LCD_BITMAP
782 int rc; 782 int rc;
783#endif 783#endif
784#if CONFIG_CODEC == SWCODEC
785 int i;
786#endif
787 sound_settings_apply(); 784 sound_settings_apply();
788 785
789#ifdef HAVE_DISK_STORAGE 786#ifdef HAVE_DISK_STORAGE
@@ -991,7 +988,7 @@ void settings_apply(bool read_disk)
991 /* Configure software equalizer, hardware eq is handled in audio_init() */ 988 /* Configure software equalizer, hardware eq is handled in audio_init() */
992 dsp_set_eq(global_settings.eq_enabled); 989 dsp_set_eq(global_settings.eq_enabled);
993 dsp_set_eq_precut(global_settings.eq_precut); 990 dsp_set_eq_precut(global_settings.eq_precut);
994 for(i = 0; i < 5; i++) { 991 for(int i = 0; i < 5; i++) {
995 dsp_set_eq_coefs(i); 992 dsp_set_eq_coefs(i);
996 } 993 }
997 994
@@ -999,7 +996,7 @@ void settings_apply(bool read_disk)
999#ifdef HAVE_PITCHSCREEN 996#ifdef HAVE_PITCHSCREEN
1000 dsp_timestretch_enable(global_settings.timestretch_enabled); 997 dsp_timestretch_enable(global_settings.timestretch_enabled);
1001#endif 998#endif
1002 dsp_set_compressor(); 999 dsp_set_compressor(&global_settings.compressor_settings);
1003#endif 1000#endif
1004 1001
1005#ifdef HAVE_SPDIF_POWER 1002#ifdef HAVE_SPDIF_POWER
diff --git a/apps/settings.h b/apps/settings.h
index fb562c9191..b312c1e784 100644
--- a/apps/settings.h
+++ b/apps/settings.h
@@ -772,11 +772,14 @@ struct user_settings
772#endif 772#endif
773 773
774#if CONFIG_CODEC == SWCODEC 774#if CONFIG_CODEC == SWCODEC
775 int compressor_threshold; 775 struct compressor_settings
776 int compressor_makeup_gain; 776 {
777 int compressor_ratio; 777 int threshold;
778 int compressor_knee; 778 int makeup_gain;
779 int compressor_release_time; 779 int ratio;
780 int knee;
781 int release_time;
782 } compressor_settings;
780#endif 783#endif
781 784
782 int sleeptimer_duration; /* In minutes; 0=off */ 785 int sleeptimer_duration; /* In minutes; 0=off */
diff --git a/apps/settings_list.c b/apps/settings_list.c
index 6780c78ed3..af48d11c85 100644
--- a/apps/settings_list.c
+++ b/apps/settings_list.c
@@ -436,7 +436,7 @@ static void crossfeed_cross_set(int val)
436static void compressor_set(int val) 436static void compressor_set(int val)
437{ 437{
438 (void)val; 438 (void)val;
439 dsp_set_compressor(); 439 dsp_set_compressor(&global_settings.compressor_settings);
440} 440}
441 441
442static const char* db_format(char* buffer, size_t buffer_size, int value, 442static const char* db_format(char* buffer, size_t buffer_size, int value,
@@ -1482,25 +1482,26 @@ const struct settings_list settings[] = {
1482#endif 1482#endif
1483 1483
1484 /* compressor */ 1484 /* compressor */
1485 INT_SETTING_NOWRAP(F_SOUNDSETTING, compressor_threshold, 1485 INT_SETTING_NOWRAP(F_SOUNDSETTING, compressor_settings.threshold,
1486 LANG_COMPRESSOR_THRESHOLD, 0, 1486 LANG_COMPRESSOR_THRESHOLD, 0,
1487 "compressor threshold", UNIT_DB, 0, -24, 1487 "compressor threshold", UNIT_DB, 0, -24,
1488 -3, formatter_unit_0_is_off, getlang_unit_0_is_off, compressor_set), 1488 -3, formatter_unit_0_is_off, getlang_unit_0_is_off,
1489 CHOICE_SETTING(F_SOUNDSETTING|F_NO_WRAP, compressor_makeup_gain, 1489 compressor_set),
1490 CHOICE_SETTING(F_SOUNDSETTING|F_NO_WRAP, compressor_settings.makeup_gain,
1490 LANG_COMPRESSOR_GAIN, 1, "compressor makeup gain", 1491 LANG_COMPRESSOR_GAIN, 1, "compressor makeup gain",
1491 "off,auto", compressor_set, 2, 1492 "off,auto", compressor_set, 2,
1492 ID2P(LANG_OFF), ID2P(LANG_AUTO)), 1493 ID2P(LANG_OFF), ID2P(LANG_AUTO)),
1493 CHOICE_SETTING(F_SOUNDSETTING|F_NO_WRAP, compressor_ratio, 1494 CHOICE_SETTING(F_SOUNDSETTING|F_NO_WRAP, compressor_settings.ratio,
1494 LANG_COMPRESSOR_RATIO, 1, "compressor ratio", 1495 LANG_COMPRESSOR_RATIO, 1, "compressor ratio",
1495 "2:1,4:1,6:1,10:1,limit", compressor_set, 5, 1496 "2:1,4:1,6:1,10:1,limit", compressor_set, 5,
1496 ID2P(LANG_COMPRESSOR_RATIO_2), ID2P(LANG_COMPRESSOR_RATIO_4), 1497 ID2P(LANG_COMPRESSOR_RATIO_2), ID2P(LANG_COMPRESSOR_RATIO_4),
1497 ID2P(LANG_COMPRESSOR_RATIO_6), ID2P(LANG_COMPRESSOR_RATIO_10), 1498 ID2P(LANG_COMPRESSOR_RATIO_6), ID2P(LANG_COMPRESSOR_RATIO_10),
1498 ID2P(LANG_COMPRESSOR_RATIO_LIMIT)), 1499 ID2P(LANG_COMPRESSOR_RATIO_LIMIT)),
1499 CHOICE_SETTING(F_SOUNDSETTING|F_NO_WRAP, compressor_knee, 1500 CHOICE_SETTING(F_SOUNDSETTING|F_NO_WRAP, compressor_settings.knee,
1500 LANG_COMPRESSOR_KNEE, 1, "compressor knee", 1501 LANG_COMPRESSOR_KNEE, 1, "compressor knee",
1501 "hard knee,soft knee", compressor_set, 2, 1502 "hard knee,soft knee", compressor_set, 2,
1502 ID2P(LANG_COMPRESSOR_HARD_KNEE), ID2P(LANG_COMPRESSOR_SOFT_KNEE)), 1503 ID2P(LANG_COMPRESSOR_HARD_KNEE), ID2P(LANG_COMPRESSOR_SOFT_KNEE)),
1503 INT_SETTING_NOWRAP(F_SOUNDSETTING, compressor_release_time, 1504 INT_SETTING_NOWRAP(F_SOUNDSETTING, compressor_settings.release_time,
1504 LANG_COMPRESSOR_RELEASE, 500, 1505 LANG_COMPRESSOR_RELEASE, 500,
1505 "compressor release time", UNIT_MS, 100, 1000, 1506 "compressor release time", UNIT_MS, 100, 1000,
1506 100, NULL, NULL, compressor_set), 1507 100, NULL, NULL, compressor_set),