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