Completed player

This commit is contained in:
Media
2025-06-30 20:24:59 -05:00
parent 765bf73383
commit 20677f0749
10 changed files with 316 additions and 106 deletions
+29
View File
@@ -0,0 +1,29 @@
#!/usr/bin/env python3
import jack
import time
import sys
import subprocess
expected = {
"Praise:left", "Praise:right",
"Worship:left", "Worship:right",
"Instrumental:left", "Instrumental:right",
"sanctuary:in_l", "sanctuary:in_r",
"prayer:in_l", "prayer:in_r",
"Mac:in_l", "Mac:in_r"
}
client = jack.Client("waiter")
timeout = 15
deadline = time.time() + timeout
while time.time() < deadline:
current = {port.name for port in client.get_ports()}
if expected.issubset(current):
print("All JACK ports found.")
subprocess.run(["systemctl", "--system", "restart", "router.service"])
sys.exit(0)
time.sleep(0.5)
print("Timeout waiting for JACK ports.")
sys.exit(1)