Line data Source code
1 : #pragma once
2 :
3 : #include <imgui.h>
4 :
5 : #include <functional>
6 :
7 : namespace Amplitron {
8 :
9 56 : struct LedProps {
10 56 : bool enabled = false;
11 56 : ImVec4 led_color = ImVec4(1.0f, 1.0f, 1.0f, 1.0f);
12 56 : const char* tooltip = nullptr;
13 :
14 : // Pulse animation options
15 56 : bool blink = false;
16 56 : float blink_time = 0.0f; // time used to calculate blink rate
17 : };
18 :
19 : class LedComponent {
20 : public:
21 : /**
22 : * @brief Render a status LED indicator with glowing outlines.
23 : * @param imgui_id Unique ID for ImGui interactions (tooltip hover area).
24 : * @param props LED state, color, and tooltip.
25 : * @param zoom DPI zoom factor.
26 : * @param center Center coordinate of the LED.
27 : */
28 : static void render(const char* imgui_id, const LedProps& props, float zoom, ImVec2 center);
29 : };
30 :
31 : } // namespace Amplitron
|