Beta models DSP 206 and FIR DSP 408 (without the FIR filters), read-only until allowed
Never tested on real hardware, so they are only selectable by hand and send no changes until the user has compared the shown values with the DSP. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0a1f282c63
commit
86ee492ec3
11 files changed
+121
-21
No files matched your search
@@ -154,6 +154,11 @@ def clean_colors(v) -> dict:
|
||||
return out
|
||||
|
||||
|
||||
# what a beta model allows before changes are switched on: nothing here writes to the DSP
|
||||
BETA_READ_ACTIONS = ("connect", "disconnect", "refresh", "export", "backups", "unlock", "colors", "maxgain",
|
||||
"linknames", "betawrite")
|
||||
|
||||
|
||||
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 = {}
|
||||
@@ -337,7 +342,8 @@ 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")), linknames=clean_linknames(d.get("linknames")))
|
||||
maxgain=clean_maxgain(d.get("maxgain")), linknames=clean_linknames(d.get("linknames")),
|
||||
beta_write=bool(d.get("beta_write")))
|
||||
dev.on_online = self.device_online
|
||||
self.devices[dev_id] = dev
|
||||
if dev.autoconnect:
|
||||
@@ -385,6 +391,8 @@ class App:
|
||||
return {"ok": True}
|
||||
|
||||
async def device_online(self, dev: Device):
|
||||
if dev.read_only:
|
||||
return
|
||||
await self.check_audio_test(dev)
|
||||
if not self.mute_all["active"] and self.mute_all["restore"].get(dev.id):
|
||||
self.unmute_device(dev) # released while this DSP was offline
|
||||
@@ -403,7 +411,7 @@ class App:
|
||||
|
||||
def set_mute_all(self, mute: bool) -> dict:
|
||||
"""Mute every channel of every connected DSP; releasing unmutes only what was open before."""
|
||||
online = [d for d in self.devices.values() if d.status == "online" and d.state]
|
||||
online = [d for d in self.devices.values() if d.status == "online" and d.state and not d.read_only]
|
||||
if mute and not self.mute_all["active"]:
|
||||
self.mute_all["restore"] = {}
|
||||
for dev in online:
|
||||
@@ -435,7 +443,7 @@ class App:
|
||||
changed = 0
|
||||
for t in body.get("targets") or []:
|
||||
dev = self.devices.get(str(t.get("device")))
|
||||
if not dev or dev.status != "online" or not dev.state:
|
||||
if not dev or dev.status != "online" or not dev.state or dev.read_only:
|
||||
continue
|
||||
if dev.test_active:
|
||||
raise RuntimeError("Audio test is on – switch it off first")
|
||||
@@ -794,6 +802,8 @@ class App:
|
||||
if dev.test_active and (action in ("preset/recall", "preset/store", "export", "import", "undo", "link")
|
||||
or action == "set" and body.get("param") != "mute"):
|
||||
raise RuntimeError("Audio test is on – switch it off first")
|
||||
if dev.read_only and method == "POST" and action not in BETA_READ_ACTIONS:
|
||||
raise RuntimeError("Beta model: changes are off")
|
||||
if self.demo["enabled"] and not dev.demo and action == "connect":
|
||||
raise RuntimeError("Demo mode is on – switch it off to connect the real DSPs")
|
||||
if method == "DELETE" and not action:
|
||||
@@ -805,6 +815,8 @@ class App:
|
||||
if method == "PUT" and not action:
|
||||
was_running = dev._want_connected
|
||||
await dev.stop()
|
||||
if body.get("model", dev.model_key) != dev.model_key:
|
||||
dev.beta_write = False # another model: check the values again
|
||||
for k in ("name", "host", "model", "usb"):
|
||||
if k in body:
|
||||
setattr(dev, "model_key" if k == "model" else k, str(body[k]))
|
||||
@@ -872,6 +884,11 @@ class App:
|
||||
self.save()
|
||||
self.broadcast({"type": "device", "device": dev.id, "data": dev.snapshot()})
|
||||
return {"ok": True, "colors": dev.colors}
|
||||
if action == "betawrite": # beta model: the user compared the shown values with the DSP
|
||||
dev.beta_write = bool(body.get("enabled"))
|
||||
self.save()
|
||||
self.broadcast({"type": "device", "device": dev.id, "data": dev.snapshot()})
|
||||
return {"ok": True, "read_only": dev.read_only}
|
||||
if action == "linknames": # display only, like the colours
|
||||
dev.linknames = clean_linknames(body.get("linknames"))
|
||||
self.save()
|
||||
|
||||
Reference in new issue
Block a user