Add channel colours: per channel or link group, unique per DSP, shown in mixer, channel view, routing and overlays

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
GivouandClaude Opus 5.5 committed 2026-11-01 22:52:21 +01:00
1 parent a7ee66d761
commit eb647f62a9
6 files changed
+141 -11

No files matched your search

+5 -2
View File
@@ -21,7 +21,8 @@ LINK_RESYNC_DELAY = 1.5 # re-read the config this long after the last change on
class Device:
def __init__(self, dev_id: str, name: str, host: str, port: int = P.PORT, model: str = "auto",
addr: int = 1, autoconnect: bool = True, on_event=None, transport: str = "tcp", usb: str = "",
lock_code: str = "", auto_unlock: bool = False, test_saved: list | None = None):
lock_code: str = "", auto_unlock: bool = False, test_saved: list | None = None,
colors: dict | None = None):
self.id = dev_id
self.name = name
self.host = host
@@ -36,6 +37,7 @@ class Device:
self.lock_code = lock_code if P.LOCK_CODE.fullmatch(lock_code or "") else ""
self.auto_unlock = auto_unlock
self.demo = False # in-process simulator of the demo mode, never saved
self.colors: dict[str, str] = colors or {} # channel colours chosen in the app, e.g. {"in0": "#38bdf8"}
# audio test: output gains from before the test (restored when it ends) and the test fader level
self.test_saved: list[int] | None = test_saved if isinstance(test_saved, list) else None
self.test_level = -50.0
@@ -70,7 +72,8 @@ class Device:
return {"id": self.id, "name": self.name, "host": self.host, "port": self.port,
"model": self.model_key, "addr": self.addr, "autoconnect": self.autoconnect,
"transport": self.transport, "usb": self.usb,
"lock_code": self.lock_code, "auto_unlock": self.auto_unlock, "test_saved": self.test_saved}
"lock_code": self.lock_code, "auto_unlock": self.auto_unlock, "test_saved": self.test_saved,
"colors": self.colors}
def snapshot(self) -> dict:
cfg = self.config()