Add multipage frames and Playback sliders to the show builder.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
jimmyandClaude Sonnet 5.5 committed 2026-10-22 11:44:19 +13:00
1 parent 82e75e69de
commit b8e6b5f24b
3 files changed
+52 -15

No files matched your search

+12 -1
View File
@@ -132,6 +132,9 @@ def show_schema() -> dict[str, Any]:
"y": {"type": "integer"},
"w": {"type": "integer"},
"h": {"type": "integer"},
"pages": {"type": "integer", "minimum": 1, "description": "Frame only. More than 1 makes it a multipage frame."},
"loop": {"type": "boolean", "description": "Frame only. Next page after the last wraps to the first."},
"page": {"type": "integer", "minimum": 0, "description": "Frame inside a multipage frame: which page it is on, from 0."},
"fg": {"$ref": "#/$defs/colour"},
"bg": {"$ref": "#/$defs/colour"},
"function": {"type": "string", "description": "Function key for a button."},
@@ -352,6 +355,7 @@ def _add_widgets(show: Show, frame: Any, widgets: list[dict[str, Any]]) -> None:
cng=str(widget.get("cng", "None")),
inverted=bool(widget.get("inverted", False)),
input=binding,
function=widget.get("function"),
**box,
)
elif kind == "button":
@@ -380,6 +384,9 @@ def _add_widgets(show: Show, frame: Any, widgets: list[dict[str, Any]]) -> None:
widget["caption"],
solo=kind == "solo" or bool(widget.get("solo", False)),
header=bool(widget.get("header", True)),
pages=int(widget.get("pages", 1)),
loop=bool(widget.get("loop", False)),
page=int(widget.get("page", 0)),
**box,
)
_add_widgets(show, child, widget.get("children") or [])
@@ -784,7 +791,11 @@ def _check_widgets(
_err(errors, f"{here}.{field}", "must be an integer")
if kind == "slider":
channels = widget.get("channels")
if not isinstance(channels, list) or not channels:
if "function" in widget:
if widget["function"] not in functions:
_err(errors, f"{here}.function", f"unknown function {widget['function']!r}")
channels = []
elif not isinstance(channels, list) or not channels:
_err(errors, f"{here}.channels", "must list [fixture, channel] pairs")
else:
for pair in channels: