FastLED 3.9.15
Loading...
Searching...
No Matches

◆ setVizFactory()

void fl::Animartrix::setVizFactory ( AnimartrixAnim anim,
AnimartrixVizFactory factory )
inline

Override the factory for a specific built-in animation enum.

The factory will be used instead of the default ANIMATION_TABLE entry when the given animation is selected. Pass nullptr to revert to default. Example: replace RGB_BLOBS with a custom implementation: animartrix.setVizFactory(AnimartrixAnim::RGB_BLOBS, &makeViz<MyCustomBlobs>);

Definition at line 301 of file animartrix.hpp.

301 {
302 // Search for existing override
303 for (auto &ovr : mFactoryOverrides) {
304 if (ovr.first == anim) {
305 ovr.second = factory;
306 // Force recreation on next draw
307 mViz.reset();
308 return;
309 }
310 }
311 if (factory) {
312 mFactoryOverrides.push_back(fl::make_pair(anim, factory));
313 mViz.reset();
314 }
315 }
fl::vector< fl::pair< AnimartrixAnim, AnimartrixVizFactory > > mFactoryOverrides
fl::unique_ptr< IAnimartrix2Viz > mViz
pair< typename fl::decay< T1 >::type, typename fl::decay< T2 >::type > make_pair(T1 &&t, T2 &&u) FL_NOEXCEPT
Definition pair.h:95

References fl::make_pair(), mFactoryOverrides, and mViz.

+ Here is the call graph for this function: