audio: optional stream nodes in device lists

fixes #1672
This commit is contained in:
bbedward
2026-08-28 10:17:26 -04:00
parent 54a64eb0b2
commit 07f89e314f
5 changed files with 71 additions and 6 deletions
+1
View File
@@ -229,6 +229,7 @@ Singleton {
property bool showWeekNumber: false
property string calendarBackend: "auto"
property string defaultTaskCalendarId: ""
property bool audioShowStreamDevices: false
property string clockFormat: "auto"
readonly property bool localeUses24Hour: {
const fmt = Qt.locale().timeFormat(Locale.ShortFormat).replace(/'[^']*'/g, "");
@@ -79,6 +79,7 @@ var SPEC = {
showWeekNumber: { def: false },
calendarBackend: { def: "auto" },
defaultTaskCalendarId: { def: "" },
audioShowStreamDevices: { def: false },
clockFormat: { def: "auto", onChange: "markGreeterSyncPending" },
showSeconds: { def: false, onChange: "markGreeterSyncPending" },
padHours12Hour: { def: false, onChange: "markGreeterSyncPending" },
+19 -2
View File
@@ -50,12 +50,12 @@ Item {
};
const outputs = allNodes.filter(node => {
return node.audio && node.isSink && !node.isStream;
return node.audio && node.isSink && (SettingsData.audioShowStreamDevices || !node.isStream);
});
outputDevices = outputs.sort(sortDevices);
const inputs = allNodes.filter(node => {
return node.audio && !node.isSink && !node.isStream;
return node.audio && !node.isSink && (SettingsData.audioShowStreamDevices || !node.isStream);
});
const sortInputs = (a, b) => {
@@ -84,6 +84,13 @@ Item {
}
}
Connections {
target: SettingsData
function onAudioShowStreamDevicesChanged() {
root.updateDeviceList();
}
}
Connections {
target: AudioService
function onWireplumberReloadStarted() {
@@ -133,6 +140,16 @@ Item {
width: parent.width
spacing: Theme.spacingM
SettingsToggleRow {
tab: "audio"
tags: ["audio", "virtual", "stream", "obs", "loopback", "device"]
settingKey: "audioShowStreamDevices"
text: I18n.tr("Show Virtual Devices")
description: I18n.tr("Include application streams and virtual sinks in the device lists")
checked: SettingsData.audioShowStreamDevices
onToggled: checked => SettingsData.set("audioShowStreamDevices", checked)
}
StyledText {
width: parent.width
text: I18n.tr("Set custom names for your audio output devices", "Audio settings description")
+10 -3
View File
@@ -99,7 +99,7 @@ Singleton {
function getAvailableSinks() {
const hidden = SessionData.hiddenOutputDeviceNames ?? [];
return Pipewire.nodes.values.filter(node => node.audio && node.isSink && !node.isStream && !hidden.includes(node.name));
return Pipewire.nodes.values.filter(node => node.audio && node.isSink && (SettingsData.audioShowStreamDevices || !node.isStream) && !hidden.includes(node.name));
}
property list<PwNode> typedSinks: []
@@ -109,7 +109,7 @@ Singleton {
const newSinks = [];
const newSources = [];
for (const node of Pipewire.nodes.values) {
if (!node?.audio || node.isStream)
if (!node?.audio || (node.isStream && !SettingsData.audioShowStreamDevices))
continue;
if (node.isSink)
newSinks.push(node);
@@ -127,6 +127,13 @@ Singleton {
}
}
Connections {
target: SettingsData
function onAudioShowStreamDevicesChanged() {
root.rebuildTypedNodeLists();
}
}
function setSink(node: PwNode): bool {
if (!node)
return false;
@@ -958,7 +965,7 @@ EOFCONFIG
}
PwObjectTracker {
objects: Pipewire.nodes.values.filter(node => node.audio && !node.isStream)
objects: Pipewire.nodes.values.filter(node => node.audio && (SettingsData.audioShowStreamDevices || !node.isStream))
}
function setVolume(percentage) {
@@ -9025,18 +9025,57 @@
"tabIndex": 29,
"category": "Audio",
"keywords": [
"app",
"application",
"audio",
"device",
"devices",
"headphones",
"include",
"lists",
"microphone",
"output",
"pipewire",
"program",
"sinks",
"sound",
"speaker",
"streams",
"virtual",
"volume"
],
"icon": "volume_up"
"icon": "volume_up",
"description": "Include application streams and virtual sinks in the device lists"
},
{
"section": "audioShowStreamDevices",
"label": "Show Virtual Devices",
"tabIndex": 29,
"category": "Audio",
"keywords": [
"app",
"application",
"audio",
"device",
"devices",
"headphones",
"include",
"lists",
"loopback",
"microphone",
"obs",
"pipewire",
"program",
"show",
"sinks",
"sound",
"speaker",
"stream",
"streams",
"virtual",
"volume"
],
"description": "Include application streams and virtual sinks in the device lists"
},
{
"section": "_tab_29",