2#include "base_hardware.hpp"
3#include <color/color_converter.hpp>
4#include <io/button_presser.hpp>
5#include <concepts/device.hpp>
6#include <macros/labels.hpp>
14template <
typename Device,
typename Controller>
20template <has_buttons Device,
typename Controller>
22 :
virtual public base_hardware
24 using id_type = Device::buttons::id_type;
32 bool on_button_received(Controller* ctrlr, id_type
id)
34#define call_ctrlr(F) \
35 if constexpr(F##_button<Device, Controller>) \
36 if (id == Device::buttons::F##_id()) \
38 ctrlr->on_##F(btn_prsr); \
39 ctrlr->set_##F##_held(btn_prsr); \
43#define CALL_MACRO(r, data, elem) call_ctrlr(elem)
44 FOR_EACH_LABEL(CALL_MACRO)
53 void(id_type,
const color_cnvtr&)
60 if constexpr(device_##F##_button<Device>) \
62 func(Device::buttons::F##_id(), cvrtr);
64#define CALL_MACRO(r, data, elem) call_func(elem)
65 FOR_EACH_LABEL(CALL_MACRO)
Povides convertion of color objects to device specific integer values.
Definition color_converter.hpp:94
void set(const color &color) override
Sets the original color.
Definition color_converter.hpp:97