| 24 | } |
| 25 | |
| 26 | int 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 | |
| 47 | bool FxEngine::nextFx(u16 duration) { |
| 48 | bool ok = mEffects.next(mCurrId, &mCurrId, true); |
no test coverage detected