Conversation
Co-authored-by: sshcrack <34072808+sshcrack@users.noreply.github.com>
Co-authored-by: sshcrack <34072808+sshcrack@users.noreply.github.com>
|
instead of creating a script, actually implement that functionality in the led matrix application and (if possible) register it as a plugin. The rendering of the preview for scenes should be a cmake target, and also if the target install is used, they should be installed in the proper directory so the web frontend can receive them. Serve the gifs in an API endpoint and the web should then get them. Remove the actual script you just created |
|
@copilot instead of creating a script, actually implement that functionality in the led matrix application and (if possible) register it as a plugin. The rendering of the preview for scenes should be a cmake target, and also if the target install is used, they should be installed in the proper directory so the web frontend can receive them. Serve the gifs in an API endpoint and the web should then get them. Remove the actual script you just created Use the GetPixel method for canvases to achieve such a effect. Also make sure the emulator is started in headless mode, if the target for the rendering of the previews is hit. Add a option to disable the rendering on the install target |
|
@sshcrack The model You can try again without specifying a model (just If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: |
|
@copilot instead of creating a script, actually implement that functionality in the led matrix application and (if possible) register it as a plugin. The rendering of the preview for scenes should be a cmake target, and also if the target install is used, they should be installed in the proper directory so the web frontend can receive them. Serve the gifs in an API endpoint and the web should then get them. Remove the actual script you just created Use the GetPixel method for canvases to achieve such a effect. Also make sure the emulator is started in headless mode, if the target for the rendering of the previews is hit. Add a option to disable the rendering on the install target |
…eration Co-authored-by: sshcrack <34072808+sshcrack@users.noreply.github.com>
Done in commit
|
Plan: Incremental Scene Preview Build PipelineUse a host-side emulator preview pipeline as a first-class CMake workflow, then package generated previews into the cross-compile install tree for RPi deployment. Keep preview generation optional and incremental by tracking scene-to-plugin ownership and regenerating only scenes belonging to changed plugin shared libraries. Steps
Relevant files
Verification
Decisions
Further Considerations
|
|
@sshcrack The model You can try again without specifying a model (just If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: |
Plan: Incremental Scene Preview Build PipelineUse a host-side emulator preview pipeline as a first-class CMake workflow, then package generated previews into the cross-compile install tree for RPi deployment. Keep preview generation optional and incremental by tracking scene-to-plugin ownership and regenerating only scenes belonging to changed plugin shared libraries. Steps
Relevant files
Verification
Decisions
Further Considerations
|
|
@sshcrack The model You can try again without specifying a model (just If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: |
Plan: Incremental Scene Preview Build PipelineUse a host-side emulator preview pipeline as a first-class CMake workflow, then package generated previews into the cross-compile install tree for RPi deployment. Keep preview generation optional and incremental by tracking scene-to-plugin ownership and regenerating only scenes belonging to changed plugin shared libraries. Steps
Relevant files
Verification
Decisions
Further Considerations
|
- plugins/CMakeLists.txt: publish each matrix plugin target to a
global CMake property (MATRIX_PLUGIN_TARGETS) so custom targets can
express correct build-order dependencies on actual plugin .so files
instead of the undefined LIB_NAMES variable.
- CMakeLists.txt (preview_gen section):
* Replace install(CODE) side-effect generation with a clean
install(DIRECTORY) that copies pre-generated GIFs from the staging
area (${CMAKE_BINARY_DIR}/previews/) into <prefix>/previews/.
* Add generate_scene_previews_incremental target that invokes the new
cmake/scripts/incremental_preview.cmake script: fingerprints each
scene by its plugin .so mtime+size + preview settings, regenerates
only changed/missing scenes, and writes a manifest for future runs.
* Both targets depend on preview_gen + MATRIX_PLUGIN_TARGETS.
* Add PREVIEW_FPS/FRAMES/WIDTH/HEIGHT/SCENES cache variables for
easy tuning and per-scene override.
- cmake/scripts/incremental_preview.cmake: new script that runs
preview_gen --dump-manifest, compares plugin fingerprints against
previews_manifest.json, and calls preview_gen --scenes <csv> for
only the changed subset. Falls back to full regen on CMake < 3.19
or if --dump-manifest fails.
- src_preview_gen/main.cpp:
* Add --scenes (comma-separated list) alongside the existing --scene.
* Add --dump-manifest / --manifest-out: loads plugins and emits a
JSON array [{name, plugin_name, plugin_path, needs_desktop}] then
exits without rendering.
* Skip scenes where needs_desktop_app() == true (log an info message
pointing users to capture_desktop_preview.sh).
* Per-scene crash isolation: each scene render is wrapped in a
try/catch so one broken scene never aborts the whole batch; existing
GIFs for failed scenes are preserved.
* Add #include <fstream> and <sstream>.
- src_matrix/server/scene_management.cpp: add needs_desktop field
(bool) to every entry returned by /list_scenes.
- scripts/capture_desktop_preview.sh: new script for desktop-dependent
scenes (VideoScene, AudioSpectrumScene, ShadertoyScene, …). Requires
a running emulator + desktop app; uses xdotool to find the emulator
window and ffmpeg x11grab to record each scene, then converts to a
palette-optimised GIF.
- scripts/build_upload.sh: add SKIP_PREVIEWS=1 env-var opt-out, sync
emulator_build/previews/ into build/install/previews/ before rsync,
document the expected emulator→cross-compile→deploy workflow order.
- README.md: replace stale record_scene_preview.sh reference with the
new CMake targets and capture_desktop_preview.sh; document full-gen,
incremental, manual-override, and GENERATE_SCENE_PREVIEWS=OFF flows;
update /list_scenes table entry to mention has_preview+needs_desktop.
Co-authored-by: sshcrack <34072808+sshcrack@users.noreply.github.com>
The frontend had no way to browse or preview scenes visually before adding them to a preset. This adds a GIF-based gallery view, a native C++ tool to generate preview GIFs incrementally, and a shell script for capturing previews of scenes that require the desktop application.
Backend
GET /scene_preview?name=<scene_name>endpoint — serves<exec_dir>/previews/<scene_name>.gifwith path traversal protection/list_scenesnow includes"has_preview": booland"needs_desktop": boolper scene;needs_desktopreflects whether a scene requires the desktop app and therefore cannot be rendered headlesslyFrontend
/gallery) — responsive grid of all scenes; shows animated GIF preview or a "No preview" placeholder; search + "With preview" filter toggle; click any scene to add it directly to an existing presetPreview Generator (
src_preview_gen/main.cpp)A native C++ tool (
preview_gen) that renders each registered scene headlessly and encodes the output as an animated GIF:GetPixel()on theFrameCanvasto capture rendered pixel data per frameMagick++)needs_desktop_app() == true— these cannot be rendered headlessly and must be captured withscripts/capture_desktop_preview.sh--dump-manifest/--manifest-outmode: emits a JSON array of{name, plugin_name, plugin_path, needs_desktop}for all loaded scenes, used by the incremental CMake target--scenes <csv>for explicit scene selection (complements the existing--scene)Desktop-Scene Capture Script (
scripts/capture_desktop_preview.sh)For scenes that require the desktop application (VideoScene, AudioSpectrumScene, ShadertoyScene, etc.), a shell script captures previews from the running emulator window:
xdotoolto locate the emulator window andffmpeg x11grabto record each scene/list_scenesAPI, or accepts--scenes <csv>to target specific scenes--api-url,--output,--scenes,--duration,--fps,--window-title,--no-cleanupCMake Integration
plugins/CMakeLists.txt: each matrix plugin target is now appended to a global CMake propertyMATRIX_PLUGIN_TARGETSso preview targets express correct build-order dependencies on actual plugin.sofilespreview_gentarget — builds the generator binary (emulator builds only,ENABLE_EMULATOR=ON)generate_scene_previewstarget — full rebuild of all non-desktop scenes; depends onpreview_gen+MATRIX_PLUGIN_TARGETS; writes GIFs to<build_dir>/previews/generate_scene_previews_incrementaltarget — fingerprints each scene by its plugin.somtime+size plus preview settings; regenerates only changed or missing scenes; writespreviews_manifest.jsonfor subsequent runsGENERATE_SCENE_PREVIEWSoption (defaultON) — when ON,cmake --installcopies the staged GIFs from<build_dir>/previews/into<install_prefix>/previews/viainstall(DIRECTORY)(no longer usesinstall(CODE)side effects); disable with-DGENERATE_SCENE_PREVIEWS=OFFcmake/scripts/incremental_preview.cmake— the CMake script driving the incremental logic: runspreview_gen --dump-manifest, compares fingerprints, and callspreview_gen --scenes <csv>for only the changed subset; falls back to full regen on CMake < 3.19PREVIEW_FPS,PREVIEW_FRAMES,PREVIEW_WIDTH,PREVIEW_HEIGHT,PREVIEW_SCENES(manual scene override)scripts/build_upload.shupdated: syncsemulator_build/previews/into the cross-compile install tree before rsync deploy;SKIP_PREVIEWS=1opt-out for when the emulator build is unavailableFull deploy workflow:
Original prompt
Created from VS Code.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.