From 3dee371ed7e460d68018839e0ff17b436e2c6b52 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Mon, 14 Sep 2026 13:03:51 +0200 Subject: feat(sound): switch default device, control the level The sound page showed the default sink and source but gave no way to choose another device and the meter was inert. Each section now lists the real audio devices, streams and monitor nodes filtered out, behind an in-place dropdown that sets Pipewire.preferredDefaultAudioSink or preferredDefaultAudioSource. The meter takes the wheel, click and drag, and the state glyph beside the percentage toggles mute. The list expands in place rather than in a popup because a QtQuick.Controls popup is a separate window and does not position reliably on a layer surface. The meter accepts the wheel and prevents stealing so the page's ScrollView neither scrolls nor flicks instead. --- desktop/modules/sound/Service.qml | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'desktop/modules/sound/Service.qml') diff --git a/desktop/modules/sound/Service.qml b/desktop/modules/sound/Service.qml index e509a94..22a4520 100644 --- a/desktop/modules/sound/Service.qml +++ b/desktop/modules/sound/Service.qml @@ -24,6 +24,18 @@ Scope { readonly property real volume: sink?.audio?.volume ?? 0 readonly property bool muted: sink?.audio?.muted ?? false + // The devices that can be made the default. A stream is an application, + // not a device, and a monitor node is the loopback view of a sink rather + // than something to record from, so both are filtered out. `isSink` true + // means the node accepts audio (an output device); false means it outputs + // audio (an input device, a microphone). + readonly property var outputs: + Pipewire.nodes.values.filter(n => n.audio && !n.isStream && n.isSink + && !String(n.name).endsWith(".monitor")) + readonly property var inputs: + Pipewire.nodes.values.filter(n => n.audio && !n.isStream && !n.isSink + && !String(n.name).endsWith(".monitor")) + // Which node changed last, and whether it was the input. The OSD draws // this one; null means nothing to show. property PwNode active: null -- cgit v1.2.3