diff options
| author | Danilo M. <danix@danix.xyz> | 2026-09-14 13:03:51 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-09-14 13:03:51 +0200 |
| commit | 3dee371ed7e460d68018839e0ff17b436e2c6b52 (patch) | |
| tree | 4b976e375b0c3daf5fbaa72b4d9fa4529275f061 /desktop/modules/sound/Service.qml | |
| parent | 60eae607ab75988fc441bb4d87ef790175009572 (diff) | |
| download | quickshell-3dee371ed7e460d68018839e0ff17b436e2c6b52.tar.gz quickshell-3dee371ed7e460d68018839e0ff17b436e2c6b52.zip | |
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.
Diffstat (limited to 'desktop/modules/sound/Service.qml')
| -rw-r--r-- | desktop/modules/sound/Service.qml | 12 |
1 files changed, 12 insertions, 0 deletions
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 |
