18#ifndef FASTLED_FX_ENGINE_MAX_FX
19#define FASTLED_FX_ENGINE_MAX_FX 64
40 FxEngine(u16 numLeds,
bool interpolate =
true);
53 int addFx(FxPtr effect);
79 FxPtr
getFx(
int index);
95 bool nextFx(u16 transition_ms = 500);
fl::UISlider scale("Scale", 4,.1, 4,.1)
void setAudio(fl::shared_ptr< fl::audio::Processor > proc)
Connects an audio processor for automatic audio delivery.
fl::vector< AudioFrame > mAudioBack
bool nextFx(u16 transition_ms=500)
Transitions to the next effect in the sequence.
int addFx(FxPtr effect)
Adds a new effect to the engine.
FxEngine(u16 numLeds, bool interpolate=true)
Constructs an FxEngine with the specified number of LEDs.
void setSpeed(float scale)
Sets the speed of the fx engine, which will impact the speed of all effects.
bool mDurationSet
Flag indicating if a new transition has been set.
FxCompositor mCompositor
Handles effect transitions and rendering.
int getCurrentFxId() const
int mCurrId
Id of the current effect.
fl::vector< AudioFrame > mAudioFront
fl::shared_ptr< fl::audio::Processor > mAudioProcessor
~FxEngine() FL_NOEXCEPT
Destructor for FxEngine.
u16 mDuration
Duration of the current transition.
bool setNextFx(int index, u16 duration)
Sets the next effect to transition to.
IntFxMap mEffects
Collection of effects.
bool draw(fl::u32 now, fl::span< CRGB > outputBuffer)
Renders the current effect or transition to the output buffer.
void pushAudioFrame(const AudioFrame &frame)
Pushes an audio frame into the back buffer.
FxPtr removeFx(int index)
Requests removal of an effect from the engine, which might not happen immediately (for example the Fx...
fl::flat_map< int, FxPtr > IntFxMap
FxPtr getFx(int index)
Retrieves an effect from the engine without removing it.
int addFx(Fx &effect)
Adds a new effect to the engine.
shared_ptr< T > make_shared_no_tracking(T &obj) FL_NOEXCEPT
Base definition for an LED controller.
Lightweight snapshot of pre-computed audio analysis for one audio sample.