NA: NA Ingest out of the Tracks Mac's MIDI session in auto-fix hours (rehearsals, services); back after
User 2026-10-26: Ingest's notes did odd things in Ableton; the link is needed for programming only. An automatic switch (bypass auto autofix_hours, names_only so ProdDash Lighting on the same Mac stays) takes it out and keeps it out, and puts it back when the hours end. bypass_tick now takes turns over every switch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+22
-4
@@ -602,13 +602,15 @@ def bypass_apply(cfg, tile, on, entry, comp, names_ips, lock=None):
|
||||
if not b.get("peers") and not b.get("conns"):
|
||||
return # a key that only holds off fixes: nothing to hand over
|
||||
names, ips = set(b.get("peers") or []), set(names_ips[1]) if on else set()
|
||||
if b.get("names_only"):
|
||||
ips = set() # NA Ingest only, not ProdDash Lighting on the same Mac (2026-10-26)
|
||||
hosts = b.get("hosts") or [""] + sorted({c["host"] for t in cfg["tiles"] for c in t.get("checks", [])
|
||||
if c.get("type") == "midi_peer" and c.get("peer") in names and c.get("host")})
|
||||
if not on:
|
||||
for c in [x for t in cfg["tiles"] for x in t.get("checks", [])
|
||||
if x.get("type") == "midi_peer" and x.get("peer") in names]:
|
||||
ip = peer_ip(c.get("address"))
|
||||
if ip:
|
||||
if ip and not b.get("names_only"):
|
||||
ips.add(str(ip))
|
||||
conns = {c["label"]: c for c in comp.connections()} if b.get("conns") else {}
|
||||
for label in b.get("conns") or []:
|
||||
@@ -1803,13 +1805,29 @@ class Engine:
|
||||
threading.Thread(target=job, name="bypass-" + tile_id, daemon=True).start()
|
||||
|
||||
def bypass_tick(self, comp, now):
|
||||
"""While an operator has it, every 10 s: a link that came back (rtpMIDI asking again) goes out again."""
|
||||
if not self.bypass or self.bypass_busy or self.stopping or now - self.bypass_last < 10:
|
||||
"""While an operator has it, every 10 s: a link that came back (rtpMIDI asking again) goes out again.
|
||||
Several switches take turns; one that only holds off fixes (ABLESET) has nothing to re-take."""
|
||||
self.auto_bypass(comp, now)
|
||||
held = [t for t in self.bypass if (((self.tiles.get(t) or {}).get("bypass") or {}).get("peers")
|
||||
or ((self.tiles.get(t) or {}).get("bypass") or {}).get("conns"))]
|
||||
if not held or self.bypass_busy or self.stopping or now - self.bypass_last < 10:
|
||||
return
|
||||
self.bypass_last = now
|
||||
tid = next(iter(self.bypass))
|
||||
self.bypass_turn = (getattr(self, "bypass_turn", -1) + 1) % len(held)
|
||||
tid = held[self.bypass_turn]
|
||||
self.start_bypass_job(tid, True, self.bypass[tid], comp)
|
||||
|
||||
def auto_bypass(self, comp, now):
|
||||
"""A switch with "auto": "autofix_hours" is on exactly in auto-fix's hours (NA, 2026-10-26: NA Ingest out of
|
||||
the Tracks Mac's MIDI session then - its notes were doing odd things in Ableton - and back after them)."""
|
||||
for tid, t in self.tiles.items():
|
||||
if t.get("kind") != "bypass" or ((t.get("bypass") or {}).get("auto") != "autofix_hours"):
|
||||
continue
|
||||
want = self.autofix.scheduled(now)
|
||||
if want != (tid in self.bypass) and not self.bypass_busy:
|
||||
log.info("BYPASS %s: auto-fix hours %s", t["label"], "began" if want else "ended")
|
||||
self.toggle_bypass(tid, comp, now)
|
||||
|
||||
def run_fixes(self, tile_id, snap, comp, now, cooldown=None):
|
||||
cooldown = self.cooldown if cooldown is None else cooldown
|
||||
if self.stopping:
|
||||
|
||||
Reference in New Issue
Block a user