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 /Alc/ALc.c | |
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
Diffstat (limited to 'Alc/ALc.c')
-rw-r--r-- | Alc/ALc.c | 22 |
1 files changed, 19 insertions, 3 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; |