Skip to content

Question about class-based effects #5294

@JoaDick

Description

@JoaDick

Is your feature request related to a problem? Please describe.
The current design of WLED with is working perfectly fine for effects that can calculate everything from scratch whenever their mode function gets called. However, many effects require data that persists between function calls. This can be achieved through the SEGENV macro, but doing so is quite cumbersome.

Describe the solution you'd like
The obvious idea to make life easier for those effects would be a class-based design. Then the persistent data could be implemented as member variables, and a function like MyEffect::show() would be called by WLED.

So, my question is: What are the reasons why such a class-based design hasn't found its way into WLED yet? Are there concerns because of code size or performance? Or compatibility issues with the existing effects? Or it just wasn't seen as important?

While implementing my first effect for WLED, I've studied a lot of its codebase - and some ideas came into my mind how such effect-classes could be integrated. It would be really interesting to know what your thoughts are on that topic, and what else you'd expect from such an upgraded design.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions