Move animation management out of Engine #95
Merged
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.
Here, animation loading, state, and management are pulled out of
RGBMatrix.Engine
and into theXebow
application. This separates a few concerns to where theEngine
only has to deal with rendering,RGBMatrix.Animation
handles functions related to animations themselves, andXebow
handles creating the list of animations, initializing animations, switching animations, and persisting config modifications in memory.This should make it easier to introduce other application controlling logic such as animation activation/deactivation, configuration persistence between reboots, and eventually runtime discovery/installation of animations (which are currently hard-coded into the animation module).
This PR also fixes the black frame on live view creation, and removes the 0-ms
render_in
that was returned by all animations on callingnew/2
. Animations which need to delay the render of their first frame could set the first frame to black, have an internal state that determines how long to wait, and check that state in itsrender/2
callback functions.addresses part of #49, but leaves open a bunch of questions aboutruntime discovery of animations, enabling/disabling, etc.
closes #80
closes #83