ProtoTracer  1.0
Real-time 3D rendering and animation engine
Loading...
Searching...
No Matches
Menu.h
Go to the documentation of this file.
1/**
2 * @file Menu.h
3 * @brief Provides the Menu class for controlling various parameters of the program.
4 *
5 * The Menu class allows interaction with system parameters such as face selection,
6 * brightness, microphone usage, boop sensor activation, spectrum analyzer settings,
7 * color/hue options, and more. It also manages the internal UI display (using
8 * TextEngine) and handles user input via button/NeoTrellis or other methods.
9 */
10
11#pragma once
12
13#include "../../../Physics/Utils/DampedSpring.h"
14#include "../../../Scene/Materials/Animated/RainbowNoise.h"
15#include "../../../Scene/Materials/Special/Overlays/Text/TextEngine.h"
16
17#include "../../../Animation/AnimationTracks/EffectChangeTrack.h"
18#include "../../../Scene/Screenspace/Passthrough.h"
19#include "../../../Scene/Screenspace/GlitchX.h"
20#include "../../../Scene/Screenspace/Fisheye.h"
21#include "../../../Scene/Screenspace/HorizontalBlur.h"
22#include "../../../Scene/Screenspace/PhaseOffsetX.h"
23#include "../../../Scene/Screenspace/PhaseOffsetY.h"
24#include "../../../Scene/Screenspace/PhaseOffsetR.h"
25#include "../../../Scene/Screenspace/Magnet.h"
26#include "../../../Scene/Screenspace/Overflow.h"
27#include "../../../Scene/Screenspace/RadialBlur.h"
28#include "../../../Scene/Screenspace/ShiftR.h"
29#include "../../../Scene/Screenspace/VerticalBlur.h"
30
31#include "../../../Examples/UserConfiguration.h"
32
33#ifdef NEOTRELLISMENU
34#include "../NeoTrellisMenuHandler.h"
35#elif defined MORSEBUTTON
36#include "../SingleButtonMorseHandler.h"
37#else
38#include "../SingleButtonMenuHandler.h"
39#endif
40
41/**
42 * @class Menu
43 * @brief A class responsible for displaying and controlling a parameter menu within
44 * the project. It allows the user to change various settings (e.g., brightness,
45 * microphone level, boop sensor, effects) and to navigate through menu items.
46 *
47 * The Menu system integrates a TextEngine-based UI, plus optional interactive
48 * hardware inputs (button, NeoTrellis, etc.). It also provides visual "wiggle"
49 * effects and manages transitions via DampedSpring.
50 */
51class Menu {
52public:
53 /**
54 * @enum MenuState
55 * @brief Enumerates different parameter items or states in the menu.
56 */
57 enum MenuState {
58 Faces, ///< Controls the current face index.
59 Bright, ///< Controls the overall brightness.
60 AccentBright, ///< Controls the accent brightness.
61 Microphone, ///< Toggles microphone usage (on/off).
62 MicLevel, ///< Controls microphone level (gain).
63 BoopSensor, ///< Toggles boop sensor usage (on/off).
64 SpectrumMirror, ///< Toggles mirror effect for SpectrumAnalyzer (on/off).
65 FaceSize, ///< Controls the size of the face mesh or display.
66 Color, ///< Controls the face color selection.
67 HueF, ///< Controls the front hue value.
68 HueB, ///< Controls the back hue value.
69 EffectS, ///< Controls which post-processing effect is active.
70 FanSpeed ///< Controls the fan speed.
71 };
72
73private:
74 /**
75 * @brief Total number of menu items.
76 */
77 static const uint8_t menuCount = 13;
78
79 /**
80 * @brief A RainbowNoise material (used for text styling, if desired).
81 */
83
84 /**
85 * @brief DampedSpring objects used for smooth transitions in the X-direction and for menu visibility.
86 */
87 static DampedSpring dampedSpringX; ///< Controls the horizontal positioning of the menu.
88 static DampedSpring dampedSpringShow; ///< Controls the show/hide ratio of the menu.
89
90 /**
91 * @brief UI geometry: size, position, offsets, and rotation.
92 */
93 static Vector2D size; ///< The total size of the menu in screen-space.
94 static Vector2D position; ///< The current position of the menu.
95 static Vector2D positionOffset;///< Additional offset to apply to the menu's position.
96 static Vector2D rotationOffset;///< Offset for pivoting the menu (e.g., around its center).
97 static float rotation; ///< Rotation angle (in degrees or radians, depending on usage).
98 static float showMenuRatio; ///< Normalized ratio (0.0 to 100.0) controlling how much the menu is shown.
99
100 /**
101 * @brief Dimensions for the internal text layout, e.g., number of columns/rows.
102 */
103 static const uint8_t menuLength = 12; ///< Number of characters per menu segment.
104 static const uint8_t menuRows = 2; ///< Number of rows in the text display.
105
106 /**
107 * @brief Total "expanded" count for text engine usage.
108 */
109 static const uint8_t menuCountEng = menuCount;
110
111 /**
112 * @brief Text engine for rendering menu lines.
113 */
115
116 /**
117 * @brief Face count for how many faces are selectable in this project.
118 */
119 static uint8_t faceCount;
120
121 /**
122 * @brief Tracks the currently active menu index (if using isSecondary mode).
123 */
124 static uint8_t currentMenu;
125
126 /**
127 * @brief Wiggle effect parameters for the menu's animation.
128 */
129 static float wiggleRatio; ///< How pronounced the wiggle effect is.
130 static float wiggleSpeedX; ///< Speed of horizontal wiggle.
131 static float wiggleSpeedY; ///< Speed of vertical wiggle.
132 static float wiggleSpeedR; ///< Speed of rotational wiggle.
133
134 /**
135 * @brief Indicates whether this Menu is in "secondary" mode (no hardware input, used externally).
136 */
137 static bool isSecondary;
138
139 /**
140 * @brief Stored state for each menu item (if isSecondary is true).
141 */
142 static uint8_t faceState; ///< Currently selected face index.
143 static uint8_t bright; ///< Brightness level.
144 static uint8_t accentBright; ///< Accent brightness level.
145 static uint8_t microphone; ///< Microphone usage toggle.
146 static uint8_t micLevel; ///< Microphone level setting.
147 static uint8_t boopSensor; ///< Boop sensor usage toggle.
148 static uint8_t spectrumMirror; ///< Spectrum mirroring toggle.
149 static uint8_t faceSize; ///< Face size setting.
150 static uint8_t color; ///< Current color setting.
151 static uint8_t huef; ///< Front hue setting.
152 static uint8_t hueb; ///< Back hue setting.
153 static uint8_t effect; ///< Current effect index.
154 static uint8_t fanSpeed; ///< Fan speed setting.
155
156 /**
157 * @brief Raw string lines for the textual interface (line1 as label row, line2 as value row).
158 */
159 static String line1;
160 static String line2;
161
162 /**
163 * @brief EffectChangeTrack for smoothly transitioning the effect strength.
164 */
166 static float effectStrength; ///< The current strength ratio for the applied effect.
167 static uint8_t previousMenu; ///< Tracks a previous face state to detect changes.
168
169 /**
170 * @brief Various post-processing effects instantiated.
171 */
184
185 /**
186 * @brief Defines the maximum allowed values for each menu parameter.
187 */
188 static void SetMaxEntries();
189
190 /**
191 * @brief Sets default values for each menu parameter (e.g., on initial load).
192 */
193 static void SetDefaultEntries();
194
195public:
196 /**
197 * @brief Initializes the Menu using a face count, input pin, holding time, and size.
198 *
199 * This overload is typically used in single-button mode (not NeoTrellis):
200 * it sets up the DampedSpring, the text engine, and hardware input for user navigation.
201 *
202 * @param faceCount The maximum number of faces selectable.
203 * @param pin The GPIO pin for the button input.
204 * @param holdingTime The time threshold for press-and-hold actions.
205 * @param size The size (width, height) for the menu in screen coordinates.
206 */
207 static void Initialize(uint8_t faceCount, uint8_t pin, uint16_t holdingTime,
208 Vector2D size = Vector2D(240, 50));
209
210 /**
211 * @brief Initializes the Menu using just a face count and size.
212 *
213 * This overload is typically used with NeoTrellis or other forms of input:
214 * it sets up the DampedSpring, text engine, and handles the menu logic in isSecondary mode.
215 *
216 * @param faceCount The maximum number of faces selectable.
217 * @param size The size (width, height) for the menu in screen coordinates.
218 */
219 static void Initialize(uint8_t faceCount, Vector2D size = Vector2D(240, 50));
220
221 /**
222 * @brief Provides a pointer to the material used for rendering the menu text.
223 * @return A pointer to the TextEngine-based material.
224 */
225 static Material* GetMaterial();
226
227 /**
228 * @brief Retrieves the current effect (post-processing) based on the menu setting.
229 * @return A pointer to the selected Effect object.
230 */
231 static Effect* GetEffect();
232
233 /**
234 * @brief Gets the currently selected menu index from the MenuHandler (if in hardware mode).
235 * @return The active MenuState index (e.g., Bright, Microphone, etc.).
236 */
237 static uint8_t GetCurrentMenu();
238
239 /**
240 * @brief Gets the current value of the active menu parameter from the MenuHandler.
241 * @return The parameter value associated with the active menu index.
242 */
243 static uint8_t GetCurrentMenuValue();
244
245 /**
246 * @brief Manually sets the current menu index (used in isSecondary mode).
247 * @param currentMenu The new menu index to set.
248 */
249 static void SetCurrentMenu(uint8_t currentMenu);
250
251 /**
252 * @brief Updates the menu each frame, handling transitions, wiggle effects, and text generation.
253 * @param ratio A normalized value typically used in animation loops (0.0f to 1.0f).
254 */
255 static void Update(float ratio);
256
257 /**
258 * @brief Sets the amplitude of the wiggle effect.
259 * @param wiggleRatio A multiplier for the wiggle offsets.
260 */
261 static void SetWiggleRatio(float wiggleRatio);
262
263 /**
264 * @brief Sets the speed multipliers for X-axis, Y-axis, and rotational wiggle.
265 * @param wiggleSpeedX Speed multiplier for the X direction.
266 * @param wiggleSpeedY Speed multiplier for the Y direction.
267 * @param wiggleSpeedR Speed multiplier for rotation.
268 */
269 static void SetWiggleSpeed(float wiggleSpeedX, float wiggleSpeedY, float wiggleSpeedR);
270
271 /**
272 * @brief Sets the overall menu size and updates the text engine accordingly.
273 * @param size The new menu size in screen coordinates (width, height).
274 */
275 static void SetSize(Vector2D size);
276
277 /**
278 * @brief Returns the current screen-space position of the menu.
279 * @return A Vector2D representing the menu's position.
280 */
281 static Vector2D GetPosition();
282
283 /**
284 * @brief Sets the base position of the menu (plus any existing offsets).
285 * @param position The new position to assign to the menu.
286 */
287 static void SetPosition(Vector2D position);
288
289 /**
290 * @brief Sets an additional offset to be added on top of the base position.
291 * @param positionOffset The new offset to store internally.
292 */
294
295 /**
296 * @brief Sets the pivot or rotation offset for the text engine.
297 * @param rotationOffset The pivot offset (typically the center of the menu).
298 */
300
301 /**
302 * @brief Gets the current menu rotation angle.
303 * @return The rotation angle.
304 */
305 static float GetRotation();
306
307 /**
308 * @brief Sets the rotation angle for the menu (in degrees or radians, based on usage).
309 * @param rotation The new rotation angle.
310 */
311 static void SetRotation(float rotation);
312
313 /**
314 * @brief Converts a digit character into a "blink" character for visual emphasis.
315 * @param value The digit character (e.g., '0' to '9').
316 * @return A corresponding blink character for highlighting the selection.
317 */
318 static char IntToBlink(char value);
319
320 /**
321 * @brief Generates a line of characters for displaying available options (0-9),
322 * visually highlighting the currently selected index.
323 * @param options The total number of options (e.g., 10).
324 * @param selection The currently selected option.
325 * @return A String containing spaced/arranged characters for the menu display.
326 */
327 static String GenerateLine(uint8_t options, uint8_t selection);
328
329 /**
330 * @brief Generates the textual representation of the menu (two lines) and
331 * updates the TextEngine with that text.
332 */
333 static void GenerateText();
334
335 /**
336 * @brief Manually sets the face state (active face index) if in isSecondary mode.
337 * @param faceState The new face index to set.
338 */
339 static void SetFaceState(uint8_t faceState);
340
341 /**
342 * @brief Retrieves the current face state. In hardware mode, it is read from the MenuHandler.
343 * @return The current face index.
344 */
345 static uint8_t GetFaceState();
346
347 /**
348 * @brief Sets the brightness level if in isSecondary mode.
349 * @param bright The new brightness level.
350 */
351 static void SetBrightness(uint8_t bright);
352
353 /**
354 * @brief Gets the current brightness level. In hardware mode, it is read from the MenuHandler.
355 * @return The brightness level.
356 */
357 static uint8_t GetBrightness();
358
359 /**
360 * @brief Sets the accent brightness level if in isSecondary mode.
361 * @param accentBright The new accent brightness level.
362 */
363 static void SetAccentBrightness(uint8_t accentBright);
364
365 /**
366 * @brief Gets the current accent brightness level.
367 * @return The accent brightness level.
368 */
369 static uint8_t GetAccentBrightness();
370
371 /**
372 * @brief Sets whether to use the microphone if in isSecondary mode.
373 * @param microphone 0 or 1 representing off/on.
374 */
375 static void SetUseMicrophone(uint8_t microphone);
376
377 /**
378 * @brief Checks if the microphone usage is toggled on or off.
379 * @return A uint8_t (0 or 1).
380 */
381 static uint8_t UseMicrophone();
382
383 /**
384 * @brief Sets the microphone level (gain) if in isSecondary mode.
385 * @param micLevel The new microphone level (0 to 10).
386 */
387 static void SetMicLevel(uint8_t micLevel);
388
389 /**
390 * @brief Gets the current microphone level.
391 * @return The microphone level (0 to 10).
392 */
393 static uint8_t GetMicLevel();
394
395 /**
396 * @brief Sets the boop sensor usage if in isSecondary mode.
397 * @param boopSensor 0 or 1 representing off/on.
398 */
399 static void SetUseBoopSensor(uint8_t boopSensor);
400
401 /**
402 * @brief Checks if the boop sensor usage is toggled on or off.
403 * @return A uint8_t (0 or 1).
404 */
405 static uint8_t UseBoopSensor();
406
407 /**
408 * @brief Sets whether the spectrum analyzer should be mirrored if in isSecondary mode.
409 * @param spectrumMirror 0 or 1 representing off/on.
410 */
411 static void SetMirrorSpectrumAnalyzer(uint8_t spectrumMirror);
412
413 /**
414 * @brief Checks if the spectrum analyzer mirroring is toggled on or off.
415 * @return A uint8_t (0 or 1).
416 */
417 static uint8_t MirrorSpectrumAnalyzer();
418
419 /**
420 * @brief Sets the face size if in isSecondary mode.
421 * @param faceSize The new face size index (0-10).
422 */
423 static void SetFaceSize(uint8_t faceSize);
424
425 /**
426 * @brief Gets the current face size.
427 * @return The face size index (0-10).
428 */
429 static uint8_t GetFaceSize();
430
431 /**
432 * @brief Sets the face color index if in isSecondary mode.
433 * @param color The new color index (0-10).
434 */
435 static void SetFaceColor(uint8_t color);
436
437 /**
438 * @brief Gets the current face color index.
439 * @return The color index (0-10).
440 */
441 static uint8_t GetFaceColor();
442
443 /**
444 * @brief Sets the front hue value if in isSecondary mode.
445 * @param huef The new front hue (0-10).
446 */
447 static void SetHueF(uint8_t huef);
448
449 /**
450 * @brief Gets the front hue value.
451 * @return The front hue (0-10).
452 */
453 static uint8_t GetHueF();
454
455 /**
456 * @brief Sets the back hue value if in isSecondary mode.
457 * @param hueb The new back hue (0-10).
458 */
459 static void SetHueB(uint8_t hueb);
460
461 /**
462 * @brief Gets the back hue value.
463 * @return The back hue (0-10).
464 */
465 static uint8_t GetHueB();
466
467 /**
468 * @brief Sets which effect is selected if in isSecondary mode.
469 * @param effect The new effect index (0-9).
470 */
471 static void SetEffectS(uint8_t effect);
472
473 /**
474 * @brief Gets the currently selected effect index.
475 * @return The effect index (0-9).
476 */
477 static uint8_t GetEffectS();
478
479 /**
480 * @brief Sets the fan speed if in isSecondary mode.
481 * @param fanSpeed The new fan speed index (0-10).
482 */
483 static void SetFanSpeed(uint8_t fanSpeed);
484
485 /**
486 * @brief Gets the current fan speed index.
487 * @return The fan speed index (0-10).
488 */
489 static uint8_t GetFanSpeed();
490
491 /**
492 * @brief Returns how much of the menu is shown, typically normalized (0.0 to 1.0).
493 * @return A float representing the show menu ratio, scaled down by 100.
494 */
495 static float ShowMenu();
496};
Simulates the motion of a damped spring.
A template class for animating effect transitions using keyframes.
Abstract base class for applying visual effects to pixel groups.
Definition Effect.h:26
Implements a fisheye distortion effect for pixel groups.
Definition Fisheye.h:26
Implements a glitch effect along the X-axis for pixel groups.
Definition GlitchX.h:26
Implements a horizontal blur effect for pixel groups.
Implements a magnetic distortion effect for pixel groups.
Definition Magnet.h:25
Abstract base class for rendering materials.
Definition Material.h:27
A class responsible for displaying and controlling a parameter menu within the project....
Definition Menu.h:51
static float GetRotation()
Gets the current menu rotation angle.
Definition Menu.cpp:285
static Magnet magnet
Definition Menu.h:177
static float wiggleSpeedY
Speed of vertical wiggle.
Definition Menu.h:131
static void SetMirrorSpectrumAnalyzer(uint8_t spectrumMirror)
Sets whether the spectrum analyzer should be mirrored if in isSecondary mode.
Definition Menu.cpp:431
static void SetUseMicrophone(uint8_t microphone)
Sets whether to use the microphone if in isSecondary mode.
Definition Menu.cpp:404
static void SetDefaultEntries()
Sets default values for each menu parameter (e.g., on initial load).
Definition Menu.cpp:83
static float rotation
Rotation angle (in degrees or radians, depending on usage).
Definition Menu.h:97
static Overflow overflow
Definition Menu.h:183
static PhaseOffsetR phaseR
Definition Menu.h:181
static uint8_t GetCurrentMenuValue()
Gets the current value of the active menu parameter from the MenuHandler.
Definition Menu.cpp:200
static char IntToBlink(char value)
Converts a digit character into a "blink" character for visual emphasis.
Definition Menu.cpp:294
static uint8_t GetFaceState()
Retrieves the current face state. In hardware mode, it is read from the MenuHandler.
Definition Menu.cpp:381
static Vector2D position
The current position of the menu.
Definition Menu.h:94
static void SetFanSpeed(uint8_t fanSpeed)
Sets the fan speed if in isSecondary mode.
Definition Menu.cpp:485
static uint8_t previousMenu
Tracks a previous face state to detect changes.
Definition Menu.h:167
static uint8_t GetEffectS()
Gets the currently selected effect index.
Definition Menu.cpp:480
static ShiftR shiftR
Definition Menu.h:182
static void SetRotation(float rotation)
Sets the rotation angle for the menu (in degrees or radians, based on usage).
Definition Menu.cpp:289
static void SetHueB(uint8_t hueb)
Sets the back hue value if in isSecondary mode.
Definition Menu.cpp:467
static PhaseOffsetX phaseX
Definition Menu.h:179
static Fisheye fisheye
Definition Menu.h:173
static uint8_t boopSensor
Boop sensor usage toggle.
Definition Menu.h:147
static RainbowNoise material
A RainbowNoise material (used for text styling, if desired).
Definition Menu.h:82
static uint8_t currentMenu
Tracks the currently active menu index (if using isSecondary mode).
Definition Menu.h:124
static uint8_t GetFaceColor()
Gets the current face color index.
Definition Menu.cpp:453
static uint8_t GetMicLevel()
Gets the current microphone level.
Definition Menu.cpp:417
static void SetPositionOffset(Vector2D positionOffset)
Sets an additional offset to be added on top of the base position.
Definition Menu.cpp:276
static void SetUseBoopSensor(uint8_t boopSensor)
Sets the boop sensor usage if in isSecondary mode.
Definition Menu.cpp:422
static VerticalBlur blurV
Definition Menu.h:176
static float ShowMenu()
Returns how much of the menu is shown, typically normalized (0.0 to 1.0).
Definition Menu.cpp:494
static EffectChangeTrack< 1 > effectChange
EffectChangeTrack for smoothly transitioning the effect strength.
Definition Menu.h:165
static DampedSpring dampedSpringX
DampedSpring objects used for smooth transitions in the X-direction and for menu visibility.
Definition Menu.h:87
static String line2
Definition Menu.h:160
static Vector2D positionOffset
Additional offset to apply to the menu's position.
Definition Menu.h:95
static void SetHueF(uint8_t huef)
Sets the front hue value if in isSecondary mode.
Definition Menu.cpp:458
static void GenerateText()
Generates the textual representation of the menu (two lines) and updates the TextEngine with that tex...
Definition Menu.cpp:356
static const uint8_t menuCountEng
Total "expanded" count for text engine usage.
Definition Menu.h:109
static uint8_t spectrumMirror
Spectrum mirroring toggle.
Definition Menu.h:148
static void SetWiggleSpeed(float wiggleSpeedX, float wiggleSpeedY, float wiggleSpeedR)
Sets the speed multipliers for X-axis, Y-axis, and rotational wiggle.
Definition Menu.cpp:253
static void SetFaceColor(uint8_t color)
Sets the face color index if in isSecondary mode.
Definition Menu.cpp:449
static const uint8_t menuCount
Total number of menu items.
Definition Menu.h:77
static void SetMaxEntries()
Defines the maximum allowed values for each menu parameter.
Definition Menu.cpp:62
static uint8_t GetFanSpeed()
Gets the current fan speed index.
Definition Menu.cpp:489
static void SetFaceState(uint8_t faceState)
Manually sets the face state (active face index) if in isSecondary mode.
Definition Menu.cpp:377
static Material * GetMaterial()
Provides a pointer to the material used for rendering the menu text.
Definition Menu.cpp:155
static void SetAccentBrightness(uint8_t accentBright)
Sets the accent brightness level if in isSecondary mode.
Definition Menu.cpp:395
static RadialBlur blurR
Definition Menu.h:178
static uint8_t MirrorSpectrumAnalyzer()
Checks if the spectrum analyzer mirroring is toggled on or off.
Definition Menu.cpp:435
static uint8_t GetFaceSize()
Gets the current face size.
Definition Menu.cpp:444
static void SetCurrentMenu(uint8_t currentMenu)
Manually sets the current menu index (used in isSecondary mode).
Definition Menu.cpp:204
static void Initialize(uint8_t faceCount, uint8_t pin, uint16_t holdingTime, Vector2D size=Vector2D(240, 50))
Initializes the Menu using a face count, input pin, holding time, and size.
Definition Menu.cpp:102
static uint8_t accentBright
Accent brightness level.
Definition Menu.h:144
static String line1
Raw string lines for the textual interface (line1 as label row, line2 as value row).
Definition Menu.h:159
static float wiggleRatio
Wiggle effect parameters for the menu's animation.
Definition Menu.h:129
static uint8_t bright
Brightness level.
Definition Menu.h:143
static const uint8_t menuRows
Number of rows in the text display.
Definition Menu.h:104
static uint8_t GetHueF()
Gets the front hue value.
Definition Menu.cpp:462
static void SetRotationOffset(Vector2D rotationOffset)
Sets the pivot or rotation offset for the text engine.
Definition Menu.cpp:280
static Passthrough passthrough
Various post-processing effects instantiated.
Definition Menu.h:172
static uint8_t GetCurrentMenu()
Gets the currently selected menu index from the MenuHandler (if in hardware mode).
Definition Menu.cpp:196
static PhaseOffsetY phaseY
Definition Menu.h:180
static void SetSize(Vector2D size)
Sets the overall menu size and updates the text engine accordingly.
Definition Menu.cpp:259
static uint8_t faceCount
Face count for how many faces are selectable in this project.
Definition Menu.h:119
MenuState
Enumerates different parameter items or states in the menu.
Definition Menu.h:57
@ Color
Controls the face color selection.
Definition Menu.h:66
@ EffectS
Controls which post-processing effect is active.
Definition Menu.h:69
@ SpectrumMirror
Toggles mirror effect for SpectrumAnalyzer (on/off).
Definition Menu.h:64
@ FaceSize
Controls the size of the face mesh or display.
Definition Menu.h:65
@ MicLevel
Controls microphone level (gain).
Definition Menu.h:62
@ Bright
Controls the overall brightness.
Definition Menu.h:59
@ Microphone
Toggles microphone usage (on/off).
Definition Menu.h:61
@ AccentBright
Controls the accent brightness.
Definition Menu.h:60
@ BoopSensor
Toggles boop sensor usage (on/off).
Definition Menu.h:63
@ HueB
Controls the back hue value.
Definition Menu.h:68
@ HueF
Controls the front hue value.
Definition Menu.h:67
@ FanSpeed
Controls the fan speed.
Definition Menu.h:70
@ Faces
Controls the current face index.
Definition Menu.h:58
static void SetWiggleRatio(float wiggleRatio)
Sets the amplitude of the wiggle effect.
Definition Menu.cpp:249
static uint8_t faceState
Stored state for each menu item (if isSecondary is true).
Definition Menu.h:142
static uint8_t UseMicrophone()
Checks if the microphone usage is toggled on or off.
Definition Menu.cpp:408
static float showMenuRatio
Normalized ratio (0.0 to 100.0) controlling how much the menu is shown.
Definition Menu.h:98
static uint8_t micLevel
Microphone level setting.
Definition Menu.h:146
static const uint8_t menuLength
Dimensions for the internal text layout, e.g., number of columns/rows.
Definition Menu.h:103
static uint8_t color
Current color setting.
Definition Menu.h:150
static GlitchX glitchX
Definition Menu.h:174
static uint8_t faceSize
Face size setting.
Definition Menu.h:149
static float effectStrength
The current strength ratio for the applied effect.
Definition Menu.h:166
static void SetMicLevel(uint8_t micLevel)
Sets the microphone level (gain) if in isSecondary mode.
Definition Menu.cpp:413
static uint8_t UseBoopSensor()
Checks if the boop sensor usage is toggled on or off.
Definition Menu.cpp:426
static TextEngine< menuRows, menuLength *menuCountEng > textEngine
Text engine for rendering menu lines.
Definition Menu.h:114
static float wiggleSpeedX
Speed of horizontal wiggle.
Definition Menu.h:130
static float wiggleSpeedR
Speed of rotational wiggle.
Definition Menu.h:132
static uint8_t microphone
Microphone usage toggle.
Definition Menu.h:145
static void Update(float ratio)
Updates the menu each frame, handling transitions, wiggle effects, and text generation.
Definition Menu.cpp:208
static uint8_t huef
Front hue setting.
Definition Menu.h:151
static uint8_t GetHueB()
Gets the back hue value.
Definition Menu.cpp:471
static void SetEffectS(uint8_t effect)
Sets which effect is selected if in isSecondary mode.
Definition Menu.cpp:476
static Vector2D rotationOffset
Offset for pivoting the menu (e.g., around its center).
Definition Menu.h:96
static uint8_t fanSpeed
Fan speed setting.
Definition Menu.h:154
static HorizontalBlur blurH
Definition Menu.h:175
static bool isSecondary
Indicates whether this Menu is in "secondary" mode (no hardware input, used externally).
Definition Menu.h:137
static void SetFaceSize(uint8_t faceSize)
Sets the face size if in isSecondary mode.
Definition Menu.cpp:440
static String GenerateLine(uint8_t options, uint8_t selection)
Generates a line of characters for displaying available options (0-9), visually highlighting the curr...
Definition Menu.cpp:321
static uint8_t GetBrightness()
Gets the current brightness level. In hardware mode, it is read from the MenuHandler.
Definition Menu.cpp:390
static Effect * GetEffect()
Retrieves the current effect (post-processing) based on the menu setting.
Definition Menu.cpp:159
static DampedSpring dampedSpringShow
Controls the show/hide ratio of the menu.
Definition Menu.h:88
static void SetPosition(Vector2D position)
Sets the base position of the menu (plus any existing offsets).
Definition Menu.cpp:271
static Vector2D GetPosition()
Returns the current screen-space position of the menu.
Definition Menu.cpp:267
static uint8_t GetAccentBrightness()
Gets the current accent brightness level.
Definition Menu.cpp:399
static void SetBrightness(uint8_t bright)
Sets the brightness level if in isSecondary mode.
Definition Menu.cpp:386
static Vector2D size
UI geometry: size, position, offsets, and rotation.
Definition Menu.h:93
static uint8_t hueb
Back hue setting.
Definition Menu.h:152
static uint8_t effect
Current effect index.
Definition Menu.h:153
Implements an overflow distortion effect for pixel groups.
Definition Overflow.h:24
A no-operation effect that leaves pixel groups unchanged.
Definition Passthrough.h:24
Applies rotational phase offsets to pixel groups.
Applies horizontal phase offsets to pixel groups.
Applies vertical phase offsets to pixel groups.
Applies a radial blur effect to pixel groups.
Definition RadialBlur.h:26
A dynamic material that creates a rainbow effect using simplex noise.
Radially shifts the red, green, and blue channels of the pixels.
Definition ShiftR.h:26
Represents a 2D vector (X, Y) and provides methods for vector arithmetic.
Definition Vector2D.h:27
An effect that applies a vertical blur to a pixel group.