aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2023-10-23 17:48:42 -0700
committerChris Robinson <[email protected]>2023-10-23 17:48:42 -0700
commita90d8a6f92536111b970e12b4c83da8a82e48f2f (patch)
tree3dfc4d086cf721b883f1b582f54c805416350574
parent6435744f7a1f7995a80309eb8b66468c0c7e732b (diff)
Print the HRTF used in openal-info
-rw-r--r--utils/openal-info.c19
1 files 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 : "<null>");
+ }
}
static void printALInfo(void)