![]() |
ProtoTracer
1.0
Real-time 3D rendering and animation engine
|
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>
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 Material * | GetMaterial () |
Provides a pointer to the material used for rendering the menu text. | |
static Effect * | GetEffect () |
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 *menuCountEng > | textEngine |
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) |
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.
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. |
Generates a line of characters for displaying available options (0-9), visually highlighting the currently selected index.
options | The total number of options (e.g., 10). |
selection | The currently selected option. |
Definition at line 321 of file Menu.cpp.
References IntToBlink(), and menuLength.
Referenced by GenerateText().
|
static |
Generates the textual representation of the menu (two lines) and updates the TextEngine with that text.
Definition at line 356 of file Menu.cpp.
References GenerateLine(), GetAccentBrightness(), GetBrightness(), GetEffectS(), GetFaceColor(), GetFaceSize(), GetFanSpeed(), GetHueB(), GetHueF(), GetMicLevel(), line1, line2, MirrorSpectrumAnalyzer(), TextEngine< lineCount, characterWidth >::SetText(), textEngine, UseBoopSensor(), and UseMicrophone().
Referenced by Update().
|
static |
Gets the current accent brightness level.
Definition at line 399 of file Menu.cpp.
References AccentBright, accentBright, MenuHandler< menuCount >::GetMenuValue(), and isSecondary.
Referenced by GenerateText(), AphoriAnimation::GetAccentBrightness(), BasilGardenAnimation::GetAccentBrightness(), BroookAnimation::GetAccentBrightness(), GalaxyAnimation::GetAccentBrightness(), InfraredAnimation::GetAccentBrightness(), SammyAnimation::GetAccentBrightness(), SergaliciousAnimation::GetAccentBrightness(), TamamoAnimation::GetAccentBrightness(), Warzone2Animation::GetAccentBrightness(), XenraxAnimation::GetAccentBrightness(), WS35AnimationSplit::GetAccentBrightness(), AceAnimation::Update(), ArrowAnimation::Update(), DrGonzoProject::Update(), DrGonzoTest::Update(), SageAnimation::Update(), SplatAnimation::Update(), UnicornZhenjaAnimation::Update(), FursuitEyesV1::Update(), BetaProject::Update(), GammaAnimation::Update(), ProtogenHUB75Project::Update(), ProtogenWS35Project::Update(), and HeadsUpDisplay::UpdateFaceInformation().
|
static |
Gets the current brightness level. In hardware mode, it is read from the MenuHandler.
Definition at line 390 of file Menu.cpp.
References Bright, bright, MenuHandler< menuCount >::GetMenuValue(), and isSecondary.
Referenced by GenerateText(), AphoriAnimation::GetBrightness(), BasilGardenAnimation::GetBrightness(), BroookAnimation::GetBrightness(), GalaxyAnimation::GetBrightness(), InfraredAnimation::GetBrightness(), SammyAnimation::GetBrightness(), SergaliciousAnimation::GetBrightness(), TamamoAnimation::GetBrightness(), Warzone2Animation::GetBrightness(), XenraxAnimation::GetBrightness(), WS35AnimationSplit::GetBrightness(), AceAnimation::Update(), ArrowAnimation::Update(), DrGonzoProject::Update(), DrGonzoTest::Update(), SageAnimation::Update(), SplatAnimation::Update(), UnicornZhenjaAnimation::Update(), FursuitEyesV1::Update(), BetaProject::Update(), GammaAnimation::Update(), ProtogenHUB75Project::Update(), ProtogenWS35Project::Update(), and HeadsUpDisplay::UpdateFaceInformation().
|
static |
Gets the currently selected menu index from the MenuHandler (if in hardware mode).
Definition at line 196 of file Menu.cpp.
References MenuHandler< menuCount >::GetCurrentMenu().
Referenced by HeadsUpDisplay::CheckInvertPrintText(), and GetCurrentMenuValue().
|
static |
Gets the current value of the active menu parameter from the MenuHandler.
Definition at line 200 of file Menu.cpp.
References GetCurrentMenu(), and MenuHandler< menuCount >::GetMenuValue().
|
static |
Retrieves the current effect (post-processing) based on the menu setting.
Definition at line 159 of file Menu.cpp.
References GetEffectS(), glitchX, passthrough, phaseR, phaseX, and phaseY.
Referenced by Update(), and ProtogenProject::UpdateFace().
|
static |
Gets the currently selected effect index.
Definition at line 480 of file Menu.cpp.
References effect, EffectS, MenuHandler< menuCount >::GetMenuValue(), and isSecondary.
Referenced by GenerateText(), GetEffect(), and HeadsUpDisplay::UpdateFaceInformation().
|
static |
Gets the current face color index.
Definition at line 453 of file Menu.cpp.
References color, MenuHandler< menuCount >::GetMenuValue(), and isSecondary.
Referenced by GenerateText(), AphoriAnimation::SetMaterialColor(), BasilGardenAnimation::SetMaterialColor(), BroookAnimation::SetMaterialColor(), GalaxyAnimation::SetMaterialColor(), HertzzAnimation::SetMaterialColor(), SammyAnimation::SetMaterialColor(), SergaliciousAnimation::SetMaterialColor(), StrawberryAnimation::SetMaterialColor(), TamamoAnimation::SetMaterialColor(), TechSaneAnimation::SetMaterialColor(), Warzone2Animation::SetMaterialColor(), XenraxAnimation::SetMaterialColor(), GammaAnimation::SetMaterialColor(), HUB75AnimationSplit::SetMaterialColor(), WS35AnimationSplit::SetMaterialColor(), ProtogenProject::SetMaterialColor(), GammaAnimation::Update(), and HeadsUpDisplay::UpdateFaceInformation().
|
static |
Gets the current face size.
Definition at line 444 of file Menu.cpp.
References FaceSize, faceSize, MenuHandler< menuCount >::GetMenuValue(), and isSecondary.
Referenced by GenerateText(), ProtogenProject::GetFaceScale(), AphoriAnimation::Update(), BasilGardenAnimation::Update(), BroookAnimation::Update(), GalaxyAnimation::Update(), HertzzAnimation::Update(), InfraredAnimation::Update(), SammyAnimation::Update(), SergaliciousAnimation::Update(), StrawberryAnimation::Update(), TamamoAnimation::Update(), Warzone2Animation::Update(), XenraxAnimation::Update(), GammaAnimation::Update(), HUB75AnimationSplit::Update(), WS35AnimationSplit::Update(), ProtogenProject::UpdateFace(), and HeadsUpDisplay::UpdateFaceInformation().
|
static |
Retrieves the current face state. In hardware mode, it is read from the MenuHandler.
Definition at line 381 of file Menu.cpp.
References Faces, faceState, MenuHandler< menuCount >::GetMenuValue(), and isSecondary.
Referenced by Update(), AceAnimation::Update(), AphoriAnimation::Update(), ArrowAnimation::Update(), BasilGardenAnimation::Update(), BroookAnimation::Update(), DrGonzoProject::Update(), DrGonzoTest::Update(), GalaxyAnimation::Update(), HertzzAnimation::Update(), InfraredAnimation::Update(), SageAnimation::Update(), SammyAnimation::Update(), SergaliciousAnimation::Update(), SplatAnimation::Update(), StrawberryAnimation::Update(), TamamoAnimation::Update(), TechSaneAnimation::Update(), UnicornZhenjaAnimation::Update(), Warzone2Animation::Update(), XenraxAnimation::Update(), FursuitEyesV1::Update(), BetaProject::Update(), GammaAnimation::Update(), ProtogenHUB75Project::Update(), HUB75AnimationSplit::Update(), WS35AnimationSplit::Update(), ProtogenWS35Project::Update(), and HeadsUpDisplay::UpdateFaceInformation().
|
static |
Gets the current fan speed index.
Definition at line 489 of file Menu.cpp.
References FanSpeed, fanSpeed, MenuHandler< menuCount >::GetMenuValue(), and isSecondary.
Referenced by GenerateText(), ProtogenProject::UpdateFace(), and HeadsUpDisplay::UpdateFaceInformation().
|
static |
Gets the back hue value.
Definition at line 471 of file Menu.cpp.
References MenuHandler< menuCount >::GetMenuValue(), HueB, hueb, and isSecondary.
Referenced by GenerateText(), HUB75AnimationSplit::Update(), WS35AnimationSplit::Update(), ProtogenProject::UpdateFace(), and HeadsUpDisplay::UpdateFaceInformation().
|
static |
Gets the front hue value.
Definition at line 462 of file Menu.cpp.
References MenuHandler< menuCount >::GetMenuValue(), HueF, huef, and isSecondary.
Referenced by GenerateText(), HUB75AnimationSplit::Update(), WS35AnimationSplit::Update(), ProtogenProject::UpdateFace(), and HeadsUpDisplay::UpdateFaceInformation().
|
static |
Provides a pointer to the material used for rendering the menu text.
Definition at line 155 of file Menu.cpp.
References textEngine.
Referenced by AphoriAnimation::SetMaterialLayers(), BasilGardenAnimation::SetMaterialLayers(), BroookAnimation::SetMaterialLayers(), GalaxyAnimation::SetMaterialLayers(), HertzzAnimation::SetMaterialLayers(), InfraredAnimation::SetMaterialLayers(), SammyAnimation::SetMaterialLayers(), SergaliciousAnimation::SetMaterialLayers(), StrawberryAnimation::SetMaterialLayers(), TamamoAnimation::SetMaterialLayers(), TechSaneAnimation::SetMaterialLayers(), Warzone2Animation::SetMaterialLayers(), XenraxAnimation::SetMaterialLayers(), GammaAnimation::SetMaterialLayers(), HUB75AnimationSplit::SetMaterialLayers(), WS35AnimationSplit::SetMaterialLayers(), and ProtogenProject::SetMaterialLayers().
|
static |
Gets the current microphone level.
Definition at line 417 of file Menu.cpp.
References MenuHandler< menuCount >::GetMenuValue(), isSecondary, MicLevel, and micLevel.
Referenced by GenerateText(), AphoriAnimation::Update(), BasilGardenAnimation::Update(), BroookAnimation::Update(), HertzzAnimation::Update(), InfraredAnimation::Update(), SammyAnimation::Update(), SergaliciousAnimation::Update(), StrawberryAnimation::Update(), TamamoAnimation::Update(), Warzone2Animation::Update(), XenraxAnimation::Update(), GammaAnimation::Update(), WS35AnimationSplit::Update(), ProtogenProject::UpdateFace(), and HeadsUpDisplay::UpdateFaceInformation().
|
static |
|
static |
|
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.
faceCount | The maximum number of faces selectable. |
pin | The GPIO pin for the button input. |
holdingTime | The time threshold for press-and-hold actions. |
size | The 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().
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.
faceCount | The maximum number of faces selectable. |
size | The 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.
Converts a digit character into a "blink" character for visual emphasis.
value | The digit character (e.g., '0' to '9'). |
Definition at line 294 of file Menu.cpp.
Referenced by GenerateLine().
|
static |
Checks if the spectrum analyzer mirroring is toggled on or off.
Definition at line 435 of file Menu.cpp.
References MenuHandler< menuCount >::GetMenuValue(), isSecondary, SpectrumMirror, and spectrumMirror.
Referenced by GenerateText(), AphoriAnimation::Update(), BasilGardenAnimation::Update(), BroookAnimation::Update(), GalaxyAnimation::Update(), HertzzAnimation::Update(), InfraredAnimation::Update(), SammyAnimation::Update(), SergaliciousAnimation::Update(), StrawberryAnimation::Update(), TamamoAnimation::Update(), TechSaneAnimation::Update(), Warzone2Animation::Update(), XenraxAnimation::Update(), GammaAnimation::Update(), HUB75AnimationSplit::Update(), WS35AnimationSplit::Update(), and ProtogenProject::UpdateFace().
Sets the accent brightness level if in isSecondary mode.
accentBright | The new accent brightness level. |
Definition at line 395 of file Menu.cpp.
References accentBright.
Referenced by GammaAnimation::Update().
Sets the brightness level if in isSecondary mode.
bright | The new brightness level. |
Definition at line 386 of file Menu.cpp.
References bright.
Referenced by GammaAnimation::Update().
Manually sets the current menu index (used in isSecondary mode).
currentMenu | The new menu index to set. |
Definition at line 204 of file Menu.cpp.
References currentMenu.
Referenced by GammaAnimation::Update().
|
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().
Sets the face color index if in isSecondary mode.
color | The new color index (0-10). |
Definition at line 449 of file Menu.cpp.
References color.
Referenced by GammaAnimation::Update().
Sets the face size if in isSecondary mode.
faceSize | The new face size index (0-10). |
Definition at line 440 of file Menu.cpp.
References faceSize.
Referenced by GammaAnimation::Update().
Manually sets the face state (active face index) if in isSecondary mode.
faceState | The new face index to set. |
Definition at line 377 of file Menu.cpp.
References faceState.
Referenced by GammaAnimation::Update().
|
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().
Sets the microphone level (gain) if in isSecondary mode.
micLevel | The new microphone level (0 to 10). |
Definition at line 413 of file Menu.cpp.
References micLevel.
Referenced by GammaAnimation::Update().
Sets whether the spectrum analyzer should be mirrored if in isSecondary mode.
spectrumMirror | 0 or 1 representing off/on. |
Definition at line 431 of file Menu.cpp.
References spectrumMirror.
Referenced by GammaAnimation::Update().
Sets the base position of the menu (plus any existing offsets).
position | The 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().
Sets an additional offset to be added on top of the base position.
positionOffset | The new offset to store internally. |
Definition at line 276 of file Menu.cpp.
References positionOffset.
Referenced by ProtogenProject::SetMenuOffset(), and GammaAnimation::Update().
Sets the rotation angle for the menu (in degrees or radians, based on usage).
rotation | The new rotation angle. |
Definition at line 289 of file Menu.cpp.
References rotation, TextEngine< lineCount, characterWidth >::SetRotationAngle(), and textEngine.
Referenced by Update().
Sets the pivot or rotation offset for the text engine.
rotationOffset | The 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().
Sets the overall menu size and updates the text engine accordingly.
size | The 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().
Sets the boop sensor usage if in isSecondary mode.
boopSensor | 0 or 1 representing off/on. |
Definition at line 422 of file Menu.cpp.
References boopSensor.
Referenced by GammaAnimation::Update().
Sets whether to use the microphone if in isSecondary mode.
microphone | 0 or 1 representing off/on. |
Definition at line 404 of file Menu.cpp.
References microphone.
Referenced by GammaAnimation::Update().
Sets the amplitude of the wiggle effect.
wiggleRatio | A multiplier for the wiggle offsets. |
Definition at line 249 of file Menu.cpp.
References wiggleRatio.
Sets the speed multipliers for X-axis, Y-axis, and rotational wiggle.
wiggleSpeedX | Speed multiplier for the X direction. |
wiggleSpeedY | Speed multiplier for the Y direction. |
wiggleSpeedR | Speed multiplier for rotation. |
Definition at line 253 of file Menu.cpp.
References wiggleSpeedR, wiggleSpeedX, and wiggleSpeedY.
Referenced by ProtogenProject::SetMenuWiggleSpeed().
|
static |
Returns how much of the menu is shown, typically normalized (0.0 to 1.0).
Definition at line 494 of file Menu.cpp.
References showMenuRatio.
Referenced by AphoriAnimation::Update(), BasilGardenAnimation::Update(), BroookAnimation::Update(), GalaxyAnimation::Update(), HertzzAnimation::Update(), InfraredAnimation::Update(), SammyAnimation::Update(), SergaliciousAnimation::Update(), StrawberryAnimation::Update(), TamamoAnimation::Update(), TechSaneAnimation::Update(), Warzone2Animation::Update(), XenraxAnimation::Update(), GammaAnimation::Update(), HUB75AnimationSplit::Update(), WS35AnimationSplit::Update(), and ProtogenProject::UpdateFace().
Updates the menu each frame, handling transitions, wiggle effects, and text generation.
Definition at line 208 of file Menu.cpp.
References DampedSpring::Calculate(), currentMenu, dampedSpringShow, dampedSpringX, effectChange, effectStrength, GenerateText(), MenuHandler< menuCount >::GetCurrentMenu(), GetEffect(), GetFaceState(), isSecondary, material, menuCount, Mathematics::MPI, previousMenu, AnimationTrack< maxParameters, maxKeyFrames >::RestartTime(), SetPosition(), Effect::SetRatio(), SetRotation(), SetRotationOffset(), showMenuRatio, size, AnimationTrack< maxParameters, maxKeyFrames >::Update(), MenuHandler< menuCount >::Update(), RainbowNoise::Update(), wiggleRatio, wiggleSpeedR, wiggleSpeedX, wiggleSpeedY, and Vector2D::X.
Referenced by AphoriAnimation::Update(), BasilGardenAnimation::Update(), BroookAnimation::Update(), GalaxyAnimation::Update(), HertzzAnimation::Update(), InfraredAnimation::Update(), SammyAnimation::Update(), SergaliciousAnimation::Update(), StrawberryAnimation::Update(), TamamoAnimation::Update(), TechSaneAnimation::Update(), Warzone2Animation::Update(), XenraxAnimation::Update(), BetaProject::Update(), GammaAnimation::Update(), HUB75AnimationSplit::Update(), WS35AnimationSplit::Update(), and ProtogenProject::UpdateFace().
|
static |
Checks if the boop sensor usage is toggled on or off.
Definition at line 426 of file Menu.cpp.
References BoopSensor, boopSensor, MenuHandler< menuCount >::GetMenuValue(), and isSecondary.
Referenced by GenerateText(), AphoriAnimation::Update(), BasilGardenAnimation::Update(), BroookAnimation::Update(), GalaxyAnimation::Update(), HertzzAnimation::Update(), InfraredAnimation::Update(), SammyAnimation::Update(), SergaliciousAnimation::Update(), StrawberryAnimation::Update(), TamamoAnimation::Update(), TechSaneAnimation::Update(), Warzone2Animation::Update(), XenraxAnimation::Update(), GammaAnimation::Update(), HUB75AnimationSplit::Update(), WS35AnimationSplit::Update(), ProtogenProject::UpdateFace(), and HeadsUpDisplay::UpdateFaceInformation().
|
static |
Checks if the microphone usage is toggled on or off.
Definition at line 408 of file Menu.cpp.
References MenuHandler< menuCount >::GetMenuValue(), isSecondary, Microphone, and microphone.
Referenced by GenerateText(), GammaAnimation::Update(), HeadsUpDisplay::UpdateFaceInformation(), AphoriAnimation::UpdateFFTVisemes(), BasilGardenAnimation::UpdateFFTVisemes(), BroookAnimation::UpdateFFTVisemes(), GalaxyAnimation::UpdateFFTVisemes(), HertzzAnimation::UpdateFFTVisemes(), InfraredAnimation::UpdateFFTVisemes(), SammyAnimation::UpdateFFTVisemes(), SergaliciousAnimation::UpdateFFTVisemes(), StrawberryAnimation::UpdateFFTVisemes(), TamamoAnimation::UpdateFFTVisemes(), TechSaneAnimation::UpdateFFTVisemes(), Warzone2Animation::UpdateFFTVisemes(), XenraxAnimation::UpdateFFTVisemes(), GammaAnimation::UpdateFFTVisemes(), HUB75AnimationSplit::UpdateFFTVisemes(), WS35AnimationSplit::UpdateFFTVisemes(), and ProtogenProject::UpdateFFTVisemes().
|
staticprivate |
Accent brightness level.
Definition at line 144 of file Menu.h.
Referenced by GetAccentBrightness(), and SetAccentBrightness().
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
Boop sensor usage toggle.
Definition at line 147 of file Menu.h.
Referenced by SetUseBoopSensor(), and UseBoopSensor().
|
staticprivate |
Brightness level.
Definition at line 143 of file Menu.h.
Referenced by GetBrightness(), and SetBrightness().
|
staticprivate |
Current color setting.
Definition at line 150 of file Menu.h.
Referenced by GetFaceColor(), and SetFaceColor().
|
staticprivate |
Tracks the currently active menu index (if using isSecondary mode).
Definition at line 124 of file Menu.h.
Referenced by SetCurrentMenu(), and Update().
|
staticprivate |
Controls the show/hide ratio of the menu.
Definition at line 88 of file Menu.h.
Referenced by Initialize(), Initialize(), and Update().
|
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().
|
staticprivate |
Current effect index.
Definition at line 153 of file Menu.h.
Referenced by GetEffectS(), and SetEffectS().
|
staticprivate |
EffectChangeTrack for smoothly transitioning the effect strength.
Definition at line 165 of file Menu.h.
Referenced by Initialize(), and Update().
|
staticprivate |
The current strength ratio for the applied effect.
Definition at line 166 of file Menu.h.
Referenced by Initialize(), and Update().
|
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().
|
staticprivate |
Face size setting.
Definition at line 149 of file Menu.h.
Referenced by GetFaceSize(), and SetFaceSize().
|
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().
|
staticprivate |
Fan speed setting.
Definition at line 154 of file Menu.h.
Referenced by GetFanSpeed(), and SetFanSpeed().
Definition at line 174 of file Menu.h.
Referenced by GetEffect().
|
staticprivate |
|
staticprivate |
|
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().
|
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().
|
staticprivate |
Definition at line 160 of file Menu.h.
Referenced by GenerateText().
|
staticprivate |
A RainbowNoise material (used for text styling, if desired).
Definition at line 82 of file Menu.h.
Referenced by Initialize(), Initialize(), and Update().
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().
|
staticprivate |
Microphone level setting.
Definition at line 146 of file Menu.h.
Referenced by GetMicLevel(), and SetMicLevel().
|
staticprivate |
Microphone usage toggle.
Definition at line 145 of file Menu.h.
Referenced by SetUseMicrophone(), and UseMicrophone().
|
staticprivate |
Various post-processing effects instantiated.
Definition at line 172 of file Menu.h.
Referenced by GetEffect().
|
staticprivate |
Definition at line 181 of file Menu.h.
Referenced by GetEffect().
|
staticprivate |
Definition at line 179 of file Menu.h.
Referenced by GetEffect().
|
staticprivate |
Definition at line 180 of file Menu.h.
Referenced by GetEffect().
|
staticprivate |
The current position of the menu.
Definition at line 94 of file Menu.h.
Referenced by GetPosition(), Initialize(), Initialize(), and SetPosition().
|
staticprivate |
Additional offset to apply to the menu's position.
Definition at line 95 of file Menu.h.
Referenced by SetPosition(), and SetPositionOffset().
|
staticprivate |
|
staticprivate |
Rotation angle (in degrees or radians, depending on usage).
Definition at line 97 of file Menu.h.
Referenced by GetRotation(), and SetRotation().
|
staticprivate |
Offset for pivoting the menu (e.g., around its center).
Definition at line 96 of file Menu.h.
Referenced by SetRotationOffset().
|
staticprivate |
|
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().
|
staticprivate |
Spectrum mirroring toggle.
Definition at line 148 of file Menu.h.
Referenced by MirrorSpectrumAnalyzer(), and SetMirrorSpectrumAnalyzer().
|
staticprivate |
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().
|
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().
|
staticprivate |
Speed of rotational wiggle.
Definition at line 132 of file Menu.h.
Referenced by SetWiggleSpeed(), and Update().
|
staticprivate |
Speed of horizontal wiggle.
Definition at line 130 of file Menu.h.
Referenced by SetWiggleSpeed(), and Update().
|
staticprivate |
Speed of vertical wiggle.
Definition at line 131 of file Menu.h.
Referenced by SetWiggleSpeed(), and Update().