From a90d8a6f92536111b970e12b4c83da8a82e48f2f Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Mon, 23 Oct 2023 17:48:42 -0700 Subject: Print the HRTF used in openal-info --- utils/openal-info.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/utils/openal-info.c b/utils/openal-info.c index b646693c..0af27422 100644 --- a/utils/openal-info.c +++ b/utils/openal-info.c @@ -167,11 +167,11 @@ static void printHRTFInfo(ALCdevice *device) alcGetIntegerv(device, ALC_NUM_HRTF_SPECIFIERS_SOFT, 1, &num_hrtfs); if(!num_hrtfs) - printf("No HRTFs found\n"); + printf("No HRTF profiles found\n"); else { ALCint i; - printf("Available HRTFs:\n"); + printf("Available HRTF profiles:\n"); for(i = 0;i < num_hrtfs;++i) { const ALCchar *name = alcGetStringiSOFT(device, ALC_HRTF_SPECIFIER_SOFT, i); @@ -213,6 +213,21 @@ static void printModeInfo(ALCdevice *device) alcGetIntegerv(device, ALC_FREQUENCY, 1, &srate); if(checkALCErrors(device) == ALC_NO_ERROR) printf("Device sample rate: %dhz\n", srate); + + if(alcIsExtensionPresent(device, "ALC_SOFT_HRTF")) + { + const ALCchar *hrtfname = "(disabled)"; + ALCint isenabled = 0; + + alcGetIntegerv(device, ALC_HRTF_SOFT, 1, &isenabled); + checkALCErrors(device); + if(isenabled == ALC_TRUE) + { + hrtfname = alcGetString(device, ALC_HRTF_SPECIFIER_SOFT); + checkALCErrors(device); + } + printf("Device HRTF profile: %s\n", hrtfname ? hrtfname : ""); + } } static void printALInfo(void) -- cgit v1.2.3