#pragma once

#include "fl/stl/stdint.h"
#include "fl/stl/shared_ptr.h"         // For FASTLED_SHARED_PTR macros
#include "fl/stl/shared_ptr.h"  // For shared_ptr

// Forward declarations to avoid including heavy headers
namespace fl {
class Frame;
class Fx;
class AudioBatch;

FASTLED_SHARED_PTR(FxLayer);
class FxLayer {
  public:
    void setFx(fl::shared_ptr<Fx> newFx);

    void draw(fl::u32 now, float speed = 1.0f, const AudioBatch *audio = nullptr);

    void pause(fl::u32 now);

    void release();

    fl::shared_ptr<Fx> getFx();

    fl::span<CRGB> getSurface();

  private:
    fl::shared_ptr<Frame> frame;
    fl::shared_ptr<Fx> fx;
    fl::u32 mLastNow = 0;
    bool running = false;
};

} // namespace fl
