Add API flag to start presets with clean canvas#952
Merged
Conversation
Adds projectm_set_preset_start_clean() and projectm_get_preset_start_clean() functions to control whether new presets start with a black canvas or inherit the previous preset's last frame. Default behavior remains unchanged (copy previous frame), but applications can now opt-in to clean starts by setting this flag to true. Fixes #298
There was a problem hiding this comment.
Pull request overview
This PR adds a configurable flag to control whether newly loaded presets start from a clean black canvas instead of seeding from the previous frame, exposed through both the C++ and C APIs.
Changes:
- Introduces an internal
m_presetStartCleanflag inProjectM, with corresponding setter/getter, defaulting tofalse. - Updates
ProjectM::StartPresetTransitionso the initial texture copy from the previous preset is skipped whenm_presetStartCleanis enabled. - Exposes this behavior through new C API functions
projectm_set_preset_start_clean/projectm_get_preset_start_cleanin the public header and C wrapper.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/libprojectM/ProjectMCWrapper.cpp | Adds C wrapper functions mapping the new preset-start-clean flag to the underlying ProjectM instance. |
| src/libprojectM/ProjectM.hpp | Declares the SetPresetStartClean/PresetStartClean API and adds the m_presetStartClean member with documentation. |
| src/libprojectM/ProjectM.cpp | Implements the new setter/getter and gates the initial texture copy in StartPresetTransition on m_presetStartClean. |
| src/api/include/projectM-4/parameters.h | Extends the public C API with documented functions to set/get the preset-start-clean behavior, including @since 4.2.0 tags. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
kblaschke
reviewed
Feb 1, 2026
Member
kblaschke
left a comment
There was a problem hiding this comment.
If the "Trigger CI" commit is removed/squashed, this is good to merge!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds option to skip the initial texture copy when transitioning to new presets.
When enabled via
projectm_set_preset_start_clean(true), the previousframe's texture is not drawn as the initial state for the new preset.
This provides a clean black canvas instead, which some applications may prefer.
Fixes #298