Woonsocket: ProPresenter's MIDI session connected to Lights, and watched
ProPresenter (on the Companion Mac) now reaches Lighting at 10.2.2.2:5004; Lights sees ProPresenter at 10.2.2.210:5004, both running. The MIDI key watches it (PROP LIGHTS). Auto-setup counts a link to the Companion Mac's own session once (it had listed it from both ends). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -294,17 +294,20 @@ def items(inv, nets):
|
||||
# Network MIDI: every peer in the sessions here and on the other Macs, at its wired address.
|
||||
midi_checks = []
|
||||
# Whose session a peer is, by its name: a peer joined by name or by an IPv6 address gets that Mac's wired address.
|
||||
owner = {sname: alias for alias, sessions in (inv.get("midi") or {}).items() if alias for sname in (sessions or {})}
|
||||
owner = {sname: (alias or "ingest") for alias, sessions in (inv.get("midi") or {}).items() for sname in (sessions or {})}
|
||||
ing = inv.get("ingest") or {}
|
||||
ing_ips = [ip for ip in [(ing.get("wired") or {}).get("ip")] + list(ing.get("ips") or []) if ip]
|
||||
for host, sessions in (inv.get("midi") or {}).items():
|
||||
for sname, sess in (sessions or {}).items():
|
||||
for p in sess.get("peers") or []:
|
||||
addr = p.get("address") or ""
|
||||
if not in_nets(nets, addr):
|
||||
alias = owner.get(p.get("name")) or computer_named(inv, p.get("name"))
|
||||
ip = alias and next((i for i in comps[alias].get("ips") or [] if in_nets(nets, i)), None)
|
||||
ips = ing_ips if alias == "ingest" else (comps.get(alias) or {}).get("ips") or [] if alias else []
|
||||
ip = next((i for i in ips if in_nets(nets, i)), None)
|
||||
if not ip:
|
||||
continue # no wired address known: the wired check will name it
|
||||
port = (((inv.get("midi") or {}).get(alias) or {}).get(p.get("name")) or {}).get("port") or 5004
|
||||
port = (((inv.get("midi") or {}).get("" if alias == "ingest" else alias) or {}).get(p.get("name")) or {}).get("port") or 5004
|
||||
addr = "%s:%d" % (ip, port)
|
||||
chk = {"type": "midi_peer", "session": sname, "peer": p["name"], "address": addr, "fix": "midi_reconnect",
|
||||
"tag": tag_for(p["name"])}
|
||||
@@ -320,7 +323,8 @@ def items(inv, nets):
|
||||
return any("state" in p for p in (((inv.get("midi") or {}).get(host) or {}).get(sname) or {}).get("peers") or [])
|
||||
by_pair = {}
|
||||
for ident, c in midi_checks:
|
||||
other = owner.get(c["peer"]) or computer_by_ip(inv, ip_of(c["address"])) or c["peer"]
|
||||
ip = ip_of(c["address"])
|
||||
other = owner.get(c["peer"]) or ("ingest" if ip and ip in ing_ips else None) or computer_by_ip(inv, ip) or c["peer"]
|
||||
pair = frozenset((end_of(c.get("host", "")), other))
|
||||
best = by_pair.get(pair)
|
||||
if best is None or (reports_state(c.get("host", ""), c["session"]) and not reports_state(best[1].get("host", ""), best[1]["session"])):
|
||||
|
||||
Reference in New Issue
Block a user