import QtQuick Item { property real volume: 0.4 property int volumeWrites: 0 property int muteWrites: 0 property int externalUpdates: 0 property bool manyDevices: false function sinkRow() { return { "id": "sink-fixture", "name": "fixture output", "glyph": "", "role": "ui.accent", "muted": false, "percent": Math.round(volume * 100), "isDefault": true }; } function stateJson() { return JSON.stringify({ "sinks": [sinkRow()].concat(manyDevices ? Array.from({ length: 12 }, (_, i) => Object.assign({}, sinkRow(), { id: `sink-${i}`, name: `additional output ${i}`, isDefault: false })) : []), "sources": [], "streams": [] }); } function setVolume(id, ratio) { volume = Number(ratio); volumeWrites++; return stateJson(); } function toggleMute(id) { muteWrites++; return stateJson(); } function setDefaultSink(id) { return stateJson(); } function setDefaultSource(id) { return stateJson(); } function privacyLabel() { return "audio"; } function privacyActive() { return false; } function externalUpdate() { volume = 0.8; externalUpdates++; } }