diff --git a/interface/src/scripting/Audio.h b/interface/src/scripting/Audio.h index 4b8eb6aabc..738eeb5dfe 100644 --- a/interface/src/scripting/Audio.h +++ b/interface/src/scripting/Audio.h @@ -50,6 +50,8 @@ class Audio : public AudioScriptingInterface, protected ReadWriteLockable { * Read-only. * @property {object} devices Read-only. Deprecated: This property is deprecated and will be * removed. + * @property {boolean} isSoloing Read-only. true if any nodes are soloed. + * @property {QVector} soloList Read-only. Get the list of currently soloed node UUIDs. */ Q_PROPERTY(bool muted READ isMuted WRITE setMuted NOTIFY mutedChanged) diff --git a/libraries/script-engine/src/AudioScriptingInterface.h b/libraries/script-engine/src/AudioScriptingInterface.h index 7808a86566..ba570fd7c0 100644 --- a/libraries/script-engine/src/AudioScriptingInterface.h +++ b/libraries/script-engine/src/AudioScriptingInterface.h @@ -32,25 +32,43 @@ public: virtual ~AudioScriptingInterface() = default; void setLocalAudioInterface(AbstractAudioInterface* audioInterface); -protected: - AudioScriptingInterface() = default; - bool isSoloing() const { return _localAudioInterface->getAudioSolo().isSoloing(); } + QVector getSoloList() const { return _localAudioInterface->getAudioSolo().getUUIDs(); } + + /**jsdoc + * Add nodes to the audio solo list + * @function Audio.addToSoloList + * @param {QVector} uuidList - List of node UUIDs to add to the solo list. + */ Q_INVOKABLE void addToSoloList(QVector uuidList) { _localAudioInterface->getAudioSolo().addUUIDs(uuidList); } + + /**jsdoc + * Remove nodes from the audio solo list + * @function Audio.removeFromSoloList + * @param {QVector} uuidList - List of node UUIDs to remove from the solo list. + */ Q_INVOKABLE void removeFromSoloList(QVector uuidList) { _localAudioInterface->getAudioSolo().removeUUIDs(uuidList); } + + /**jsdoc + * Reset the list of soloed nodes. + * @function Audio.resetSoloList + */ Q_INVOKABLE void resetSoloList() { _localAudioInterface->getAudioSolo().reset(); } +protected: + AudioScriptingInterface() = default; + // these methods are protected to stop C++ callers from calling, but invokable from script /**jsdoc