|
Lamp-Da 0.1
A compact lantern project
|
Forest fixed colors ramp mode. More...
#include <fixed_modes.hpp>
Classes | |
| struct | StateTy |
Static Public Member Functions | |
| static void | on_enter_mode (auto &ctx) |
| static void | loop (auto &ctx) |
| static void | sunset_update (auto &ctx, float progress) |
| Sunset timer will drop pixels downward, and never display them again. | |
| static void | on_exit_mode (auto &ctx) |
| Custom callback when mode goes outside of focus (optional) | |
| static void | brightness_update (auto &ctx, brightness_t brightness) |
| Custom callback when brightness changes (optional) | |
| static void | custom_ramp_update (auto &ctx, uint8_t rampValue) |
| Custom callback when system sets user ramp (optional) | |
| static bool | custom_click (auto &ctx, uint8_t nbClick) |
| Custom "usermode" button UI for "click" action (optional) | |
| static bool | custom_hold (auto &ctx, uint8_t nbClickAndHold, bool isEndOfHoldEvent, uint32_t holdDuration) |
| Custom "usermode" button UI for "click+hold" action (optional) | |
| static void | power_on_sequence (auto &ctx) |
| Custom callback when the system powers on (optional) | |
| static void | power_off_sequence (auto &ctx) |
| Custom callback when the system powers off (optional) | |
| static void | read_parameters (auto &ctx) |
| Custom callback to read parameters from filesystem (optional) | |
| static void | write_parameters (auto &ctx) |
| Custom callback to write parameters to filesystem (optional) | |
| static void | user_thread (auto &ctx) |
| Custom secondary loop, executed in another thread (optional) | |
Static Public Attributes | |
| static constexpr uint8_t | dissolveBufferId |
| static anims::fadeout::GravityDissolve< dissolveBufferId > | sunsetAnimation |
| static constexpr bool | hasCustomRamp |
| hint manager to save our custom ramp | |
| static constexpr bool | hasSunsetAnimation |
| sunset animation on the fixed modes | |
| static constexpr bool | isGroupManager = false |
| static constexpr bool | hasBrightCallback = false |
| Toggles the use of custom BasicMode::brightness_update() callback. | |
| static constexpr bool | hasButtonCustomUI = false |
| Toggles "usermode" button UI custom_click() and custom_hold() | |
| static constexpr bool | hasSystemCallbacks = false |
| Toggles advanced system callbacks, see list here . | |
| static constexpr bool | requireUserThread = false |
| Toggles the use of custom BasicMode::user_thread() callback. | |
| static constexpr uint32_t | storeId = 0 |
| Store identifier for persistent storage (optional) | |
Forest fixed colors ramp mode.
|
inlinestaticinherited |
Custom callback when brightness changes (optional)
Callback active only if BasicMode::hasBrightCallback is True
| [in] | ctx | The current context |
| [in] | brightness | The brightness value set by the system |
|
inlinestaticinherited |
Custom "usermode" button UI for "click" action (optional)
Callback active only if BasicMode::hasButtonCustomUI is True
| [in] | ctx | The current context |
| [in] | nbClick | The number of clicks made by the user |
|
inlinestaticinherited |
Custom "usermode" button UI for "click+hold" action (optional)
Callback active only if BasicMode::hasButtonCustomUI is True
| [in] | ctx | The current context |
| [in] | nbClickAndHold | The number of clicks made by the user |
| [in] | isEndOfHoldEvent | True if the user just released the button |
| [in] | holdDuration | The duration of the on-going hold event |
isEndOfHoldEvent is True, then holdDuration is zero
|
inlinestaticinherited |
Custom callback when system sets user ramp (optional)
This can be used to make a mode configurable through the 3H click+hold user action, which will cycle through the 0-255 values in a ~2s ramp
| [in] | ctx | The current context |
| [in] | rampValue | The custom value set by the user |
|
inlinestaticinherited |
Custom callback when mode goes outside of focus (optional)
| [in] | ctx | The current context |
|
inlinestaticinherited |
Custom callback when the system powers off (optional)
Callback active only if BasicMode::hasSystemCallbacks is True
| [in] | ctx | The current context |
|
inlinestaticinherited |
Custom callback when the system powers on (optional)
Callback active only if BasicMode::hasSystemCallbacks is True
| [in] | ctx | The current context |
|
inlinestaticinherited |
Custom callback to read parameters from filesystem (optional)
Callback active only if BasicMode::hasSystemCallbacks is True
| [in] | ctx | The current context |
|
inlinestaticinherited |
Custom secondary loop, executed in another thread (optional)
Called only if BasicMode::requireUserThread is True
| [in] | ctx | The current context |
|
inlinestaticinherited |
Custom callback to write parameters to filesystem (optional)
Callback active only if BasicMode::hasSystemCallbacks is True
| [in] | ctx | The current context |
|
staticconstexprinherited |
Toggles advanced system callbacks, see list here .
Required to use any of the following:
|
staticconstexprinherited |
Toggles the use of custom BasicMode::user_thread() callback.
show() in user::user_thread() after the BasicMode::user_thread() callback
|
staticconstexprinherited |
Store identifier for persistent storage (optional)
By default, all modes are reset upon a shutdown, providing no persistence of their state across several on/off cycles. To expose to the user a way to configure your mode in a persistent fashion, you can use:
This value is configurable through user interaction with the button. If you need a persistent value, private to your mode, you can use:
These are the two always-available persistent state that a mode can configure by default. However, for more advanced modes (like games, with a list of high-scores, for example) more flexibility can be required.
If you need such extended storage, see ContextTy::KeyProxy for usage.
If you don't need these capabilities, just ignore this identifier :)