parent
8cc78cfaf3
commit
a7990173b4
1 changed files with 12 additions and 7 deletions
|
|
@ -8,11 +8,16 @@ Singleton {
|
||||||
|
|
||||||
readonly property var nodes: Pipewire.nodes.values.reduce((acc, node) => {
|
readonly property var nodes: Pipewire.nodes.values.reduce((acc, node) => {
|
||||||
if (!node.isStream) {
|
if (!node.isStream) {
|
||||||
if (node.isSink) acc.sinks.push(node)
|
if (node.isSink)
|
||||||
else if (node.audio) acc.sources.push(node)
|
acc.sinks.push(node);
|
||||||
|
else if (node.audio)
|
||||||
|
acc.sources.push(node);
|
||||||
}
|
}
|
||||||
return acc
|
return acc;
|
||||||
}, { sources: [], sinks: [] })
|
}, {
|
||||||
|
sources: [],
|
||||||
|
sinks: []
|
||||||
|
})
|
||||||
|
|
||||||
readonly property list<PwNode> sinks: nodes.sinks
|
readonly property list<PwNode> sinks: nodes.sinks
|
||||||
readonly property list<PwNode> sources: nodes.sources
|
readonly property list<PwNode> sources: nodes.sources
|
||||||
|
|
@ -26,16 +31,16 @@ Singleton {
|
||||||
function setVolume(newVolume: real): void {
|
function setVolume(newVolume: real): void {
|
||||||
if (sink?.ready && sink?.audio) {
|
if (sink?.ready && sink?.audio) {
|
||||||
sink.audio.muted = false;
|
sink.audio.muted = false;
|
||||||
sink.audio.volume = newVolume;
|
sink.audio.volume = Math.max(0, Math.min(1, newVolume));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function setAudioSink(newSink: PwNode): void {
|
function setAudioSink(newSink: PwNode): void {
|
||||||
Pipewire.preferredDefaultAudioSink = newSink
|
Pipewire.preferredDefaultAudioSink = newSink;
|
||||||
}
|
}
|
||||||
|
|
||||||
function setAudioSource(newSource: PwNode): void {
|
function setAudioSource(newSource: PwNode): void {
|
||||||
Pipewire.preferredDefaultAudioSource = newSource
|
Pipewire.preferredDefaultAudioSource = newSource;
|
||||||
}
|
}
|
||||||
|
|
||||||
PwObjectTracker {
|
PwObjectTracker {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue