From 8b9d9b633a8b0ee163b6a5cd3b27a52045028631 Mon Sep 17 00:00:00 2001 From: Ian Gulliver Date: Fri, 20 Feb 2026 21:18:32 -0700 Subject: [PATCH] Add scene end cues that trigger END on untimed blocks --- cmd/qrunproxy/mockshow.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/cmd/qrunproxy/mockshow.go b/cmd/qrunproxy/mockshow.go index 693d8eb..be1cd14 100644 --- a/cmd/qrunproxy/mockshow.go +++ b/cmd/qrunproxy/mockshow.go @@ -80,6 +80,7 @@ func GenerateMockShow(numTracks, numCues, numBlocks int) *Show { placed := 0 cueIdx := 0 scene := 0 + lastOnTrack := make(map[int]*Block) for placed < numBlocks && cueIdx < numCues { scene++ @@ -89,6 +90,7 @@ func GenerateMockShow(numTracks, numCues, numBlocks int) *Show { if placed >= numBlocks || cueIdx >= numCues { break } + clear(lastOnTrack) cue := &Block{ ID: fmt.Sprintf("q%d", cueIdx), @@ -129,6 +131,7 @@ func GenerateMockShow(numTracks, numCues, numBlocks int) *Show { prev = next placed++ } + lastOnTrack[trackIdx] = prev } if len(cueTargets) > 0 { @@ -138,6 +141,27 @@ func GenerateMockShow(numTracks, numCues, numBlocks int) *Show { }) } } + + endTargets := []TriggerTarget{} + for _, blk := range lastOnTrack { + if blk.hasDefinedTiming() { + continue + } + endTargets = append(endTargets, TriggerTarget{Block: blk.ID, Hook: "END"}) + } + if len(endTargets) > 0 && cueIdx < numCues { + endCue := &Block{ + ID: fmt.Sprintf("q%d", cueIdx), + Type: "cue", + Name: fmt.Sprintf("S%d End", scene), + } + show.Blocks = append(show.Blocks, endCue) + cueIdx++ + show.Triggers = append(show.Triggers, &Trigger{ + Source: TriggerSource{Block: endCue.ID, Signal: "GO"}, + Targets: endTargets, + }) + } } for cueIdx < numCues {