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) => {
|
||||
if (!node.isStream) {
|
||||
if (node.isSink) acc.sinks.push(node)
|
||||
else if (node.audio) acc.sources.push(node)
|
||||
if (node.isSink)
|
||||
acc.sinks.push(node);
|
||||
else if (node.audio)
|
||||
acc.sources.push(node);
|
||||
}
|
||||
return acc
|
||||
}, { sources: [], sinks: [] })
|
||||
return acc;
|
||||
}, {
|
||||
sources: [],
|
||||
sinks: []
|
||||
})
|
||||
|
||||
readonly property list<PwNode> sinks: nodes.sinks
|
||||
readonly property list<PwNode> sources: nodes.sources
|
||||
|
|
@ -26,16 +31,16 @@ Singleton {
|
|||
function setVolume(newVolume: real): void {
|
||||
if (sink?.ready && sink?.audio) {
|
||||
sink.audio.muted = false;
|
||||
sink.audio.volume = newVolume;
|
||||
sink.audio.volume = Math.max(0, Math.min(1, newVolume));
|
||||
}
|
||||
}
|
||||
|
||||
function setAudioSink(newSink: PwNode): void {
|
||||
Pipewire.preferredDefaultAudioSink = newSink
|
||||
Pipewire.preferredDefaultAudioSink = newSink;
|
||||
}
|
||||
|
||||
function setAudioSource(newSource: PwNode): void {
|
||||
Pipewire.preferredDefaultAudioSource = newSource
|
||||
Pipewire.preferredDefaultAudioSource = newSource;
|
||||
}
|
||||
|
||||
PwObjectTracker {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue