Line data Source code
1 : #pragma once
2 :
3 : #include <imgui.h>
4 :
5 : #include <functional>
6 :
7 : namespace Amplitron {
8 :
9 159 : struct FootswitchProps {
10 53 : bool enabled = false;
11 53 : const char* tooltip_prefix = "";
12 :
13 : // Callbacks
14 : std::function<void()> on_clicked;
15 : };
16 :
17 : class FootswitchComponent {
18 : public:
19 : /**
20 : * @brief Render a reusable metallic footswitch toggle component.
21 : * @param imgui_id Unique ID for ImGui button tracking.
22 : * @param props Footswitch state and callbacks.
23 : * @param zoom DPI zoom scale.
24 : * @param center Center coordinate of the footswitch.
25 : */
26 : static void render(const char* imgui_id, const FootswitchProps& props, float zoom,
27 : ImVec2 center);
28 : };
29 :
30 : } // namespace Amplitron
|