Unhardcode WASAPI default settings

This commit is contained in:
Monroe88 2017-04-28 21:40:24 -05:00
parent 9d20af4249
commit ada900e1e1
3 changed files with 13 additions and 6 deletions

View File

@ -792,6 +792,13 @@ static const float max_timing_skew = 0.05;
/* Default audio volume in dB. (0.0 dB == unity gain). */
static const float audio_volume = 0.0;
#ifdef HAVE_WASAPI
/* WASAPI defaults */
static const bool wasapi_exclusive_mode = true;
static const bool wasapi_float_format = false;
static const unsigned wasapi_sh_buffer_length = 0;
#endif
/* MISC */
/* Enables displaying the current frames per second. */

View File

@ -876,8 +876,8 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings,
SETTING_BOOL("input_autodetect_enable", &settings->bools.input_autodetect_enable, true, input_autodetect_enable, false);
SETTING_BOOL("audio_rate_control", &settings->bools.audio_rate_control, true, rate_control, false);
#ifdef HAVE_WASAPI
SETTING_BOOL("audio_wasapi_exclusive_mode", &settings->bools.audio_wasapi_exclusive_mode, true, true, false);
SETTING_BOOL("audio_wasapi_float_format", &settings->bools.audio_wasapi_float_format, true, false, false);
SETTING_BOOL("audio_wasapi_exclusive_mode", &settings->bools.audio_wasapi_exclusive_mode, true, wasapi_exclusive_mode, false);
SETTING_BOOL("audio_wasapi_float_format", &settings->bools.audio_wasapi_float_format, true, wasapi_float_format, false);
#endif
if (global)
@ -990,7 +990,7 @@ static struct config_uint_setting *populate_settings_uint(settings_t *settings,
SETTING_UINT("bundle_assets_extract_version_current", &settings->uints.bundle_assets_extract_version_current, true, 0, false);
SETTING_UINT("bundle_assets_extract_last_version", &settings->uints.bundle_assets_extract_last_version, true, 0, false);
#ifdef HAVE_WASAPI
SETTING_UINT("audio_wasapi_sh_buffer_length", &settings->uints.audio_wasapi_sh_buffer_length, true, 0, false);
SETTING_UINT("audio_wasapi_sh_buffer_length", &settings->uints.audio_wasapi_sh_buffer_length, true, wasapi_sh_buffer_length, false);
#endif
*size = count;

View File

@ -3931,7 +3931,7 @@ static bool setting_append_list(
&settings->bools.audio_wasapi_exclusive_mode,
MENU_ENUM_LABEL_AUDIO_WASAPI_EXCLUSIVE_MODE,
MENU_ENUM_LABEL_VALUE_AUDIO_WASAPI_EXCLUSIVE_MODE,
true,
wasapi_exclusive_mode,
MENU_ENUM_LABEL_VALUE_OFF,
MENU_ENUM_LABEL_VALUE_ON,
&group_info,
@ -3947,7 +3947,7 @@ static bool setting_append_list(
&settings->bools.audio_wasapi_float_format,
MENU_ENUM_LABEL_AUDIO_WASAPI_FLOAT_FORMAT,
MENU_ENUM_LABEL_VALUE_AUDIO_WASAPI_FLOAT_FORMAT,
true,
wasapi_float_format,
MENU_ENUM_LABEL_VALUE_OFF,
MENU_ENUM_LABEL_VALUE_ON,
&group_info,
@ -3963,7 +3963,7 @@ static bool setting_append_list(
&settings->uints.audio_wasapi_sh_buffer_length,
MENU_ENUM_LABEL_AUDIO_WASAPI_SH_BUFFER_LENGTH,
MENU_ENUM_LABEL_VALUE_AUDIO_WASAPI_SH_BUFFER_LENGTH,
0,
wasapi_sh_buffer_length,
&group_info,
&subgroup_info,
parent_group,