Skip to content

Effects Runtime Redesign#11

Merged
anders130 merged 16 commits intodevfrom
feat/effects-runtime-redesign
Mar 17, 2026
Merged

Effects Runtime Redesign#11
anders130 merged 16 commits intodevfrom
feat/effects-runtime-redesign

Conversation

@anders130
Copy link
Copy Markdown
Contributor

Replaces the old preset/signal system with a persistent layer stack model backed by SQLite. Effects are composited from individually managed layers, each bound to a zone and an effect definition.

Storage

  • New store crate with SQLite via sqlx - tables for zones, effects, scenes, and the active layer stack
  • Active scene persists across restarts and reloads into the compositor on startup

Effects System

  • Built-in effects rewritten as embedded Rhai TOML files with typed param schemas - 14 effects included
  • CompositeEffect ticks LiveParam<f32> (brightness) and LiveParam<Rgb> (primary color) once per frame, giving smooth animated transitions on both
  • primary variable injected into every Rhai script scope each frame - scripts react live to color changes without a scene reload
  • cull_layers: layers fully eclipsed by a later full-strip override layer are skipped before rendering

API

  • GET/POST/PUT/DELETE /effects - effect CRUD (builtins exposed as read-only)
  • GET/POST/PUT/DELETE /zones - zone CRUD
  • GET/POST/PUT/DELETE /scenes - saved scene CRUD
  • GET/POST/DELETE /scenes/active - inspect or manage the active layer stack
  • POST /scenes/active/layers - add a layer
  • PATCH /scenes/active/layers/{id} - toggle/update a layer
  • DELETE /scenes/active/layers/{id} - remove a layer
  • PUT /scenes/active/layers/reorder - reorder layers
  • PUT /scenes/active - atomically replace all active layers
  • POST /scenes/active/save - save current stack as a named scene
  • GET/PATCH /device/state - brightness, on/off, color

Internals

  • RenderTaskRuntime split into focused modules (mod.rs, reload.rs, state.rs)
  • SceneRuntime trait simplified — bus/signal system removed

@anders130 anders130 self-assigned this Mar 17, 2026
@anders130 anders130 merged commit 358ab40 into dev Mar 17, 2026
2 checks passed
@anders130 anders130 deleted the feat/effects-runtime-redesign branch March 17, 2026 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant