diff options
-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 |