| 05-live-show-execution |
01 |
api |
| websocket |
| udp |
| cue-scheduler |
| animation |
| fastapi |
| lightsync |
|
| phase |
provides |
| 04-timeline-editor |
Show model with tracks/cues and encode_animation_cmd UDP encoder |
|
|
| Server-side cue scheduler in websocket tick handler that fires UDP animation commands at correct timestamps |
| Per-connection show state (show, fired_ids, is_playing) scoped to each WebSocket connection |
| preview_update broadcast messages sent to all clients on each tick |
| Seek-safe fired_ids rebuild preventing double-fire or missed cues after seeking |
|
| 05-02 (live preview UI consumes preview_update messages) |
| 05-03 (keyboard shortcuts drive play/pause/seek which gates cue scheduler) |
|
| added |
patterns |
|
|
| Per-connection mutable state pattern for WebSocket handlers (show, fired_ids, is_playing) |
| 60ms LOOKAHEAD window for cue scheduling with fire-and-forget UDP dispatch |
| Seek-safe fired_ids set comprehension rebuild from show cues before seek position |
| active_cue tracking per track for preview state (not just newly-fired cues) |
| Batch preview_update broadcast after each tick's cue scheduling pass |
|
|
|
| LOOKAHEAD = 0.060 (60ms) defined inline per tick — not a module constant — matches D-02 spec |
| is_playing gate on cue scheduler prevents any cue firing during pause or seek drag |
| Past cues (>100ms behind position) silently marked fired without UDP dispatch — prevents late blasts on seek |
| active_cue tracking includes already-fired cues still within their duration window — preview stays lit for duration of block |
| import lightsync.main as _main inside load handler — deferred import avoids circular import at module level |
|
| Pattern: Per-connection WebSocket state — mutable variables scoped inside async handler function |
| Pattern: Seek rebuild — set comprehension over all tracks/cues to mark past cues fired |
| Pattern: Preview batching — collect preview_updates list then broadcast after cue loop |
|
|
8min |
2026-04-07 |