diff options
author | Chris Robinson <[email protected]> | 2015-05-16 01:06:26 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2015-05-16 01:06:26 -0700 |
commit | 80f0b5e736eaf4a19b6a0de8666e055816cba043 (patch) | |
tree | fd65a20762a59ef15a8dba074638fa2bbf4273be | |
parent | 0f51b6df4ba9f93048cd9aa10dcd845527ae9cc6 (diff) |
Add a few more HRTF status values
DISABLED - Generic disabled status
ENABLED - Generic enabled status
DENIED - Not allowed (user has configured HRTF to be off)
REQUIRED - Forced (user has forced HRTF to be used)
HEADPHONES_DETECTED - Enabled because headphones were detected
UNSUPPORTED_FORMAT - Device format is not compatible with available filters
-rw-r--r-- | Alc/ALc.c | 22 | ||||
-rw-r--r-- | OpenAL32/Include/alMain.h | 5 |
2 files changed, 23 insertions, 4 deletions
@@ -1991,6 +1991,7 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList) { bool headphones = device->IsHeadphones; enum HrtfMode hrtf_mode = FullHrtf; + ALCenum hrtf_status = device->Hrtf_Status; const char *mode; int bs2blevel; int usehrtf; @@ -2020,9 +2021,24 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList) if(device->Type == Loopback || !ConfigValueBool(NULL, "hrtf", &usehrtf)) - usehrtf = ((device->Flags&DEVICE_HRTF_REQUEST) || headphones); + { + usehrtf = (headphones || (device->Flags&DEVICE_HRTF_REQUEST)); + if(headphones) + hrtf_status = ALC_HRTF_HEADPHONES_DETECTED_SOFT; + else if(usehrtf) + hrtf_status = ALC_HRTF_ENABLED_SOFT; + } + else + { + if(!usehrtf) + hrtf_status = ALC_HRTF_DENIED_SOFT; + else + hrtf_status = ALC_HRTF_REQUIRED_SOFT; + } - if(usehrtf) + if(!usehrtf) + device->Hrtf_Status = hrtf_status; + else { device->Hrtf_Status = ALC_HRTF_UNSUPPORTED_FORMAT_SOFT; device->Hrtf = GetHrtf(device->FmtChans, device->Frequency); @@ -2030,7 +2046,7 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList) if(device->Hrtf) { device->Hrtf_Mode = hrtf_mode; - device->Hrtf_Status = ALC_HRTF_ENABLED_SOFT; + device->Hrtf_Status = hrtf_status; TRACE("HRTF enabled\n"); free(device->Bs2b); device->Bs2b = NULL; diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index fb2d810e..2b590979 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -45,7 +45,10 @@ #define ALC_HRTF_STATUS_SOFT 0x1993 #define ALC_HRTF_DISABLED_SOFT 0x0000 #define ALC_HRTF_ENABLED_SOFT 0x0001 -#define ALC_HRTF_UNSUPPORTED_FORMAT_SOFT 0x0002 +#define ALC_HRTF_DENIED_SOFT 0x0002 +#define ALC_HRTF_REQUIRED_SOFT 0x0003 +#define ALC_HRTF_HEADPHONES_DETECTED_SOFT 0x0004 +#define ALC_HRTF_UNSUPPORTED_FORMAT_SOFT 0x0005 #endif #ifndef ALC_SOFT_midi_interface |