Documentation
¶
Overview ¶
Package scene defines the portable, executable-code-free On Air document v1.
Index ¶
- Variables
- func Ease(name string, u, energy float64) float64
- func Eval(v Value, b Bindings, t float64) any
- func HasLiveSlots(d Document) bool
- func IsLiveSlotKey(k string) bool
- func IsSupportedBinding(key string, controls map[string]bool) bool
- func Number(v any, fallback float64) float64
- func RewriteLineupHeading(d *Document, heading string)
- func SplitSlotLayers(d Document) (base Document, overlay Document, splittable bool)
- type Audio
- type Behavior
- type Bindings
- type Cost
- type Document
- type Effect
- type Layer
- type Params
- type Reveal
- type Value
Constants ¶
This section is empty.
Variables ¶
var BehaviorKinds = []string{"typewriter", "flicker", "wiggle", "bounce", "glint", "chroma", "drift", "pop", "squash"}
BehaviorKinds is the authoritative list of procedural layer behaviours.
var DefaultWords = map[string]string{
"words.back": "NOW RESUMING",
"words.break": "BACK IN A MOMENT",
"words.now": "NOW PLAYING",
"words.offair": "OFF AIR",
"words.tonight": "TONIGHT",
"words.upNext": "UP NEXT",
}
DefaultWords supplies the binder's default role-label copy when a scene references {words.*} tokens directly instead of baking literal headings. {words.tagline} is bound from Brand.Tagline per style.
var Easings = []string{"linear", "in", "out", "inOut", "back", "elastic", "spring"}
Easings is the authoritative list of keyframe and reveal easing functions.
var LayerTypes = []string{
"group", "rect", "ellipse", "blob", "path", "text",
"image", "art", "logo", "gradient", "grid", "particles", "noise",
}
LayerTypes is the authoritative list of layer types supported by both the Go rasterizer (internal/onair/raster) and the console canvas renderer.
var PostEffects = []string{"grain", "scanlines", "vignette", "flicker"}
PostEffects is the authoritative list of scene post-processing passes.
var SupportedBrandTokens = []string{
"accent",
"bg",
"brand.logo",
"energy",
"glow",
"text",
"type.body",
"type.display",
}
SupportedBrandTokens lists the shared brand palette, typography, and energy tokens resolved by the binder on every non-system style.
var SupportedSlots = []string{
"brand.logo",
"channel.name",
"list[0].meta",
"list[0].time",
"list[0].title",
"list[1].meta",
"list[1].time",
"list[1].title",
"list[2].meta",
"list[2].time",
"list[2].title",
"list[3].meta",
"list[3].time",
"list[3].title",
"next.backdrop",
"next.logline",
"next.meta",
"next.poster",
"next.reason",
"next.time",
"next.title",
"now.logline",
"now.meta",
"now.title",
"offair.message",
"viewer.greeting",
"viewer.name",
}
SupportedSlots is the authoritative sorted list of live data and asset slots resolved by both the Go playout binder and the console preview renderer.
var SupportedTextureTokens = []string{
"textures.chroma",
"textures.flicker",
"textures.grain",
"textures.scanlines",
"textures.vignette",
}
SupportedTextureTokens lists the per-texture amount tokens populated from Brand.Textures.
var SupportedWordTokens = []string{
"words.back",
"words.break",
"words.now",
"words.offair",
"words.tagline",
"words.tonight",
"words.upNext",
}
SupportedWordTokens lists every {words.*} token resolved by the binder.
Functions ¶
func HasLiveSlots ¶
HasLiveSlots reports whether d's layer tree references any live programme, lineup, or viewer slot (or a daytime-adaptable tonight heading).
func IsLiveSlotKey ¶
IsLiveSlotKey reports whether a scene binding key carries dynamic programme, lineup, schedule, or viewer state that must never be baked into per-title cached masters on disk.
func IsSupportedBinding ¶
IsSupportedBinding reports whether key (without outer braces, optionally carrying an "@alpha" paint suffix) is resolved by the scene binder. When controls is non-nil, {control.<id>} must match a declared control ID.
func RewriteLineupHeading ¶
RewriteLineupHeading updates the baked "TONIGHT" / "{words.tonight}" heading on lineup overlays so daytime airings read "COMING UP" while reusing the look's single cached base master.
func SplitSlotLayers ¶
SplitSlotLayers separates a live-slot scene into a slot-free animated base document (cached once per look) and a live foreground overlay document (composited in real time at air time). If animated procedural layers or non-normal blend modes sit above a slot layer, splittable is false and the caller renders the full scene live each airing with no disk save.
Types ¶
type Behavior ¶
type Behavior struct {
Typewriter *Params `json:"typewriter,omitempty"`
Flicker *Params `json:"flicker,omitempty"`
Wiggle *Params `json:"wiggle,omitempty"`
Bounce *Params `json:"bounce,omitempty"`
Glint *Params `json:"glint,omitempty"`
Chroma *Params `json:"chroma,omitempty"`
Drift *Params `json:"drift,omitempty"`
Pop *Params `json:"pop,omitempty"`
Squash *Params `json:"squash,omitempty"`
}
type Bindings ¶
type Document ¶
type Document struct {
Audio *Audio `json:"audio,omitempty"`
V int `json:"v"`
Moment string `json:"moment"`
Duration float64 `json:"duration"`
Poster float64 `json:"poster"`
Slots []string `json:"slots,omitempty"`
Layers []Layer `json:"layers"`
Post []Effect `json:"post,omitempty"`
}
func ShortLoop ¶
ShortLoop fits an authored timeline into the outward half of a 16-second ping-pong loop. Mirrored sampling joins the end to the start continuously. Timeline metadata is retimed too, keeping bounded visibility ranges valid.
func StandbyBase ¶
StandbyBase derives a clean, text-free animated loop document from a look's break or ident scene so holding on a warming segment never shows a still.
func (Document) StaticForeground ¶
StaticForeground separates a full-frame analogue background from its prepared foreground. Such scenes air over a live Signal engine instead of a clip loop.
type Layer ¶
type Layer struct {
Name string `json:"name,omitempty"`
Hidden bool `json:"hidden,omitempty"`
Locked bool `json:"locked,omitempty"`
Start float64 `json:"start,omitempty"`
End float64 `json:"end,omitempty"`
ID string `json:"id"`
Type string `json:"type"`
X Value `json:"x,omitempty"`
Y Value `json:"y,omitempty"`
W Value `json:"w,omitempty"`
H Value `json:"h,omitempty"`
Scale Value `json:"scale,omitempty"`
ScaleX Value `json:"scaleX,omitempty"`
ScaleY Value `json:"scaleY,omitempty"`
Rotate Value `json:"rotate,omitempty"`
Opacity Value `json:"opacity,omitempty"`
Fill Value `json:"fill,omitempty"`
Stroke Value `json:"stroke,omitempty"`
StrokeWidth Value `json:"strokeWidth,omitempty"`
Join string `json:"join,omitempty"`
Cap string `json:"cap,omitempty"`
FillRule string `json:"fillRule,omitempty"`
Path string `json:"path,omitempty"`
Clip string `json:"clip,omitempty"`
Text Value `json:"text,omitempty"`
Font Value `json:"font,omitempty"`
Size Value `json:"size,omitempty"`
Weight int `json:"weight,omitempty"`
Track Value `json:"track,omitempty"`
Align string `json:"align,omitempty"`
MaxWidth float64 `json:"maxWidth,omitempty"`
Fit string `json:"fit,omitempty"`
MaxLines int `json:"maxLines,omitempty"`
Src Value `json:"src,omitempty"`
Tint Value `json:"tint,omitempty"`
TintBlend string `json:"tintBlend,omitempty"`
Blend string `json:"blend,omitempty"`
Blur float64 `json:"blur,omitempty"`
Glow float64 `json:"glow,omitempty"`
Count int `json:"count,omitempty"`
Seed uint32 `json:"seed,omitempty"`
Repeat int `json:"repeat,omitempty"`
Behave []Behavior `json:"behave,omitempty"`
Reveal *Reveal `json:"reveal,omitempty"`
Layers []Layer `json:"layers,omitempty"`
}