Best I can tell, hs.audiodevice.watcher only supports a single callback and there doesn't seem to be a good way for multiple pieces of code to to loosely coordinate to chain their watcher functions.
By that I mean a piece of code might be able to tell with isRunning() that a different piece of code has a watcher function installed, but I don't see any way to get that watcher function such that one can gracefully chain it. Two unrelated pieces of code using hs.audiodevice.watcher would need an out-of-band way of coordinating such that both can function.
Ideally, hs.audiodevice.watcher would be similar to hs.application.watcher and support a new() method so that unrelated pieces of code could each have their own callback without interfering with each other.
Best I can tell, hs.audiodevice.watcher only supports a single callback and there doesn't seem to be a good way for multiple pieces of code to to loosely coordinate to chain their watcher functions.
By that I mean a piece of code might be able to tell with isRunning() that a different piece of code has a watcher function installed, but I don't see any way to get that watcher function such that one can gracefully chain it. Two unrelated pieces of code using hs.audiodevice.watcher would need an out-of-band way of coordinating such that both can function.
Ideally, hs.audiodevice.watcher would be similar to hs.application.watcher and support a new() method so that unrelated pieces of code could each have their own callback without interfering with each other.