esp32-sk6812/include/Animation/AnimationController.h

29 lines
561 B
C
Raw Normal View History

#pragma once
#include <memory>
#include "Animation.h"
class AnimationController
{
public:
AnimationController(Fader *fader);
2019-12-03 22:09:55 +01:00
void changeAnimation(std::unique_ptr<Animation> anim, bool transition = true);
void loop(void);
2019-12-03 22:09:55 +01:00
void restart(void);
bool isIdle(void)
{
return m_animation->finished() && !m_nextAnimation;
}
private:
Fader *m_fader;
std::unique_ptr<Animation> m_animation;
2019-12-03 22:09:55 +01:00
std::unique_ptr<Animation> m_nextAnimation;
uint64_t m_frame;
};