AwesomeStudioPedal
A programmable, multi-profile foot controller for DAWs, score readers, and studio automation
Loading...
Searching...
No Matches
event_dispatcher.h
Go to the documentation of this file.
1#pragma once
2#include <array>
3#include <cstdint>
4#include <functional>
5
16{
17public:
23 using EventCallback = std::function<void()>;
24
31 void registerHandler(uint8_t button, EventCallback callback);
32
38 void dispatch(uint8_t button);
39
45 void clearHandlers();
46
47private:
48 std::array<EventCallback, 5> handlers{};
49};
Manages event callbacks for button presses.
void dispatch(uint8_t button)
Executes the callback for the specified button.
std::function< void()> EventCallback
Callback function type for button events.
void clearHandlers()
Clears all registered event handlers.
void registerHandler(uint8_t button, EventCallback callback)
Registers a callback function for a button.