On Mac, I’m not getting notifications about device changes. Tracking it, in juce_Mac_coreAudio.cpp, we have at line 1356:
static OSStatus hardwareListenerProc (AudioDeviceID, UInt32, const AudioObjectPropertyAddress*, void* clientData)
{
static_cast <CoreAudioIODeviceType*> (clientData)->audioDeviceListChanged();
return noErr;
}
This never fires. But there is another function at line 1129:
[code] static OSStatus hardwareListenerProc (AudioDeviceID /inDevice/, UInt32 /inLine/, const AudioObjectPropertyAddress* pa, void* inClientData)
{
CoreAudioInternal* const intern = static_cast <CoreAudioInternal*> (inClientData);
switch (pa->mSelector)
{
[/code]
This does get triggered when I change devices, but it doesn’t do anything. pa->mSelector is ‘ownd’, which appears to be: kAudioObjectPropertyOwnedObjects, which is not in the same enum as the ones that function is checking for. Maybe the callback is registered to the wrong place?
With two static functions with the same name, is the compiler picking the wrong one?
Edit - godammit. After carefully debugging this, I kept running, and plugged a device back in, and the ‘correct’ function triggered. I can’t repeat it though. Am I meant to be doing anything on a timer? ScanForDevices or similar?
Edit 2 - I can’t recreate that result. The correct handler isn’t being called, so the listeners don’t get notified.
Bruce