2019-10-02 04:16:07 +00:00
|
|
|
#pragma once
|
2019-05-29 22:49:54 +00:00
|
|
|
|
|
|
|
#include "Effect.h"
|
2020-11-04 05:26:02 +00:00
|
|
|
#include "effects/clock.h"
|
|
|
|
#include "effects/timer.h"
|
2019-05-29 22:49:54 +00:00
|
|
|
|
2020-11-04 05:32:55 +00:00
|
|
|
#define SIMPLE_EFFECT [](accum88 t, uint16_t i, uint8_t x, uint8_t y)->int8_t
|
|
|
|
|
2019-10-02 04:16:07 +00:00
|
|
|
struct EffectEntry {
|
|
|
|
const char* name;
|
|
|
|
bool use_in_cycle;
|
|
|
|
std::function<Effect*()> create;
|
2020-04-29 18:24:59 +00:00
|
|
|
#ifdef MQTT_REPORT_METRICS
|
|
|
|
int16_t heap_change_sum;
|
|
|
|
uint16_t run_count;
|
|
|
|
#endif
|
2019-10-02 04:16:07 +00:00
|
|
|
};
|
2020-04-29 18:24:59 +00:00
|
|
|
extern EffectEntry effects[];
|
2019-10-02 04:16:07 +00:00
|
|
|
extern const uint8_t effects_size;
|
2019-05-29 22:49:54 +00:00
|
|
|
|
|
|
|
extern Effect* current_effect;
|
|
|
|
extern ClockEffect effect_clock;
|
2019-12-21 13:21:31 +00:00
|
|
|
extern TimerEffect effect_timer;
|
2019-05-29 22:49:54 +00:00
|
|
|
|
2019-10-02 04:16:07 +00:00
|
|
|
Effect* select_effect(char* name);
|
|
|
|
Effect* select_effect(uint8_t id);
|
2019-06-18 16:14:59 +00:00
|
|
|
bool change_current_effect(String s);
|
2019-05-29 22:49:54 +00:00
|
|
|
void setup_effects();
|