Scene-based cue naming in mock show generator, stub validation for untimed blocks

This commit is contained in:
Ian Gulliver
2026-02-20 21:14:50 -07:00
parent b282ab710f
commit 911121e463
2 changed files with 56 additions and 39 deletions

View File

@@ -79,12 +79,21 @@ func GenerateMockShow(numTracks, numCues, numBlocks int) *Show {
placed := 0
cueIdx := 0
scene := 0
for placed < numBlocks && cueIdx < numCues {
scene++
cuesInScene := 2 + rng.IntN(3)
for intra := 1; intra <= cuesInScene; intra++ {
if placed >= numBlocks || cueIdx >= numCues {
break
}
cue := &Block{
ID: fmt.Sprintf("q%d", cueIdx*10),
ID: fmt.Sprintf("q%d", cueIdx),
Type: "cue",
Name: fmt.Sprintf("Q%d", cueIdx*10),
Name: fmt.Sprintf("S%d Q%d", scene, intra),
}
show.Blocks = append(show.Blocks, cue)
cueIdx++
@@ -129,12 +138,14 @@ func GenerateMockShow(numTracks, numCues, numBlocks int) *Show {
})
}
}
}
for cueIdx < numCues {
scene++
cue := &Block{
ID: fmt.Sprintf("q%d", cueIdx*10),
ID: fmt.Sprintf("q%d", cueIdx),
Type: "cue",
Name: fmt.Sprintf("Q%d", cueIdx*10),
Name: fmt.Sprintf("S%d Q1", scene),
}
show.Blocks = append(show.Blocks, cue)
cueIdx++

View File

@@ -122,6 +122,12 @@ func (show *Show) Validate() error {
if !startTargeted[block.ID] {
return fmt.Errorf("block %q has no trigger for its START", block.ID)
}
/*
TODO: Put this back when mock is fixed
if !block.hasDefinedTiming() && !hookTargeted[blockEvent{block.ID, "FADE_OUT"}] && !hookTargeted[blockEvent{block.ID, "END"}] {
return fmt.Errorf("block %q has no defined timing and nothing triggers its FADE_OUT or END", block.ID)
}
*/
}
for _, trigger := range show.Triggers {