mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
fix(audio): scope stream volume overrides per media identity
This commit is contained in:
@@ -46,7 +46,7 @@ Item {
|
||||
quickSwitchTimer.stop();
|
||||
}
|
||||
|
||||
function dismissToast(){
|
||||
function dismissToast() {
|
||||
if (windowLoader.item) {
|
||||
hideTimer.stop();
|
||||
windowLoader.item.hideToast();
|
||||
|
||||
@@ -307,7 +307,7 @@ Singleton {
|
||||
objects: [...root.sinks, ...root.sources]
|
||||
}
|
||||
|
||||
// Per-app volume persistence (survives stream recreation on track change/seek)
|
||||
// Per-stream volume overrides (app + media identity) so concurrent browser streams do not share one entry.
|
||||
property var appVolumeOverrides: ({})
|
||||
property var _knownAppStreamIds: ({})
|
||||
property bool _isApplyingAppOverride: false
|
||||
@@ -360,21 +360,41 @@ Singleton {
|
||||
return "";
|
||||
}
|
||||
var props = node.properties;
|
||||
var base = "";
|
||||
var binary = props["application.process.binary"] || "";
|
||||
if (binary) {
|
||||
var parts = binary.split("/");
|
||||
return parts[parts.length - 1].toLowerCase();
|
||||
base = parts[parts.length - 1].toLowerCase();
|
||||
}
|
||||
var appName = props["application.name"] || "";
|
||||
if (appName) {
|
||||
return appName.toLowerCase();
|
||||
if (!base) {
|
||||
var appName = props["application.name"] || "";
|
||||
if (appName) {
|
||||
base = appName.toLowerCase();
|
||||
}
|
||||
}
|
||||
var appId = props["application.id"] || "";
|
||||
if (appId) {
|
||||
return appId.toLowerCase();
|
||||
if (!base) {
|
||||
var appId = props["application.id"] || "";
|
||||
if (appId) {
|
||||
base = appId.toLowerCase();
|
||||
}
|
||||
}
|
||||
if (!base) {
|
||||
return "";
|
||||
}
|
||||
|
||||
return "";
|
||||
var mediaName = (props["media.name"] || "").trim().toLowerCase();
|
||||
var mediaRole = (props["media.role"] || "").trim().toLowerCase();
|
||||
var tagParts = [];
|
||||
if (mediaName) {
|
||||
tagParts.push(mediaName);
|
||||
}
|
||||
if (mediaRole) {
|
||||
tagParts.push(mediaRole);
|
||||
}
|
||||
if (tagParts.length > 0) {
|
||||
return base + "\u001f" + tagParts.join("\u001e");
|
||||
}
|
||||
return base + "\u001f" + String(node.id);
|
||||
}
|
||||
|
||||
function setAppStreamVolume(appKey: string, volume: real): void {
|
||||
|
||||
@@ -10,7 +10,7 @@ Singleton {
|
||||
// actionLabel: optional label for clickable action link
|
||||
// actionCallback: optional function to call when action is clicked
|
||||
signal notify(string title, string description, string icon, string type, int duration, string actionLabel, var actionCallback)
|
||||
signal dismiss()
|
||||
signal dismiss
|
||||
|
||||
// Convenience methods
|
||||
function showNotice(title, description = "", icon = "", duration = 3000, actionLabel = "", actionCallback = null) {
|
||||
@@ -25,7 +25,7 @@ Singleton {
|
||||
notify(title, description, "", "error", duration, actionLabel, actionCallback);
|
||||
}
|
||||
|
||||
function dismissToast(){
|
||||
function dismissToast() {
|
||||
dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user