|
FastLED 3.9.15
|
Singleton event router for Channel lifecycle events.
Centralized event system - supports multiple listeners per event type. All listeners are shared across all channels. Zero per-channel overhead.
Usage:
Event naming convention:
Callbacks receive const IChannel& so the same listener works regardless of which Channel<Bus, Chipset> instantiation produced the event. See fl/channels/ichannel.h and issue #2428.
Definition at line 79 of file channel_events.h.
#include <channel_events.h>
Static Public Member Functions | |
| static ChannelEvents & | instance () |
Public Attributes | |
| fl::function_list< void(const IChannel &)> | onChannelAdded |
| Fired after a Channel is added to FastLED's controller list. | |
| fl::function_list< void(const IChannel &)> | onChannelBeginDestroy |
| Fired at the start of ~Channel(), before members are torn down. | |
| fl::function_list< void(const IChannel &, const ChannelConfig &)> | onChannelConfigured |
| Fired after applyConfig() reconfigures a Channel. | |
| fl::function_list< void(const IChannel &)> | onChannelCreated |
| Fired after a Channel is constructed via Channel::create() | |
| fl::function_list< void(const IChannel &, const ChannelData &)> | onChannelDataEncoded |
| Fired after pixel data is encoded into byte stream (before enqueuing) Second parameter is the encoded channel data. | |
| fl::function_list< void(const IChannel &, const fl::string &driverName)> | onChannelEnqueued |
| Fired after channel data is enqueued to a driver Second parameter is the driver name (empty string for unnamed drivers) | |
| fl::function_list< void(const IChannel &)> | onChannelRemoved |
| Fired after a Channel is removed from FastLED's controller list. | |