mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-04 04:42:05 -04:00
audio: fix cycle output, improve icon resolution for sink fixes #1808
This commit is contained in:
@@ -22,27 +22,14 @@ DankOSD {
|
||||
text: root.deviceName
|
||||
}
|
||||
|
||||
function getIconForSink(sink) {
|
||||
if (!sink)
|
||||
return "speaker";
|
||||
const name = sink.name || "";
|
||||
if (name.includes("bluez"))
|
||||
return "headset";
|
||||
if (name.includes("hdmi"))
|
||||
return "tv";
|
||||
if (name.includes("usb"))
|
||||
return "headset";
|
||||
return "speaker";
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: AudioService
|
||||
|
||||
function onAudioOutputCycled(name) {
|
||||
function onAudioOutputCycled(name, icon) {
|
||||
if (!SettingsData.osdAudioOutputEnabled)
|
||||
return;
|
||||
root.deviceName = name;
|
||||
root.deviceIcon = getIconForSink(AudioService.sink);
|
||||
root.deviceIcon = icon;
|
||||
root.show();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user