feat(figment): integrate figment overlay into scroll loop
Wire render_figment_overlay() into stream() between the effects chain and the ntfy message overlay, with optional cairosvg import guard. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -19,6 +19,7 @@ from engine.layers import (
|
||||
apply_glitch,
|
||||
process_effects,
|
||||
render_firehose,
|
||||
render_figment_overlay,
|
||||
render_message_overlay,
|
||||
render_ticker_zone,
|
||||
)
|
||||
@@ -53,6 +54,16 @@ def stream(items, ntfy_poller, mic_monitor, display: Display | None = None):
|
||||
msg_cache = (None, None)
|
||||
frame_number = 0
|
||||
|
||||
# Figment overlay (optional — requires cairosvg)
|
||||
try:
|
||||
from effects_plugins.figment import FigmentEffect
|
||||
from engine.effects.registry import get_registry
|
||||
|
||||
_fg_plugin = get_registry().get("figment")
|
||||
figment = _fg_plugin if isinstance(_fg_plugin, FigmentEffect) else None
|
||||
except ImportError:
|
||||
figment = None
|
||||
|
||||
while True:
|
||||
if queued >= config.HEADLINE_LIMIT and not active:
|
||||
break
|
||||
@@ -123,6 +134,13 @@ def stream(items, ntfy_poller, mic_monitor, display: Display | None = None):
|
||||
firehose_buf = render_firehose(items, w, fh, h)
|
||||
buf.extend(firehose_buf)
|
||||
|
||||
# Figment overlay (between effects and ntfy message)
|
||||
if figment and figment.config.enabled:
|
||||
figment_state = figment.get_figment_state(frame_number, w, h)
|
||||
if figment_state is not None:
|
||||
figment_buf = render_figment_overlay(figment_state, w, h)
|
||||
buf.extend(figment_buf)
|
||||
|
||||
if msg_overlay:
|
||||
buf.extend(msg_overlay)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user