Closed alx242 closed 1 year ago
Perhaps the wording is a little unclear, but it's true that the proxy device does not disappear. For that setting, "active" is about when the proxy device is technically playing audio as far as macOS is considered, since so long as its active and playing audio, the system will not go to sleep.
Aha, got it :)
Would it perhaps be a valid feature request instead then or?
Sure, I can consider that a feature request. But I've had so little time to work on this lately that I can't promise anything.
Hi, I know that this is closed but this is the only thing that keeps this app from being perfect. How can we achieve this functionality? I'm a java developer - I've never written macOS apps but I'm happy to try and help.
@mwadeladdi I would certainly welcome a pull request that implements this feature. I think this is probably a tricky thing to dive into if you're not used to C++ or macOS programming, especially because Apple's documentation about this sort of audio plug-in is pretty much non-existent. I'm not even sure how this should be implemented yet! But somewhere in ProxyAudioDevice.cpp is a bit that tells the system whether or not the virtual (i.e. proxy) device is connected. You could add some logic that updates it so that when the proxied device is missing then the proxy device signals that it is disconnected somehow.
I can at least point to where in the code the proxied device is detected as being connected or disconnected.
When it finds and starts setting up the proxied device, execution hits this line:
DebugMsg("ProxyAudio: setupTargetOutputDevice setting up new device");
When the proxied device disconnects, execution will hit this line:
DebugMsg("ProxyAudio: outputDeviceAliveListener output device no longer alive");
I assumed that if the proxied device wasn't present anymore that also the proxy audio device would be removed.
At least that is how I interpreted the setting "Proxy Device is active: When proxied device is active".
For me the proxy device is there event though the plugged in HDMI device is removed and its device is disappears.