Names for link groups, shown as coloured brackets above the mixer strips

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
GivouandClaude Opus 5.5 committed 2026-11-02 00:05:55 +01:00
1 parent 83548c9620
commit 4b33fc2665
7 files changed
+97 -14

No files matched your search

+16 -1
View File
@@ -154,6 +154,16 @@ def clean_colors(v) -> dict:
return out
def clean_linknames(v) -> dict:
"""Names of link groups, keyed by kind and members: {"out:0,1": "Tops"}. A changed group loses its name."""
out = {}
for k, n in (v.items() if isinstance(v, dict) else []):
n = "".join(c for c in str(n) if c.isprintable()).strip()[:16]
if n and re.fullmatch(r"(in|out):\d{1,2}(,\d{1,2})+", str(k)):
out[str(k)] = n
return out
def clean_maxgain(v) -> dict:
"""Software gain limits per channel: {"in0": raw 0..399} (400 = +12 dB would be no limit)."""
out = {}
@@ -327,7 +337,7 @@ class App:
transport="usb" if usb else "tcp", usb=str(d.get("usb") or ""),
lock_code=str(d.get("lock_code") or ""), auto_unlock=bool(d.get("auto_unlock")),
test_saved=clean_gains(d.get("test_saved")), colors=clean_colors(d.get("colors")),
maxgain=clean_maxgain(d.get("maxgain")))
maxgain=clean_maxgain(d.get("maxgain")), linknames=clean_linknames(d.get("linknames")))
dev.on_online = self.device_online
self.devices[dev_id] = dev
if dev.autoconnect:
@@ -861,6 +871,11 @@ class App:
self.save()
self.broadcast({"type": "device", "device": dev.id, "data": dev.snapshot()})
return {"ok": True, "colors": dev.colors}
if action == "linknames": # display only, like the colours
dev.linknames = clean_linknames(body.get("linknames"))
self.save()
self.broadcast({"type": "device", "device": dev.id, "data": dev.snapshot()})
return {"ok": True, "linknames": dev.linknames}
if action == "test":
return await self.audio_test(dev, body)
if action == "testlevel":