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.c34
1 files changed, 8 insertions, 26 deletions
diff --git a/apps/settings_list.c b/apps/settings_list.c
index d9ca889458..c92772beb9 100644
--- a/apps/settings_list.c
+++ b/apps/settings_list.c
@@ -364,30 +364,12 @@ static void compressor_set(int val)
364{ 364{
365 (void)val; 365 (void)val;
366 dsp_set_compressor(global_settings.compressor_threshold, 366 dsp_set_compressor(global_settings.compressor_threshold,
367 global_settings.compressor_ratio,
368 global_settings.compressor_makeup_gain, 367 global_settings.compressor_makeup_gain,
368 global_settings.compressor_ratio,
369 global_settings.compressor_knee, 369 global_settings.compressor_knee,
370 global_settings.compressor_release_time); 370 global_settings.compressor_release_time);
371} 371}
372 372
373static const char* auto_formatter(char *buffer, size_t buffer_size,
374 int val, const char *unit)
375{
376 if (val == -1)
377 return str(LANG_AUTO);
378 else
379 snprintf(buffer, buffer_size, "%d %s", val, unit);
380 return buffer;
381}
382
383static int32_t auto_getlang(int value, int unit)
384{
385 if (value == -1)
386 return LANG_AUTO;
387 else
388 return TALK_ID(value, unit);
389}
390
391static const char* db_format(char* buffer, size_t buffer_size, int value, 373static const char* db_format(char* buffer, size_t buffer_size, int value,
392 const char* unit) 374 const char* unit)
393{ 375{
@@ -1293,24 +1275,24 @@ const struct settings_list settings[] = {
1293 LANG_COMPRESSOR_THRESHOLD, 0, 1275 LANG_COMPRESSOR_THRESHOLD, 0,
1294 "compressor threshold", UNIT_DB, 0, -24, 1276 "compressor threshold", UNIT_DB, 0, -24,
1295 -3, formatter_unit_0_is_off, getlang_unit_0_is_off, compressor_set), 1277 -3, formatter_unit_0_is_off, getlang_unit_0_is_off, compressor_set),
1278 CHOICE_SETTING(F_SOUNDSETTING|F_NO_WRAP, compressor_makeup_gain,
1279 LANG_COMPRESSOR_GAIN, 1, "compressor makeup gain",
1280 "off,auto", compressor_set, 2,
1281 ID2P(LANG_OFF), ID2P(LANG_AUTO)),
1296 CHOICE_SETTING(F_SOUNDSETTING|F_NO_WRAP, compressor_ratio, 1282 CHOICE_SETTING(F_SOUNDSETTING|F_NO_WRAP, compressor_ratio,
1297 LANG_COMPRESSOR_RATIO, 1, "compressor ratio", 1283 LANG_COMPRESSOR_RATIO, 1, "compressor ratio",
1298 "2:1,4:1,6:1,10:1,limit", compressor_set, 5, 1284 "2:1,4:1,6:1,10:1,limit", compressor_set, 5,
1299 ID2P(LANG_COMPRESSOR_RATIO_2), ID2P(LANG_COMPRESSOR_RATIO_4), 1285 ID2P(LANG_COMPRESSOR_RATIO_2), ID2P(LANG_COMPRESSOR_RATIO_4),
1300 ID2P(LANG_COMPRESSOR_RATIO_6), ID2P(LANG_COMPRESSOR_RATIO_10), 1286 ID2P(LANG_COMPRESSOR_RATIO_6), ID2P(LANG_COMPRESSOR_RATIO_10),
1301 ID2P(LANG_COMPRESSOR_RATIO_LIMIT)), 1287 ID2P(LANG_COMPRESSOR_RATIO_LIMIT)),
1302 INT_SETTING_NOWRAP(F_SOUNDSETTING, compressor_makeup_gain,
1303 LANG_COMPRESSOR_GAIN, -1,
1304 "compressor makeup gain", UNIT_DB, -1, 20,
1305 1, auto_formatter, auto_getlang, compressor_set),
1306 CHOICE_SETTING(F_SOUNDSETTING|F_NO_WRAP, compressor_knee, 1288 CHOICE_SETTING(F_SOUNDSETTING|F_NO_WRAP, compressor_knee,
1307 LANG_COMPRESSOR_KNEE, 1, "compressor knee", 1289 LANG_COMPRESSOR_KNEE, 1, "compressor knee",
1308 "hard knee,soft knee", compressor_set, 2, 1290 "hard knee,soft knee", compressor_set, 2,
1309 ID2P(LANG_COMPRESSOR_HARD_KNEE), ID2P(LANG_COMPRESSOR_SOFT_KNEE)), 1291 ID2P(LANG_COMPRESSOR_HARD_KNEE), ID2P(LANG_COMPRESSOR_SOFT_KNEE)),
1310 INT_SETTING_NOWRAP(F_SOUNDSETTING, compressor_release_time, 1292 INT_SETTING_NOWRAP(F_SOUNDSETTING, compressor_release_time,
1311 LANG_COMPRESSOR_RELEASE, 100, 1293 LANG_COMPRESSOR_RELEASE, 500,
1312 "compressor release time", UNIT_MS, 20, 200, 1294 "compressor release time", UNIT_MS, 100, 1000,
1313 10, NULL, NULL, compressor_set), 1295 100, NULL, NULL, compressor_set),
1314#endif 1296#endif
1315#ifdef HAVE_WM8758 1297#ifdef HAVE_WM8758
1316 SOUND_SETTING(F_NO_WRAP, bass_cutoff, LANG_BASS_CUTOFF, 1298 SOUND_SETTING(F_NO_WRAP, bass_cutoff, LANG_BASS_CUTOFF,