From 8860619a5e5a8a9d06b6724205c07d795726091e Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sun, 31 Dec 2017 21:25:07 +0100 Subject: [PATCH] Add audio_resampler_quality to config file --- audio/audio_driver.c | 17 ++++++----------- config.def.h | 9 +++++++++ configuration.c | 1 + configuration.h | 2 +- 4 files changed, 17 insertions(+), 12 deletions(-) diff --git a/audio/audio_driver.c b/audio/audio_driver.c index 520eb91d33..d262bbe79c 100644 --- a/audio/audio_driver.c +++ b/audio/audio_driver.c @@ -183,17 +183,12 @@ static void *audio_driver_context_audio_data = NULL; enum resampler_quality audio_driver_get_resampler_quality(void) { -#if defined(SINC_LOWEST_QUALITY) - return RESAMPLER_QUALITY_LOWEST; -#elif defined(SINC_LOWER_QUALITY) - return RESAMPLER_QUALITY_LOWER; -#elif defined(SINC_HIGHER_QUALITY) - return RESAMPLER_QUALITY_HIGHER; -#elif defined(SINC_HIGHEST_QUALITY) - return RESAMPLER_QUALITY_HIGHEST; -#else - return RESAMPLER_QUALITY_NORMAL; -#endif + settings_t *settings = config_get_ptr(); + + if (!settings) + return RESAMPLER_QUALITY_DONTCARE; + + return (enum resampler_quality)settings->uints.audio_resampler_quality; } /** diff --git a/config.def.h b/config.def.h index edf900917a..e1bf8c876e 100644 --- a/config.def.h +++ b/config.def.h @@ -19,6 +19,7 @@ #define __CONFIG_DEF_H #include +#include