MCPcopy Create free account
hub / github.com/FastLED/FastLED / addFx

Method addFx

src/fl/fx/fx_engine.cpp.hpp:26–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24}
25
26int FxEngine::addFx(FxPtr effect) {
27 float fps = 0;
28 if (mInterpolate && effect->hasFixedFrameRate(&fps)) {
29 // Wrap the effect in a VideoFxWrapper so that we can get
30 // interpolation.
31 VideoFxWrapperPtr vid_fx = fl::make_shared<VideoFxWrapper>(effect);
32 vid_fx->setFade(0, 0); // No fade for interpolated effects
33 effect = vid_fx;
34 }
35 bool auto_set = mEffects.empty();
36 bool ok = mEffects.insert(mCounter, effect);
37 if (!ok) {
38 return -1;
39 }
40 if (auto_set) {
41 mCurrId = mCounter;
42 mCompositor.startTransition(0, 0, effect);
43 }
44 return mCounter++;
45}
46
47bool FxEngine::nextFx(u16 duration) {
48 bool ok = mEffects.next(mCurrId, &mCurrId, true);

Callers 3

FL_TEST_FILEFunction · 0.45
setupFunction · 0.45
setupFunction · 0.45

Calls 5

startTransitionMethod · 0.80
hasFixedFrameRateMethod · 0.45
setFadeMethod · 0.45
emptyMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected