Read the pad over Bluetooth first, and USB when it isn't paired.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
jimmyandClaude Opus 5.5 committed 2026-10-23 00:02:08 +13:00
1 parent 2586ead4fa
commit 9c1ef6f2d4
2 files changed
+10 -10

No files matched your search

+5 -5
View File
@@ -11,8 +11,8 @@ While Play is held, bank 2 notes 52–67 go out as 68–83 (see padcontroller/la
Point QLC+ MIDI input at that virtual port (midi.qxw does this via
patch_smc_pad.py once the pad controller is running). Every 2 s it checks the
links: it reopens the pad when it is replugged (or moves to USB when that turns
up) and re-links QLC+ to the virtual port after a restart, so QLC+ can stay open.
links: it reopens the pad when it is replugged (or moves to Bluetooth when that
turns up) and re-links QLC+ to the virtual port after a restart, so QLC+ can stay open.
QLC+ reopens its MIDI port when it loads a show, so a new link to QLC+ while
the pad controller runs means the show has just loaded with every button off.
@@ -56,10 +56,10 @@ from pad_lamps import set_lamps, set_sound_lamps # noqa: E402
VIRTUAL_NAME = "padcontroller"
COLOURS_FILE = Path(os.environ.get("XDG_STATE_HOME", Path.home() / ".local" / "state")) / "padcontroller" / "colours.json"
REOPEN_DELAY = 1.5 # s for QLC+ to finish loading the virtual console
# USB first when the pad is plugged in, Bluetooth otherwise.
# Bluetooth first when the pad is paired, USB otherwise.
SOURCE_HINTS = (
"SINCO SMC-PAD-Master",
"SMC-PAD Bluetooth",
"SINCO SMC-PAD-Master",
"SINCO SMC-PAD-Private",
"SINCO",
"SMC-PAD",
@@ -242,7 +242,7 @@ def main() -> None:
while True:
now = time.monotonic()
if now >= next_link_check:
# Follow the pad: reopen it when it comes back, and move to USB when plugged in.
# Follow the pad: reopen it when it comes back, and move to Bluetooth when paired.
names = midiin.get_ports()
best = pick_source(names)
best_name = names[best] if best is not None else None