Press the colours again when a restarted QLC+ links itself to the pad controller.

The pad controller only took a QLC+ reload as one when it had to make the
link to QLC+ itself. A restarted QLC+ often subscribes to the virtual port on
its own as it opens the show, before the next check, so the colours stayed off.
Each check now also notes the QLC+ process and port it feeds (qlc_feeds), and a
new one counts as a reload too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
jimmyandClaude Opus 5.5 committed 2026-10-23 13:57:22 +13:00
1 parent 4fd11445e8
commit cf94c7b1ba
2 files changed
+53 -15

No files matched your search

+21 -1
View File
@@ -8,7 +8,7 @@ from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
sys.path.insert(0, str(ROOT))
from padcontroller.midi import missing_links, parse_aconnect, pick_source # noqa: E402
from padcontroller.midi import missing_links, parse_aconnect, pick_source, qlc_feeds # noqa: E402
BOTH = [
"Midi Through:Midi Through Port-0 14:0",
@@ -71,3 +71,23 @@ def test_nothing_missing_when_linked():
text = ACONNECT.replace(" 0 'padcontroller '\n", " 0 'padcontroller '\n\tConnecting To: 131:0\n")
assert missing_links(parse_aconnect(text), "SINCO:SINCO SMC-PAD-Master 20:1") == []
assert missing_links(parse_aconnect(text), None) == []
LINKED = ACONNECT.replace(" 0 'padcontroller '\n", " 0 'padcontroller '\n\tConnecting To: 131:0\n")
def test_parse_aconnect_reads_pids():
ports = {p.addr: p for p in parse_aconnect(ACONNECT)}
assert ports["131:0"].pid == "57635"
assert ports["20:0"].pid is None # a kernel client
def test_qlc_feeds_names_the_qlc_process():
assert qlc_feeds(parse_aconnect(LINKED)) == {("57635", "131:0")}
assert qlc_feeds(parse_aconnect(ACONNECT)) == set()
def test_a_restarted_qlc_that_linked_itself_is_a_new_feed():
before = qlc_feeds(parse_aconnect(LINKED))
after = qlc_feeds(parse_aconnect(LINKED.replace("pid=57635", "pid=60001")))
assert after - before == {("60001", "131:0")}