[Openal-devel] ALC_ENUMERATE_ALL_EXT and pluggable sound devices

Ryan C. Gordon icculus at icculus.org
Thu Sep 17 21:43:14 PDT 2009


> I think this could be a good option, but the ALX_EXT_disconnect 
> extension does not explicitly require this behavior, and so the 
> implementors can't trust on it... It should be implemented in a more 
> robust way, in such a way the implementors don't get confused about what 
> will happen after this OpenAL call.

ALC_EXT_disconnect says that you find out about new devices by 
reenumerating.

I don't really know that we need to set a flag to alert apps (or the 
router) that the device list has changed. This code isn't really a 
killer if you run it once once every five seconds (or even once a frame)...

   // ignore that C string funcs fail on the null-separated list for now.
   current_devices = alcGetString(NULL,ALC_DEVICE_SPECIFIER);
   if (strcmp(current_devices, previous_devices) != 0) {
      // handle device list change here, if for some reason you need to.
      free(previous_devices);
      previous_devices = strdup(current_devices);
   }


--ryan.


More information about the Openal-devel mailing list