#include "effects.h" #include "config.h" #include "my_fastled.h" #include "effect_bell.h" #include "effect_sinematrix3.h" #include "effect_big_clock.h" #include "effect_clock.h" #include "effect_static.h" #include "effect_animation.h" #include "effect_dynamic.h" #include "effect_matrix.h" #include "effect_twirl.h" #include "effect_cycle.h" #include "effect_confetti.h" #include "effect_snake.h" #include "effect_fire.h" #include "effect_firework.h" #include "effect_gol.h" #include "effect_pixelclock.h" #include "effect_dvd.h" #include "effect_analogclock.h" #include "effect_sines.h" #include "effect_marquee.h" #include "effect_blur2d.h" #include "effect_tv_static.h" Effect* current_effect; ClockEffect effect_clock; const EffectEntry effects[] = { /* 0 */ {"sinematrix3", true, [](){ return new Sinematrix3Effect(); }}, /* 1 */ {"big_clock", true, [](){ return new BigClockEffect(); }}, /* 2 */ {"clock", false, [](){ return new ClockEffect(); }}, /* 3 */ {"bell", false, [](){ return new BellEffect(); }}, /* 4 */ {"off", false, [](){ return new StaticEffect(0x000000); }}, /* 5 */ {"single_dynamic", true, [](){ return new SingleDynamicEffect(); }}, /* 6 */ {"multi_dynamic", true, [](){ return new MultiDynamicEffect(); }}, /* 7 */ {"big_dynamic", true, [](){ return new BigDynamicEffect(); }}, /* 8 */ {"matrix", true, [](){ return new MatrixEffect(); }}, /* 9 */ {"random_matrix", true, [](){ return new RandomMatrixEffect(); }}, /* 10 */ {"rainbow_matrix", true, [](){ return new RainbowMatrixEffect(); }}, /* 11 */ {"cycle", false, [](){ return new CycleEffect(); }}, /* 12 */ {"twirl", true, [](){ return new TwirlEffect(); }}, /* 13 */ {"confetti", true, [](){ return new ConfettiEffect(); }}, /* 14 */ {"random_confetti", true, [](){ return new RandomConfettiEffect(); }}, /* 15 */ {"snake", true, [](){ return new SnakeEffect(); }}, /* 16 */ {"firework", true, [](){ return new FireworkEffect(); }}, /* 17 */ {"gol", true, [](){ return new GolEffect(); }}, /* 18 */ {"pixel_clock", false, [](){ return new PixelClockEffect(); }}, /* 19 */ {"dvd", false, [](){ return new DvdEffect(); }}, /* 20 */ {"analog_clock", false, [](){ return new AnalogClockEffect(); }}, /* 21 */ {"sines", true, [](){ return new SinesEffect(); }}, /* 22 */ {"blur2d", true, [](){ return new Blur2DEffect(); }}, /* 23 */ {"marquee", 0, [](){ return new MarqueeEffect(); }}, /* 24 */ {"night_clock", false, [](){ return new NightClockEffect(); }}, /* 25 */ {"tv_static", false, [](){ return new TvStaticEffect(); }}, }; const uint8_t effects_size = 26; Effect* select_effect(const char* name) { for(int i=0; i 0) { LOGln("Effects * Parsing options: %s", options.c_str()); options += ","; int p_colon; while ((p_colon = options.indexOf(",")) >= 0) { int p_equal = options.indexOf("="); if (p_equal >= 0 && p_equal < p_colon) { String key = options.substring(0, p_equal); String value = options.substring(p_equal + 1, p_colon); LOGln("Effects * Applying option: %s = %s", key.c_str(), value.c_str()); current_effect->apply_option(key, value); } options.remove(0, p_colon + 1); } } return true; } void setup_effects() { current_effect = new CycleEffect(); }