Switch qrunproxy to generated mock show, remove show.json
This commit is contained in:
@@ -28,12 +28,7 @@ func main() {
|
|||||||
runAndExit = strings.Fields(*runAndExitStr)
|
runAndExit = strings.Fields(*runAndExitStr)
|
||||||
}
|
}
|
||||||
|
|
||||||
show, err := loadMockShow()
|
show := GenerateMockShow(7, 100, 1000)
|
||||||
if err != nil {
|
|
||||||
fmt.Fprintf(os.Stderr, "Error loading show: %v\n", err)
|
|
||||||
os.Exit(1)
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := show.Validate(); err != nil {
|
if err := show.Validate(); err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error validating show: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error validating show: %v\n", err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import "fmt"
|
||||||
"encoding/json"
|
|
||||||
"fmt"
|
|
||||||
)
|
|
||||||
|
|
||||||
type Show struct {
|
type Show struct {
|
||||||
Tracks []*Track `json:"tracks"`
|
Tracks []*Track `json:"tracks"`
|
||||||
@@ -39,18 +36,6 @@ type TriggerTarget struct {
|
|||||||
Hook string `json:"hook"`
|
Hook string `json:"hook"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func loadMockShow() (*Show, error) {
|
|
||||||
buf, err := staticFS.ReadFile("static/show.json")
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
var show Show
|
|
||||||
if err := json.Unmarshal(buf, &show); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return &show, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func isValidEventForBlock(block *Block, event string) bool {
|
func isValidEventForBlock(block *Block, event string) bool {
|
||||||
if block.Type == "cue" {
|
if block.Type == "cue" {
|
||||||
return event == "GO"
|
return event == "GO"
|
||||||
|
|||||||
@@ -1,160 +0,0 @@
|
|||||||
{
|
|
||||||
"show": "The Tempest",
|
|
||||||
"tracks": [
|
|
||||||
{"id": "track_lighting_a", "name": "Lighting A"},
|
|
||||||
{"id": "track_lighting_b", "name": "Lighting B"},
|
|
||||||
{"id": "track_video", "name": "Video"},
|
|
||||||
{"id": "track_video_ovl", "name": "Video OVL"},
|
|
||||||
{"id": "track_audio", "name": "Audio"}
|
|
||||||
],
|
|
||||||
"blocks": [
|
|
||||||
{"id": "block_q10_preshow", "type": "cue", "name": "Q10 Preshow"},
|
|
||||||
{"id": "block_preshow_wash", "type": "light", "track": "track_lighting_a", "name": "Preshow Wash"},
|
|
||||||
{"id": "block_warm_70", "type": "light", "track": "track_lighting_b", "name": "Warm 70%"},
|
|
||||||
{"id": "block_preshow_loop", "type": "media", "track": "track_video", "name": "Preshow Loop", "loop": true},
|
|
||||||
{"id": "block_preshow_music", "type": "media", "track": "track_audio", "name": "Preshow Music", "loop": true},
|
|
||||||
{"id": "block_q11_house_open", "type": "cue", "name": "Q11 House Open"},
|
|
||||||
{"id": "block_q12_top_of_show", "type": "cue", "name": "Q12 Top of Show"},
|
|
||||||
{"id": "block_cool_50", "type": "light", "track": "track_lighting_b", "name": "Cool 50%"},
|
|
||||||
{"id": "block_3s_delay", "type": "delay", "track": "track_video", "name": "3s Delay"},
|
|
||||||
{"id": "block_sc1_focus", "type": "light", "track": "track_lighting_a", "name": "SC1 Focus"},
|
|
||||||
{"id": "block_sc1_blue_80", "type": "light", "track": "track_lighting_b", "name": "SC1 Blue 80%"},
|
|
||||||
{"id": "block_sc1_projection", "type": "media", "track": "track_video", "name": "Sc1 Projection"},
|
|
||||||
{"id": "block_lightning_flash", "type": "media", "track": "track_video_ovl", "name": "Lightning Flash"},
|
|
||||||
{"id": "block_storm_ambience", "type": "media", "track": "track_audio", "name": "Storm Ambience", "loop": true},
|
|
||||||
{"id": "block_q13_sc1_dialog", "type": "cue", "name": "Q13 Sc1 Dialog"},
|
|
||||||
{"id": "block_wave_overlay", "type": "media", "track": "track_video_ovl", "name": "Wave Overlay"},
|
|
||||||
{"id": "block_dialog_spots", "type": "light", "track": "track_lighting_a", "name": "Dialog Spots"},
|
|
||||||
{"id": "block_warm_90", "type": "light", "track": "track_lighting_b", "name": "Warm 90%"},
|
|
||||||
{"id": "block_dialog_underscore", "type": "media", "track": "track_audio", "name": "Dialog Underscore"},
|
|
||||||
{"id": "block_q14_sc2_trans", "type": "cue", "name": "Q14 Sc2 Trans"},
|
|
||||||
{"id": "block_sc2_focus", "type": "light", "track": "track_lighting_a", "name": "SC2 Focus"},
|
|
||||||
{"id": "block_sc2_amber_60", "type": "light", "track": "track_lighting_b", "name": "SC2 Amber 60%"},
|
|
||||||
{"id": "block_sc2_background", "type": "media", "track": "track_video", "name": "Sc2 Background", "loop": true},
|
|
||||||
{"id": "block_sc2_atmos", "type": "media", "track": "track_audio", "name": "SC2 Atmos", "loop": true}
|
|
||||||
],
|
|
||||||
"triggers": [
|
|
||||||
{
|
|
||||||
"source": {"block": "block_q10_preshow", "signal": "GO"},
|
|
||||||
"targets": [
|
|
||||||
{"block": "block_preshow_wash", "hook": "START"},
|
|
||||||
{"block": "block_warm_70", "hook": "START"},
|
|
||||||
{"block": "block_preshow_loop", "hook": "START"},
|
|
||||||
{"block": "block_preshow_music", "hook": "START"}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"source": {"block": "block_q11_house_open", "signal": "GO"},
|
|
||||||
"targets": [
|
|
||||||
{"block": "block_warm_70", "hook": "FADE_OUT"}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"source": {"block": "block_warm_70", "signal": "END"},
|
|
||||||
"targets": [
|
|
||||||
{"block": "block_cool_50", "hook": "START"}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"source": {"block": "block_q12_top_of_show", "signal": "GO"},
|
|
||||||
"targets": [
|
|
||||||
{"block": "block_preshow_wash", "hook": "FADE_OUT"},
|
|
||||||
{"block": "block_preshow_loop", "hook": "FADE_OUT"},
|
|
||||||
{"block": "block_preshow_music", "hook": "FADE_OUT"}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"source": {"block": "block_preshow_loop", "signal": "END"},
|
|
||||||
"targets": [
|
|
||||||
{"block": "block_3s_delay", "hook": "START"}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"source": {"block": "block_3s_delay", "signal": "END"},
|
|
||||||
"targets": [
|
|
||||||
{"block": "block_sc1_projection", "hook": "START"}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"source": {"block": "block_sc1_projection", "signal": "START"},
|
|
||||||
"targets": [
|
|
||||||
{"block": "block_sc1_focus", "hook": "START"},
|
|
||||||
{"block": "block_cool_50", "hook": "END"},
|
|
||||||
{"block": "block_storm_ambience", "hook": "START"}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"source": {"block": "block_cool_50", "signal": "END"},
|
|
||||||
"targets": [
|
|
||||||
{"block": "block_sc1_blue_80", "hook": "START"}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"source": {"block": "block_sc1_blue_80", "signal": "START"},
|
|
||||||
"targets": [
|
|
||||||
{"block": "block_lightning_flash", "hook": "START"}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"source": {"block": "block_sc1_projection", "signal": "FADE_OUT"},
|
|
||||||
"targets": [
|
|
||||||
{"block": "block_lightning_flash", "hook": "END"}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"source": {"block": "block_q13_sc1_dialog", "signal": "GO"},
|
|
||||||
"targets": [
|
|
||||||
{"block": "block_sc1_focus", "hook": "FADE_OUT"},
|
|
||||||
{"block": "block_sc1_blue_80", "hook": "FADE_OUT"},
|
|
||||||
{"block": "block_storm_ambience", "hook": "FADE_OUT"},
|
|
||||||
{"block": "block_wave_overlay", "hook": "START"}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"source": {"block": "block_sc1_blue_80", "signal": "END"},
|
|
||||||
"targets": [
|
|
||||||
{"block": "block_warm_90", "hook": "START"}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"source": {"block": "block_storm_ambience", "signal": "END"},
|
|
||||||
"targets": [
|
|
||||||
{"block": "block_dialog_underscore", "hook": "START"}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"source": {"block": "block_dialog_underscore", "signal": "START"},
|
|
||||||
"targets": [
|
|
||||||
{"block": "block_dialog_spots", "hook": "START"}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"source": {"block": "block_q14_sc2_trans", "signal": "GO"},
|
|
||||||
"targets": [
|
|
||||||
{"block": "block_dialog_spots", "hook": "FADE_OUT"},
|
|
||||||
{"block": "block_warm_90", "hook": "FADE_OUT"},
|
|
||||||
{"block": "block_sc2_background", "hook": "START"},
|
|
||||||
{"block": "block_wave_overlay", "hook": "FADE_OUT"},
|
|
||||||
{"block": "block_dialog_underscore", "hook": "END"}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"source": {"block": "block_dialog_spots", "signal": "END"},
|
|
||||||
"targets": [
|
|
||||||
{"block": "block_sc2_focus", "hook": "START"}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"source": {"block": "block_warm_90", "signal": "END"},
|
|
||||||
"targets": [
|
|
||||||
{"block": "block_sc2_amber_60", "hook": "START"}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"source": {"block": "block_wave_overlay", "signal": "END"},
|
|
||||||
"targets": [
|
|
||||||
{"block": "block_sc2_atmos", "hook": "START"}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,27 +1,6 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import "testing"
|
||||||
"encoding/json"
|
|
||||||
"os"
|
|
||||||
"testing"
|
|
||||||
)
|
|
||||||
|
|
||||||
func TestBuildTimelineFromShowJSON(t *testing.T) {
|
|
||||||
buf, err := os.ReadFile("static/show.json")
|
|
||||||
if err != nil {
|
|
||||||
t.Fatal(err)
|
|
||||||
}
|
|
||||||
var show Show
|
|
||||||
if err := json.Unmarshal(buf, &show); err != nil {
|
|
||||||
t.Fatal(err)
|
|
||||||
}
|
|
||||||
if err := show.Validate(); err != nil {
|
|
||||||
t.Fatal(err)
|
|
||||||
}
|
|
||||||
if _, err := BuildTimeline(&show); err != nil {
|
|
||||||
t.Fatal(err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestBuildTimelineFromMockShow(t *testing.T) {
|
func TestBuildTimelineFromMockShow(t *testing.T) {
|
||||||
show := GenerateMockShow(7, 100, 1000)
|
show := GenerateMockShow(7, 100, 1000)
|
||||||
|
|||||||
Reference in New Issue
Block a user