Commit 0c65fda8 by PLN (Algolia)

feat(gig): make gig-up idempotent — converge the rig, never spawn dupes

Follow-up to the live launch test: re-running gig-up while the rig was
already up would have opened a SECOND Ardour on the same session (an
'already open / locked' dialog) and a second Pulsar. Only SuperDirt was
guarded (skip if scsynth up).

Added ardour_up() (pgrep -f 'ardour-[0-9]', since the real binary is
ardour-9.2.0 behind the ardour9 wrapper script) and pulsar_up(), and gated
both launches on them. Now gig-up is a converge-to-ready button: run it at
any point and it starts only what's missing. Verified live with the full
rig up — SuperDirt/Ardour/Pulsar all correctly reported 'already running,
skipping', nothing duplicated. Serves #18 (dance with sound, not setup).
parent e3043558
...@@ -30,6 +30,10 @@ scsynth_up(){ pgrep -x scsynth >/dev/null 2>&1; } ...@@ -30,6 +30,10 @@ scsynth_up(){ pgrep -x scsynth >/dev/null 2>&1; }
osc_up(){ ss -uln 2>/dev/null | grep -q ':57120'; } osc_up(){ ss -uln 2>/dev/null | grep -q ':57120'; }
# SuperCollider's ALSA-seq client appears once MIDIClient.init has run. # SuperCollider's ALSA-seq client appears once MIDIClient.init has run.
midi_claimed(){ aconnect -l 2>/dev/null | grep -qiE "client [0-9]+: 'SuperCollider'"; } midi_claimed(){ aconnect -l 2>/dev/null | grep -qiE "client [0-9]+: 'SuperCollider'"; }
# GUI apps — so re-running gig-up converges the rig instead of spawning dupes
# (a 2nd Ardour on the same session = an annoying "already open/locked" dialog).
ardour_up(){ pgrep -f 'ardour-[0-9]' >/dev/null 2>&1; }
pulsar_up(){ pgrep -x pulsar >/dev/null 2>&1; }
# --- terminal for the sclang post window --- # --- terminal for the sclang post window ---
pick_term(){ pick_term(){
...@@ -99,14 +103,20 @@ while :; do ...@@ -99,14 +103,20 @@ while :; do
done done
# 3) Ardour — now safe to open (SuperDirt already holds the controller) # 3) Ardour — now safe to open (SuperDirt already holds the controller)
if [ -f "$ARDOUR_SESSION" ]; then if ardour_up; then
ok "Ardour already running — skipping."
elif [ -f "$ARDOUR_SESSION" ]; then
LAUNCH_ARGS=("$ARDOUR_SESSION"); launch_bin "Ardour" ardour ardour9 ardour8 Ardour LAUNCH_ARGS=("$ARDOUR_SESSION"); launch_bin "Ardour" ardour ardour9 ardour8 Ardour
else else
warn "Ardour session not found at: $ARDOUR_SESSION" warn "Ardour session not found at: $ARDOUR_SESSION"
fi fi
# 4) Pulsar — the Tidal folder # 4) Pulsar — the Tidal folder
LAUNCH_ARGS=("$DIR"); launch_bin "Pulsar" pulsar if pulsar_up; then
ok "Pulsar already running — skipping."
else
LAUNCH_ARGS=("$DIR"); launch_bin "Pulsar" pulsar
fi
echo echo
ok "gig-up done. SuperDirt owns the LaunchControl; Ardour + Pulsar are coming up." ok "gig-up done. SuperDirt owns the LaunchControl; Ardour + Pulsar are coming up."
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment