ProtoTracer  1.0
Real-time 3D rendering and animation engine
Loading...
Searching...
No Matches
Menu Class Reference

A class responsible for displaying and controlling a parameter menu within the project. It allows the user to change various settings (e.g., brightness, microphone level, boop sensor, effects) and to navigate through menu items. More...

#include <Menu.h>

Collaboration diagram for Menu:

Public Types

enum  MenuState {
  Faces , Bright , AccentBright , Microphone ,
  MicLevel , BoopSensor , SpectrumMirror , FaceSize ,
  Color , HueF , HueB , EffectS ,
  FanSpeed
}
 Enumerates different parameter items or states in the menu. More...
 

Static Public Member Functions

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.
 
static void Initialize (uint8_t faceCount, Vector2D size=Vector2D(240, 50))
 Initializes the Menu using just a face count and size.
 
static MaterialGetMaterial ()
 Provides a pointer to the material used for rendering the menu text.
 
static EffectGetEffect ()
 Retrieves the current effect (post-processing) based on the menu setting.
 
static uint8_t GetCurrentMenu ()
 Gets the currently selected menu index from the MenuHandler (if in hardware mode).
 
static uint8_t GetCurrentMenuValue ()
 Gets the current value of the active menu parameter from the MenuHandler.
 
static void SetCurrentMenu (uint8_t currentMenu)
 Manually sets the current menu index (used in isSecondary mode).
 
static void Update (float ratio)
 Updates the menu each frame, handling transitions, wiggle effects, and text generation.
 
static void SetWiggleRatio (float wiggleRatio)
 Sets the amplitude of the wiggle effect.
 
static void SetWiggleSpeed (float wiggleSpeedX, float wiggleSpeedY, float wiggleSpeedR)
 Sets the speed multipliers for X-axis, Y-axis, and rotational wiggle.
 
static void SetSize (Vector2D size)
 Sets the overall menu size and updates the text engine accordingly.
 
static Vector2D GetPosition ()
 Returns the current screen-space position of the menu.
 
static void SetPosition (Vector2D position)
 Sets the base position of the menu (plus any existing offsets).
 
static void SetPositionOffset (Vector2D positionOffset)
 Sets an additional offset to be added on top of the base position.
 
static void SetRotationOffset (Vector2D rotationOffset)
 Sets the pivot or rotation offset for the text engine.
 
static float GetRotation ()
 Gets the current menu rotation angle.
 
static void SetRotation (float rotation)
 Sets the rotation angle for the menu (in degrees or radians, based on usage).
 
static char IntToBlink (char value)
 Converts a digit character into a "blink" character for visual emphasis.
 
static String GenerateLine (uint8_t options, uint8_t selection)
 Generates a line of characters for displaying available options (0-9), visually highlighting the currently selected index.
 
static void GenerateText ()
 Generates the textual representation of the menu (two lines) and updates the TextEngine with that text.
 
static void SetFaceState (uint8_t faceState)
 Manually sets the face state (active face index) if in isSecondary mode.
 
static uint8_t GetFaceState ()
 Retrieves the current face state. In hardware mode, it is read from the MenuHandler.
 
static void SetBrightness (uint8_t bright)
 Sets the brightness level if in isSecondary mode.
 
static uint8_t GetBrightness ()
 Gets the current brightness level. In hardware mode, it is read from the MenuHandler.
 
static void SetAccentBrightness (uint8_t accentBright)
 Sets the accent brightness level if in isSecondary mode.
 
static uint8_t GetAccentBrightness ()
 Gets the current accent brightness level.
 
static void SetUseMicrophone (uint8_t microphone)
 Sets whether to use the microphone if in isSecondary mode.
 
static uint8_t UseMicrophone ()
 Checks if the microphone usage is toggled on or off.
 
static void SetMicLevel (uint8_t micLevel)
 Sets the microphone level (gain) if in isSecondary mode.
 
static uint8_t GetMicLevel ()
 Gets the current microphone level.
 
static void SetUseBoopSensor (uint8_t boopSensor)
 Sets the boop sensor usage if in isSecondary mode.
 
static uint8_t UseBoopSensor ()
 Checks if the boop sensor usage is toggled on or off.
 
static void SetMirrorSpectrumAnalyzer (uint8_t spectrumMirror)
 Sets whether the spectrum analyzer should be mirrored if in isSecondary mode.
 
static uint8_t MirrorSpectrumAnalyzer ()
 Checks if the spectrum analyzer mirroring is toggled on or off.
 
static void SetFaceSize (uint8_t faceSize)
 Sets the face size if in isSecondary mode.
 
static uint8_t GetFaceSize ()
 Gets the current face size.
 
static void SetFaceColor (uint8_t color)
 Sets the face color index if in isSecondary mode.
 
static uint8_t GetFaceColor ()
 Gets the current face color index.
 
static void SetHueF (uint8_t huef)
 Sets the front hue value if in isSecondary mode.
 
static uint8_t GetHueF ()
 Gets the front hue value.
 
static void SetHueB (uint8_t hueb)
 Sets the back hue value if in isSecondary mode.
 
static uint8_t GetHueB ()
 Gets the back hue value.
 
static void SetEffectS (uint8_t effect)
 Sets which effect is selected if in isSecondary mode.
 
static uint8_t GetEffectS ()
 Gets the currently selected effect index.
 
static void SetFanSpeed (uint8_t fanSpeed)
 Sets the fan speed if in isSecondary mode.
 
static uint8_t GetFanSpeed ()
 Gets the current fan speed index.
 
static float ShowMenu ()
 Returns how much of the menu is shown, typically normalized (0.0 to 1.0).
 

Static Private Member Functions

static void SetMaxEntries ()
 Defines the maximum allowed values for each menu parameter.
 
static void SetDefaultEntries ()
 Sets default values for each menu parameter (e.g., on initial load).
 

Static Private Attributes

static const uint8_t menuCount = 13
 Total number of menu items.
 
static RainbowNoise material
 A RainbowNoise material (used for text styling, if desired).
 
static DampedSpring dampedSpringX
 DampedSpring objects used for smooth transitions in the X-direction and for menu visibility.
 
static DampedSpring dampedSpringShow
 Controls the show/hide ratio of the menu.
 
static Vector2D size
 UI geometry: size, position, offsets, and rotation.
 
static Vector2D position
 The current position of the menu.
 
static Vector2D positionOffset
 Additional offset to apply to the menu's position.
 
static Vector2D rotationOffset
 Offset for pivoting the menu (e.g., around its center).
 
static float rotation
 Rotation angle (in degrees or radians, depending on usage).
 
static float showMenuRatio
 Normalized ratio (0.0 to 100.0) controlling how much the menu is shown.
 
static const uint8_t menuLength = 12
 Dimensions for the internal text layout, e.g., number of columns/rows.
 
static const uint8_t menuRows = 2
 Number of rows in the text display.
 
static const uint8_t menuCountEng = menuCount
 Total "expanded" count for text engine usage.
 
static TextEngine< menuRows, menuLength *menuCountEngtextEngine
 Text engine for rendering menu lines.
 
static uint8_t faceCount
 Face count for how many faces are selectable in this project.
 
static uint8_t currentMenu = 0
 Tracks the currently active menu index (if using isSecondary mode).
 
static float wiggleRatio = 1.0f
 Wiggle effect parameters for the menu's animation.
 
static float wiggleSpeedX = 1.0f
 Speed of horizontal wiggle.
 
static float wiggleSpeedY = 1.0f
 Speed of vertical wiggle.
 
static float wiggleSpeedR = 1.0f
 Speed of rotational wiggle.
 
static bool isSecondary = 0
 Indicates whether this Menu is in "secondary" mode (no hardware input, used externally).
 
static uint8_t faceState = 0
 Stored state for each menu item (if isSecondary is true).
 
static uint8_t bright = 0
 Brightness level.
 
static uint8_t accentBright = 0
 Accent brightness level.
 
static uint8_t microphone = 0
 Microphone usage toggle.
 
static uint8_t micLevel = 0
 Microphone level setting.
 
static uint8_t boopSensor = 0
 Boop sensor usage toggle.
 
static uint8_t spectrumMirror = 0
 Spectrum mirroring toggle.
 
static uint8_t faceSize = 0
 Face size setting.
 
static uint8_t color = 0
 Current color setting.
 
static uint8_t huef = 0
 Front hue setting.
 
static uint8_t hueb = 0
 Back hue setting.
 
static uint8_t effect = 0
 Current effect index.
 
static uint8_t fanSpeed = 0
 Fan speed setting.
 
static String line1 = " BRIGHT SDE BRIGHT MIC MIC LEVEL BOOP SPEC SIZE COLOR HUE F HUE B EFFECT FAN SPEED "
 Raw string lines for the textual interface (line1 as label row, line2 as value row).
 
static String line2 = " a b c d e f 12^45 12^45 ON off 123456|8 on OFF ON off 12^45 123456|8 123456|8 123456|8 123456|8 123456|8 "
 
static EffectChangeTrack< 1 > effectChange
 EffectChangeTrack for smoothly transitioning the effect strength.
 
static float effectStrength = 0.0f
 The current strength ratio for the applied effect.
 
static uint8_t previousMenu = 0
 Tracks a previous face state to detect changes.
 
static Passthrough passthrough = Passthrough()
 Various post-processing effects instantiated.
 
static Fisheye fisheye = Fisheye()
 
static GlitchX glitchX = GlitchX(30)
 
static HorizontalBlur blurH = HorizontalBlur(16)
 
static VerticalBlur blurV = VerticalBlur(16)
 
static Magnet magnet = Magnet()
 
static RadialBlur blurR = RadialBlur(16)
 
static PhaseOffsetX phaseX = PhaseOffsetX(20)
 
static PhaseOffsetY phaseY = PhaseOffsetY(20)
 
static PhaseOffsetR phaseR = PhaseOffsetR(20)
 
static ShiftR shiftR = ShiftR(20)
 
static Overflow overflow = Overflow(20)
 

Detailed Description

A class responsible for displaying and controlling a parameter menu within the project. It allows the user to change various settings (e.g., brightness, microphone level, boop sensor, effects) and to navigate through menu items.

The Menu system integrates a TextEngine-based UI, plus optional interactive hardware inputs (button, NeoTrellis, etc.). It also provides visual "wiggle" effects and manages transitions via DampedSpring.

Definition at line 51 of file Menu.h.

Member Enumeration Documentation

◆ MenuState

Enumerates different parameter items or states in the menu.

Enumerator
Faces 

Controls the current face index.

Bright 

Controls the overall brightness.

AccentBright 

Controls the accent brightness.

Microphone 

Toggles microphone usage (on/off).

MicLevel 

Controls microphone level (gain).

BoopSensor 

Toggles boop sensor usage (on/off).

SpectrumMirror 

Toggles mirror effect for SpectrumAnalyzer (on/off).

FaceSize 

Controls the size of the face mesh or display.

Color 

Controls the face color selection.

HueF 

Controls the front hue value.

HueB 

Controls the back hue value.

EffectS 

Controls which post-processing effect is active.

FanSpeed 

Controls the fan speed.

Definition at line 57 of file Menu.h.

Member Function Documentation

◆ GenerateLine()

String GenerateLine ( uint8_t  options,
uint8_t  selection 
)
static

Generates a line of characters for displaying available options (0-9), visually highlighting the currently selected index.

Parameters
optionsThe total number of options (e.g., 10).
selectionThe currently selected option.
Returns
A String containing spaced/arranged characters for the menu display.

Definition at line 321 of file Menu.cpp.

References IntToBlink(), and menuLength.

Referenced by GenerateText().

◆ GenerateText()

void GenerateText ( )
static

◆ GetAccentBrightness()

◆ GetBrightness()

◆ GetCurrentMenu()

uint8_t GetCurrentMenu ( )
static

Gets the currently selected menu index from the MenuHandler (if in hardware mode).

Returns
The active MenuState index (e.g., Bright, Microphone, etc.).

Definition at line 196 of file Menu.cpp.

References MenuHandler< menuCount >::GetCurrentMenu().

Referenced by HeadsUpDisplay::CheckInvertPrintText(), and GetCurrentMenuValue().

◆ GetCurrentMenuValue()

uint8_t GetCurrentMenuValue ( )
static

Gets the current value of the active menu parameter from the MenuHandler.

Returns
The parameter value associated with the active menu index.

Definition at line 200 of file Menu.cpp.

References GetCurrentMenu(), and MenuHandler< menuCount >::GetMenuValue().

◆ GetEffect()

Effect * GetEffect ( )
static

Retrieves the current effect (post-processing) based on the menu setting.

Returns
A pointer to the selected Effect object.

Definition at line 159 of file Menu.cpp.

References GetEffectS(), glitchX, passthrough, phaseR, phaseX, and phaseY.

Referenced by Update(), and ProtogenProject::UpdateFace().

◆ GetEffectS()

uint8_t GetEffectS ( )
static

Gets the currently selected effect index.

Returns
The effect index (0-9).

Definition at line 480 of file Menu.cpp.

References effect, EffectS, MenuHandler< menuCount >::GetMenuValue(), and isSecondary.

Referenced by GenerateText(), GetEffect(), and HeadsUpDisplay::UpdateFaceInformation().

◆ GetFaceColor()

◆ GetFaceSize()

◆ GetFaceState()

◆ GetFanSpeed()

uint8_t GetFanSpeed ( )
static

Gets the current fan speed index.

Returns
The fan speed index (0-10).

Definition at line 489 of file Menu.cpp.

References FanSpeed, fanSpeed, MenuHandler< menuCount >::GetMenuValue(), and isSecondary.

Referenced by GenerateText(), ProtogenProject::UpdateFace(), and HeadsUpDisplay::UpdateFaceInformation().

◆ GetHueB()

uint8_t GetHueB ( )
static

◆ GetHueF()

uint8_t GetHueF ( )
static

◆ GetMaterial()

◆ GetMicLevel()

◆ GetPosition()

Vector2D GetPosition ( )
static

Returns the current screen-space position of the menu.

Returns
A Vector2D representing the menu's position.

Definition at line 267 of file Menu.cpp.

References position.

◆ GetRotation()

float GetRotation ( )
static

Gets the current menu rotation angle.

Returns
The rotation angle.

Definition at line 285 of file Menu.cpp.

References rotation.

◆ Initialize() [1/2]

void Initialize ( uint8_t  faceCount,
uint8_t  pin,
uint16_t  holdingTime,
Vector2D  size = Vector2D(240, 50) 
)
static

Initializes the Menu using a face count, input pin, holding time, and size.

This overload is typically used in single-button mode (not NeoTrellis): it sets up the DampedSpring, the text engine, and hardware input for user navigation.

Parameters
faceCountThe maximum number of faces selectable.
pinThe GPIO pin for the button input.
holdingTimeThe time threshold for press-and-hold actions.
sizeThe size (width, height) for the menu in screen coordinates.

Definition at line 102 of file Menu.cpp.

References AnimationTrack< maxParameters, maxKeyFrames >::AddParameter(), MenuHandler< menuCount >::Begin(), dampedSpringShow, dampedSpringX, effectChange, effectStrength, faceCount, isSecondary, material, position, TextEngine< lineCount, characterWidth >::SetBlinkTime(), DampedSpring::SetConstants(), SetDefaultEntries(), TextEngine< lineCount, characterWidth >::SetMaterial(), SetMaxEntries(), TextEngine< lineCount, characterWidth >::SetPositionOffset(), SetSize(), size, and textEngine.

Referenced by AphoriAnimation::AphoriAnimation(), BasilGardenAnimation::BasilGardenAnimation(), GalaxyAnimation::GalaxyAnimation(), HertzzAnimation::HertzzAnimation(), InfraredAnimation::InfraredAnimation(), BroookAnimation::Initialize(), Warzone2Animation::Initialize(), GammaAnimation::Initialize(), HUB75AnimationSplit::Initialize(), WS35AnimationSplit::Initialize(), ProtogenProject::Initialize(), SammyAnimation::SammyAnimation(), SergaliciousAnimation::SergaliciousAnimation(), StrawberryAnimation::StrawberryAnimation(), TamamoAnimation::TamamoAnimation(), TechSaneAnimation::TechSaneAnimation(), and XenraxAnimation::XenraxAnimation().

◆ Initialize() [2/2]

void Initialize ( uint8_t  faceCount,
Vector2D  size = Vector2D(240, 50) 
)
static

Initializes the Menu using just a face count and size.

This overload is typically used with NeoTrellis or other forms of input: it sets up the DampedSpring, text engine, and handles the menu logic in isSecondary mode.

Parameters
faceCountThe maximum number of faces selectable.
sizeThe size (width, height) for the menu in screen coordinates.

Definition at line 130 of file Menu.cpp.

References dampedSpringShow, dampedSpringX, faceCount, isSecondary, material, position, TextEngine< lineCount, characterWidth >::SetBlinkTime(), DampedSpring::SetConstants(), SetDefaultEntries(), TextEngine< lineCount, characterWidth >::SetMaterial(), SetMaxEntries(), TextEngine< lineCount, characterWidth >::SetPositionOffset(), SetSize(), size, and textEngine.

◆ IntToBlink()

char IntToBlink ( char  value)
static

Converts a digit character into a "blink" character for visual emphasis.

Parameters
valueThe digit character (e.g., '0' to '9').
Returns
A corresponding blink character for highlighting the selection.

Definition at line 294 of file Menu.cpp.

Referenced by GenerateLine().

◆ MirrorSpectrumAnalyzer()

◆ SetAccentBrightness()

void SetAccentBrightness ( uint8_t  accentBright)
static

Sets the accent brightness level if in isSecondary mode.

Parameters
accentBrightThe new accent brightness level.

Definition at line 395 of file Menu.cpp.

References accentBright.

Referenced by GammaAnimation::Update().

◆ SetBrightness()

void SetBrightness ( uint8_t  bright)
static

Sets the brightness level if in isSecondary mode.

Parameters
brightThe new brightness level.

Definition at line 386 of file Menu.cpp.

References bright.

Referenced by GammaAnimation::Update().

◆ SetCurrentMenu()

void SetCurrentMenu ( uint8_t  currentMenu)
static

Manually sets the current menu index (used in isSecondary mode).

Parameters
currentMenuThe new menu index to set.

Definition at line 204 of file Menu.cpp.

References currentMenu.

Referenced by GammaAnimation::Update().

◆ SetDefaultEntries()

void SetDefaultEntries ( )
staticprivate

Sets default values for each menu parameter (e.g., on initial load).

Definition at line 83 of file Menu.cpp.

References AccentBright, BoopSensor, Bright, EffectS, Faces, FaceSize, FanSpeed, HueB, HueF, MicLevel, Microphone, MenuHandler< menuCount >::SetDefaultValue(), MenuHandler< menuCount >::SetInitialized(), and SpectrumMirror.

Referenced by Initialize(), and Initialize().

◆ SetEffectS()

void SetEffectS ( uint8_t  effect)
static

Sets which effect is selected if in isSecondary mode.

Parameters
effectThe new effect index (0-9).

Definition at line 476 of file Menu.cpp.

References effect.

◆ SetFaceColor()

void SetFaceColor ( uint8_t  color)
static

Sets the face color index if in isSecondary mode.

Parameters
colorThe new color index (0-10).

Definition at line 449 of file Menu.cpp.

References color.

Referenced by GammaAnimation::Update().

◆ SetFaceSize()

void SetFaceSize ( uint8_t  faceSize)
static

Sets the face size if in isSecondary mode.

Parameters
faceSizeThe new face size index (0-10).

Definition at line 440 of file Menu.cpp.

References faceSize.

Referenced by GammaAnimation::Update().

◆ SetFaceState()

void SetFaceState ( uint8_t  faceState)
static

Manually sets the face state (active face index) if in isSecondary mode.

Parameters
faceStateThe new face index to set.

Definition at line 377 of file Menu.cpp.

References faceState.

Referenced by GammaAnimation::Update().

◆ SetFanSpeed()

void SetFanSpeed ( uint8_t  fanSpeed)
static

Sets the fan speed if in isSecondary mode.

Parameters
fanSpeedThe new fan speed index (0-10).

Definition at line 485 of file Menu.cpp.

References fanSpeed.

◆ SetHueB()

void SetHueB ( uint8_t  hueb)
static

Sets the back hue value if in isSecondary mode.

Parameters
huebThe new back hue (0-10).

Definition at line 467 of file Menu.cpp.

References hueb.

◆ SetHueF()

void SetHueF ( uint8_t  huef)
static

Sets the front hue value if in isSecondary mode.

Parameters
huefThe new front hue (0-10).

Definition at line 458 of file Menu.cpp.

References huef.

◆ SetMaxEntries()

void SetMaxEntries ( )
staticprivate

Defines the maximum allowed values for each menu parameter.

Definition at line 62 of file Menu.cpp.

References AccentBright, BoopSensor, Bright, EffectS, faceCount, Faces, FaceSize, FanSpeed, HueB, HueF, MicLevel, Microphone, MenuHandler< menuCount >::SetMenuMax(), and SpectrumMirror.

Referenced by Initialize(), and Initialize().

◆ SetMicLevel()

void SetMicLevel ( uint8_t  micLevel)
static

Sets the microphone level (gain) if in isSecondary mode.

Parameters
micLevelThe new microphone level (0 to 10).

Definition at line 413 of file Menu.cpp.

References micLevel.

Referenced by GammaAnimation::Update().

◆ SetMirrorSpectrumAnalyzer()

void SetMirrorSpectrumAnalyzer ( uint8_t  spectrumMirror)
static

Sets whether the spectrum analyzer should be mirrored if in isSecondary mode.

Parameters
spectrumMirror0 or 1 representing off/on.

Definition at line 431 of file Menu.cpp.

References spectrumMirror.

Referenced by GammaAnimation::Update().

◆ SetPosition()

void SetPosition ( Vector2D  position)
static

Sets the base position of the menu (plus any existing offsets).

Parameters
positionThe new position to assign to the menu.

Definition at line 271 of file Menu.cpp.

References position, positionOffset, TextEngine< lineCount, characterWidth >::SetPositionOffset(), and textEngine.

Referenced by Update().

◆ SetPositionOffset()

void SetPositionOffset ( Vector2D  positionOffset)
static

Sets an additional offset to be added on top of the base position.

Parameters
positionOffsetThe new offset to store internally.

Definition at line 276 of file Menu.cpp.

References positionOffset.

Referenced by ProtogenProject::SetMenuOffset(), and GammaAnimation::Update().

◆ SetRotation()

void SetRotation ( float  rotation)
static

Sets the rotation angle for the menu (in degrees or radians, based on usage).

Parameters
rotationThe new rotation angle.

Definition at line 289 of file Menu.cpp.

References rotation, TextEngine< lineCount, characterWidth >::SetRotationAngle(), and textEngine.

Referenced by Update().

◆ SetRotationOffset()

void SetRotationOffset ( Vector2D  rotationOffset)
static

Sets the pivot or rotation offset for the text engine.

Parameters
rotationOffsetThe pivot offset (typically the center of the menu).

Definition at line 280 of file Menu.cpp.

References rotationOffset, TextEngine< lineCount, characterWidth >::SetRotationOffset(), and textEngine.

Referenced by Update().

◆ SetSize()

void SetSize ( Vector2D  size)
static

Sets the overall menu size and updates the text engine accordingly.

Parameters
sizeThe new menu size in screen coordinates (width, height).

Definition at line 259 of file Menu.cpp.

References menuCount, TextEngine< lineCount, characterWidth >::SetSize(), size, textEngine, and Vector2D::X.

Referenced by Initialize(), Initialize(), and ProtogenProject::SetMenuSize().

◆ SetUseBoopSensor()

void SetUseBoopSensor ( uint8_t  boopSensor)
static

Sets the boop sensor usage if in isSecondary mode.

Parameters
boopSensor0 or 1 representing off/on.

Definition at line 422 of file Menu.cpp.

References boopSensor.

Referenced by GammaAnimation::Update().

◆ SetUseMicrophone()

void SetUseMicrophone ( uint8_t  microphone)
static

Sets whether to use the microphone if in isSecondary mode.

Parameters
microphone0 or 1 representing off/on.

Definition at line 404 of file Menu.cpp.

References microphone.

Referenced by GammaAnimation::Update().

◆ SetWiggleRatio()

void SetWiggleRatio ( float  wiggleRatio)
static

Sets the amplitude of the wiggle effect.

Parameters
wiggleRatioA multiplier for the wiggle offsets.

Definition at line 249 of file Menu.cpp.

References wiggleRatio.

◆ SetWiggleSpeed()

void SetWiggleSpeed ( float  wiggleSpeedX,
float  wiggleSpeedY,
float  wiggleSpeedR 
)
static

Sets the speed multipliers for X-axis, Y-axis, and rotational wiggle.

Parameters
wiggleSpeedXSpeed multiplier for the X direction.
wiggleSpeedYSpeed multiplier for the Y direction.
wiggleSpeedRSpeed multiplier for rotation.

Definition at line 253 of file Menu.cpp.

References wiggleSpeedR, wiggleSpeedX, and wiggleSpeedY.

Referenced by ProtogenProject::SetMenuWiggleSpeed().

◆ ShowMenu()

◆ Update()

◆ UseBoopSensor()

◆ UseMicrophone()

Member Data Documentation

◆ accentBright

uint8_t accentBright = 0
staticprivate

Accent brightness level.

Definition at line 144 of file Menu.h.

Referenced by GetAccentBrightness(), and SetAccentBrightness().

◆ blurH

HorizontalBlur blurH = HorizontalBlur(16)
staticprivate

Definition at line 175 of file Menu.h.

◆ blurR

RadialBlur blurR = RadialBlur(16)
staticprivate

Definition at line 178 of file Menu.h.

◆ blurV

VerticalBlur blurV = VerticalBlur(16)
staticprivate

Definition at line 176 of file Menu.h.

◆ boopSensor

uint8_t boopSensor = 0
staticprivate

Boop sensor usage toggle.

Definition at line 147 of file Menu.h.

Referenced by SetUseBoopSensor(), and UseBoopSensor().

◆ bright

uint8_t bright = 0
staticprivate

Brightness level.

Definition at line 143 of file Menu.h.

Referenced by GetBrightness(), and SetBrightness().

◆ color

uint8_t color = 0
staticprivate

Current color setting.

Definition at line 150 of file Menu.h.

Referenced by GetFaceColor(), and SetFaceColor().

◆ currentMenu

uint8_t currentMenu = 0
staticprivate

Tracks the currently active menu index (if using isSecondary mode).

Definition at line 124 of file Menu.h.

Referenced by SetCurrentMenu(), and Update().

◆ dampedSpringShow

DampedSpring dampedSpringShow
staticprivate

Controls the show/hide ratio of the menu.

Definition at line 88 of file Menu.h.

Referenced by Initialize(), Initialize(), and Update().

◆ dampedSpringX

DampedSpring dampedSpringX
staticprivate

DampedSpring objects used for smooth transitions in the X-direction and for menu visibility.

Controls the horizontal positioning of the menu.

Definition at line 87 of file Menu.h.

Referenced by Initialize(), Initialize(), and Update().

◆ effect

uint8_t effect = 0
staticprivate

Current effect index.

Definition at line 153 of file Menu.h.

Referenced by GetEffectS(), and SetEffectS().

◆ effectChange

EffectChangeTrack< 1 > effectChange
staticprivate

EffectChangeTrack for smoothly transitioning the effect strength.

Definition at line 165 of file Menu.h.

Referenced by Initialize(), and Update().

◆ effectStrength

float effectStrength = 0.0f
staticprivate

The current strength ratio for the applied effect.

Definition at line 166 of file Menu.h.

Referenced by Initialize(), and Update().

◆ faceCount

uint8_t faceCount
staticprivate

Face count for how many faces are selectable in this project.

Definition at line 119 of file Menu.h.

Referenced by Initialize(), Initialize(), and SetMaxEntries().

◆ faceSize

uint8_t faceSize = 0
staticprivate

Face size setting.

Definition at line 149 of file Menu.h.

Referenced by GetFaceSize(), and SetFaceSize().

◆ faceState

uint8_t faceState = 0
staticprivate

Stored state for each menu item (if isSecondary is true).

Currently selected face index.

Definition at line 142 of file Menu.h.

Referenced by GetFaceState(), and SetFaceState().

◆ fanSpeed

uint8_t fanSpeed = 0
staticprivate

Fan speed setting.

Definition at line 154 of file Menu.h.

Referenced by GetFanSpeed(), and SetFanSpeed().

◆ fisheye

Fisheye fisheye = Fisheye()
staticprivate

Definition at line 173 of file Menu.h.

◆ glitchX

GlitchX glitchX = GlitchX(30)
staticprivate

Definition at line 174 of file Menu.h.

Referenced by GetEffect().

◆ hueb

uint8_t hueb = 0
staticprivate

Back hue setting.

Definition at line 152 of file Menu.h.

Referenced by GetHueB(), and SetHueB().

◆ huef

uint8_t huef = 0
staticprivate

Front hue setting.

Definition at line 151 of file Menu.h.

Referenced by GetHueF(), and SetHueF().

◆ isSecondary

bool isSecondary = 0
staticprivate

Indicates whether this Menu is in "secondary" mode (no hardware input, used externally).

Definition at line 137 of file Menu.h.

Referenced by GetAccentBrightness(), GetBrightness(), GetEffectS(), GetFaceColor(), GetFaceSize(), GetFaceState(), GetFanSpeed(), GetHueB(), GetHueF(), GetMicLevel(), Initialize(), Initialize(), MirrorSpectrumAnalyzer(), Update(), UseBoopSensor(), and UseMicrophone().

◆ line1

String line1 = " BRIGHT SDE BRIGHT MIC MIC LEVEL BOOP SPEC SIZE COLOR HUE F HUE B EFFECT FAN SPEED "
staticprivate

Raw string lines for the textual interface (line1 as label row, line2 as value row).

Definition at line 159 of file Menu.h.

Referenced by GenerateText().

◆ line2

String line2 = " a b c d e f 12^45 12^45 ON off 123456|8 on OFF ON off 12^45 123456|8 123456|8 123456|8 123456|8 123456|8 "
staticprivate

Definition at line 160 of file Menu.h.

Referenced by GenerateText().

◆ magnet

Magnet magnet = Magnet()
staticprivate

Definition at line 177 of file Menu.h.

◆ material

RainbowNoise material
staticprivate

A RainbowNoise material (used for text styling, if desired).

Definition at line 82 of file Menu.h.

Referenced by Initialize(), Initialize(), and Update().

◆ menuCount

const uint8_t menuCount = 13
staticprivate

Total number of menu items.

Definition at line 77 of file Menu.h.

Referenced by SetSize(), and Update().

◆ menuCountEng

const uint8_t menuCountEng = menuCount
staticprivate

Total "expanded" count for text engine usage.

Definition at line 109 of file Menu.h.

◆ menuLength

const uint8_t menuLength = 12
staticprivate

Dimensions for the internal text layout, e.g., number of columns/rows.

Number of characters per menu segment.

Definition at line 103 of file Menu.h.

Referenced by GenerateLine().

◆ menuRows

const uint8_t menuRows = 2
staticprivate

Number of rows in the text display.

Definition at line 104 of file Menu.h.

◆ micLevel

uint8_t micLevel = 0
staticprivate

Microphone level setting.

Definition at line 146 of file Menu.h.

Referenced by GetMicLevel(), and SetMicLevel().

◆ microphone

uint8_t microphone = 0
staticprivate

Microphone usage toggle.

Definition at line 145 of file Menu.h.

Referenced by SetUseMicrophone(), and UseMicrophone().

◆ overflow

Overflow overflow = Overflow(20)
staticprivate

Definition at line 183 of file Menu.h.

◆ passthrough

Passthrough passthrough = Passthrough()
staticprivate

Various post-processing effects instantiated.

Definition at line 172 of file Menu.h.

Referenced by GetEffect().

◆ phaseR

PhaseOffsetR phaseR = PhaseOffsetR(20)
staticprivate

Definition at line 181 of file Menu.h.

Referenced by GetEffect().

◆ phaseX

PhaseOffsetX phaseX = PhaseOffsetX(20)
staticprivate

Definition at line 179 of file Menu.h.

Referenced by GetEffect().

◆ phaseY

PhaseOffsetY phaseY = PhaseOffsetY(20)
staticprivate

Definition at line 180 of file Menu.h.

Referenced by GetEffect().

◆ position

Vector2D position
staticprivate

The current position of the menu.

Definition at line 94 of file Menu.h.

Referenced by GetPosition(), Initialize(), Initialize(), and SetPosition().

◆ positionOffset

Vector2D positionOffset
staticprivate

Additional offset to apply to the menu's position.

Definition at line 95 of file Menu.h.

Referenced by SetPosition(), and SetPositionOffset().

◆ previousMenu

uint8_t previousMenu = 0
staticprivate

Tracks a previous face state to detect changes.

Definition at line 167 of file Menu.h.

Referenced by Update().

◆ rotation

float rotation
staticprivate

Rotation angle (in degrees or radians, depending on usage).

Definition at line 97 of file Menu.h.

Referenced by GetRotation(), and SetRotation().

◆ rotationOffset

Vector2D rotationOffset
staticprivate

Offset for pivoting the menu (e.g., around its center).

Definition at line 96 of file Menu.h.

Referenced by SetRotationOffset().

◆ shiftR

ShiftR shiftR = ShiftR(20)
staticprivate

Definition at line 182 of file Menu.h.

◆ showMenuRatio

float showMenuRatio
staticprivate

Normalized ratio (0.0 to 100.0) controlling how much the menu is shown.

Definition at line 98 of file Menu.h.

Referenced by ShowMenu(), and Update().

◆ size

Vector2D size
staticprivate

UI geometry: size, position, offsets, and rotation.

The total size of the menu in screen-space.

Definition at line 93 of file Menu.h.

Referenced by Initialize(), Initialize(), SetSize(), and Update().

◆ spectrumMirror

uint8_t spectrumMirror = 0
staticprivate

Spectrum mirroring toggle.

Definition at line 148 of file Menu.h.

Referenced by MirrorSpectrumAnalyzer(), and SetMirrorSpectrumAnalyzer().

◆ textEngine

Text engine for rendering menu lines.

Definition at line 114 of file Menu.h.

Referenced by GenerateText(), GetMaterial(), Initialize(), Initialize(), SetPosition(), SetRotation(), SetRotationOffset(), and SetSize().

◆ wiggleRatio

float wiggleRatio = 1.0f
staticprivate

Wiggle effect parameters for the menu's animation.

How pronounced the wiggle effect is.

Definition at line 129 of file Menu.h.

Referenced by SetWiggleRatio(), and Update().

◆ wiggleSpeedR

float wiggleSpeedR = 1.0f
staticprivate

Speed of rotational wiggle.

Definition at line 132 of file Menu.h.

Referenced by SetWiggleSpeed(), and Update().

◆ wiggleSpeedX

float wiggleSpeedX = 1.0f
staticprivate

Speed of horizontal wiggle.

Definition at line 130 of file Menu.h.

Referenced by SetWiggleSpeed(), and Update().

◆ wiggleSpeedY

float wiggleSpeedY = 1.0f
staticprivate

Speed of vertical wiggle.

Definition at line 131 of file Menu.h.

Referenced by SetWiggleSpeed(), and Update().


The documentation for this class was generated from the following files: