36 virtual void onBeginFrame() {}
37 virtual void onEndShowLeds() {}
38 virtual void onEndFrame() {}
39 virtual void onStripAdded(
CLEDController *strip, uint32_t num_leds) {
48 virtual void onPlatformPreLoop() {}
49 virtual void onPlatformPreLoop2() {}
53 static void addListener(
Listener *listener,
int priority = 0) {
54 #if FASTLED_HAS_ENGINE_EVENTS
55 EngineEvents::getInstance()->_addListener(listener, priority);
62 static void removeListener(Listener *listener) {
63 #if FASTLED_HAS_ENGINE_EVENTS
64 EngineEvents::getInstance()->_removeListener(listener);
70 static bool hasListener(Listener *listener) {
71 #if FASTLED_HAS_ENGINE_EVENTS
72 return EngineEvents::getInstance()->_hasListener(listener);
79 static void onBeginFrame() {
80 #if FASTLED_HAS_ENGINE_EVENTS
81 EngineEvents::getInstance()->_onBeginFrame();
85 static void onEndShowLeds() {
86 #if FASTLED_HAS_ENGINE_EVENTS
87 EngineEvents::getInstance()->_onEndShowLeds();
91 static void onEndFrame() {
92 #if FASTLED_HAS_ENGINE_EVENTS
93 EngineEvents::getInstance()->_onEndFrame();
97 static void onStripAdded(
CLEDController *strip, uint32_t num_leds) {
98 #if FASTLED_HAS_ENGINE_EVENTS
99 EngineEvents::getInstance()->_onStripAdded(strip, num_leds);
108 #if FASTLED_HAS_ENGINE_EVENTS
109 EngineEvents::getInstance()->_onCanvasUiSet(strip, xymap);
116 static void onPlatformPreLoop() {
117 #if FASTLED_HAS_ENGINE_EVENTS
118 EngineEvents::getInstance()->_onPlatformPreLoop();
124 void _addListener(Listener *listener,
int priority);
126 void _removeListener(Listener *listener);
127 void _onBeginFrame();
128 void _onEndShowLeds();
132 void _onPlatformPreLoop();
133 bool _hasListener(Listener *listener);
134#if FASTLED_HAS_ENGINE_EVENTS
136 Listener *listener =
nullptr;
138 Pair(Listener *listener,
int priority) : listener(listener), priority(priority) {}
142 ListenerList mListeners;