This is specific to the Mac. It affects Macos 12 and probably other versions. Windows 11 works fine.
The AudioDeviceManager notifies ChangeListeners the first time a device connects but not for subsequent connetions or disconnections.
In my class I have something like this going on:
MyAudioManager (AudioDeviceManager& audioDeviceManager)
{
audioDeviceManager.addChangeListener (this);
}
void changeListenerCallback (ChangeBroadcaster* source) override
{
// called reliably on the PC but only seems to work once per device on the Mac
}
looking at juce_mac_CoreMidi.mm
, static void globalSystemChangeCallback(...)
contains a todo which I think is relevant.
It probably needs to act on these messages: Apple Developer Documentation
HTH