Getting AudioDevice events


#1

I’d like to be notified in my app when an audio device appears or disappears from the computer’s network.

I can create a new AudioIODevice to get access to a particular device,
and this class creates a CoreAudioInternal that registers for AudioDevice
changes, but I don’t see how to access the function called by the callback (DeviceDetailsChanged) from my AudioIODevice pointer.

To do this without altering juce code, it looks as if I need to create two new classes, a new version of AudioIODevice that will use a new version of CoreAudioInternal. This CoreAudioInternal class can then override DeviceDetaisChanged to keep track of device comings and goings.

Is there a simpler way?


#2

Well I’ve not put anything in there to handle that kind of event. The way it would best be done would be via the AudioIODeviceType class, which could tell you when instances of that type of device come and go. I’ll pop it on my list, but don’t think I’ll have time to do anything soon.


#3

Am I missing something then? The CoreAudioInternal class has a deviceListenerProc callback that has registered for all types of events. One of the ones listed is kAudioDevicePropertyDeviceIsAlive, which the docs say is 1 when the device is ready and available, and 0 when the device is
unusable and will go away shortly.


#4

Am I missing something then? The CoreAudioInternal class has a deviceListenerProc callback that has registered for all types of events. One of the ones listed is kAudioDevicePropertyDeviceIsAlive, which the docs say is 1 when the device is ready and available, and 0 when the device is
unusable and will go away shortly.[/quote]

that’s not much use without a mechanism for sending the event to clients, and there’d need to be similar support on windows and linux.


#5