diff options
author | Chris Robinson <[email protected]> | 2014-11-22 20:52:08 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2014-11-22 20:52:08 -0800 |
commit | 312330dbaae546bd0331c213dd55499f056091e7 (patch) | |
tree | e9b6a0dc9b332f66b463c90a209f0624e2068269 /Alc/alcConfig.c | |
parent | f7d7afb7c13b1b99b932b776f127d2ff5048b7f6 (diff) |
Rework HRTF decision logic
This way takes into account a new stereo-mode config option, which when set to
"headphones" will default to using HRTF. Eventually the device will also be
able to specify if headphones are being used.
Diffstat (limited to 'Alc/alcConfig.c')
-rw-r--r-- | Alc/alcConfig.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Alc/alcConfig.c b/Alc/alcConfig.c index a7d36a84..c8928c3c 100644 --- a/Alc/alcConfig.c +++ b/Alc/alcConfig.c @@ -514,6 +514,16 @@ int ConfigValueFloat(const char *blockName, const char *keyName, float *ret) return 1; } +int ConfigValueBool(const char *blockName, const char *keyName, int *ret) +{ + const char *val = GetConfigValue(blockName, keyName, ""); + if(!val[0]) return 0; + + *ret = (strcasecmp(val, "true") == 0 || strcasecmp(val, "yes") == 0 || + strcasecmp(val, "on") == 0 || atoi(val) != 0); + return 1; +} + int GetConfigValueBool(const char *blockName, const char *keyName, int def) { const char *val = GetConfigValue(blockName, keyName, ""); |