summaryrefslogtreecommitdiff
path: root/apps/settings_list.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/settings_list.c')
-rw-r--r--apps/settings_list.c56
1 files changed, 51 insertions, 5 deletions
diff --git a/apps/settings_list.c b/apps/settings_list.c
index 2a7bf9658f..2e3632b949 100644
--- a/apps/settings_list.c
+++ b/apps/settings_list.c
@@ -356,6 +356,34 @@ static void crossfeed_cross_set(int val)
356 global_settings.crossfeed_hf_cutoff); 356 global_settings.crossfeed_hf_cutoff);
357} 357}
358 358
359static void compressor_set(int val)
360{
361 (void)val;
362 dsp_set_compressor(global_settings.compressor_threshold,
363 global_settings.compressor_ratio,
364 global_settings.compressor_makeup_gain,
365 global_settings.compressor_knee,
366 global_settings.compressor_release_time);
367}
368
369static const char* auto_formatter(char *buffer, size_t buffer_size,
370 int val, const char *unit)
371{
372 if (val == -1)
373 return str(LANG_AUTO);
374 else
375 snprintf(buffer, buffer_size, "%d %s", val, unit);
376 return buffer;
377}
378
379static int32_t auto_getlang(int value, int unit)
380{
381 if (value == -1)
382 return LANG_AUTO;
383 else
384 return TALK_ID(value, unit);
385}
386
359static const char* db_format(char* buffer, size_t buffer_size, int value, 387static const char* db_format(char* buffer, size_t buffer_size, int value,
360 const char* unit) 388 const char* unit)
361{ 389{
@@ -1256,11 +1284,29 @@ const struct settings_list settings[] = {
1256 OFFON_SETTING(F_SOUNDSETTING, timestretch_enabled, LANG_TIMESTRETCH, false, 1284 OFFON_SETTING(F_SOUNDSETTING, timestretch_enabled, LANG_TIMESTRETCH, false,
1257 "timestretch enabled", dsp_timestretch_enable), 1285 "timestretch enabled", dsp_timestretch_enable),
1258 1286
1259 /* limiter */ 1287 /* compressor */
1260 INT_SETTING_NOWRAP(F_SOUNDSETTING, limiter_level, 1288 INT_SETTING_NOWRAP(F_SOUNDSETTING, compressor_threshold,
1261 LANG_COMPRESSOR, 0, 1289 LANG_COMPRESSOR_THRESHOLD, 0,
1262 "limiter level", UNIT_DB, 0, MAX_LIMITER_GAIN, 1290 "compressor threshold", UNIT_DB, 0, -24,
1263 5, db_format, get_dec_talkid, dsp_set_limiter), 1291 -3, formatter_unit_0_is_off, getlang_unit_0_is_off, compressor_set),
1292 CHOICE_SETTING(F_SOUNDSETTING|F_NO_WRAP, compressor_ratio,
1293 LANG_COMPRESSOR_RATIO, 1, "compressor ratio",
1294 "2:1,4:1,6:1,10:1,limit", compressor_set, 5,
1295 ID2P(LANG_COMPRESSOR_RATIO_2), ID2P(LANG_COMPRESSOR_RATIO_4),
1296 ID2P(LANG_COMPRESSOR_RATIO_6), ID2P(LANG_COMPRESSOR_RATIO_10),
1297 ID2P(LANG_COMPRESSOR_RATIO_LIMIT)),
1298 INT_SETTING_NOWRAP(F_SOUNDSETTING, compressor_makeup_gain,
1299 LANG_COMPRESSOR_GAIN, -1,
1300 "compressor makeup gain", UNIT_DB, -1, 20,
1301 1, auto_formatter, auto_getlang, compressor_set),
1302 CHOICE_SETTING(F_SOUNDSETTING|F_NO_WRAP, compressor_knee,
1303 LANG_COMPRESSOR_KNEE, 1, "compressor knee",
1304 "hard knee,soft knee", compressor_set, 2,
1305 ID2P(LANG_COMPRESSOR_HARD_KNEE), ID2P(LANG_COMPRESSOR_SOFT_KNEE)),
1306 INT_SETTING_NOWRAP(F_SOUNDSETTING, compressor_release_time,
1307 LANG_COMPRESSOR_RELEASE, 100,
1308 "compressor release time", UNIT_MS, 20, 200,
1309 10, NULL, NULL, compressor_set),
1264#endif 1310#endif
1265#ifdef HAVE_WM8758 1311#ifdef HAVE_WM8758
1266 SOUND_SETTING(F_NO_WRAP, bass_cutoff, LANG_BASS_CUTOFF, 1312 SOUND_SETTING(F_NO_WRAP, bass_cutoff, LANG_BASS_CUTOFF,