From d88f3a9ade9e2d6352966250519537b3c79440bf Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Sun, 10 Dec 2023 21:21:00 +0000 Subject: [PATCH] Document the counterintuitive behaviour of hs.audiodevice objects. Closes #3559 --- extensions/audiodevice/audiodevice.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/extensions/audiodevice/audiodevice.lua b/extensions/audiodevice/audiodevice.lua index 150466c96..69e5ed4ec 100644 --- a/extensions/audiodevice/audiodevice.lua +++ b/extensions/audiodevice/audiodevice.lua @@ -3,6 +3,9 @@ --- Manipulate the system's audio devices --- --- This module is based primarily on code from the previous incarnation of Mjolnir by [Steven Degutis](https://github.com/sdegutis/). +--- +--- Note: +--- * Objects created by this module are distinct from each other - if you fetch an audiodevice and set a watcher on it, then fetch the audiodevice again, the watcher will only be visible from the first object and not the second. To avoid losing reference to watchers, you can store the audiodevice objects in a Lua table. local module = require("hs.libaudiodevice") module.watcher = require("hs.libaudiodevicewatcher")