2#include <hardware/component.hpp>
3#include <concepts/device.hpp>
4#include <concepts/message.hpp>
5#include <concepts/common.hpp>
7#include <libremidi/libremidi.hpp>
11template <
typename Device,
typename Controller>
13 :
public virtual component<Device, Controller>
22 m_output.close_port();
26 { m_output.send_message(Device::init()); }
30 using namespace libremidi;
33 m_output.send_message(Device::clear());
37 grid_t::clear([
this] (
auto id)
38 { m_output.send_message(144,
id, 0); });
45 grid_t::paint(p, [
this] (
auto id,
const auto&
color)
46 { m_output.send_message(144,
id,
color.
get()); });
53 buttons_t::paint(p, [
this] (
auto id,
const auto&
color)
54 { m_output.send_message(144,
id,
color.
get()); });
58 libremidi::midi_out m_output;
Definition midi_out.hpp:14
void set_button(const button_painter &p) override
Pass a reference to the button_painter object and display it's content to the device's buttons.
Definition midi_out.hpp:49
void clear() override
Turns off all LEDs.
Definition midi_out.hpp:28
void set_grid(painter &p) override
Pass a reference to the painter object and display it's content to the grid.
Definition midi_out.hpp:42
Generic colour class holding RGBA values of a primary and a secondary colour. The blinking and pulsin...
Definition color.hpp:12
rgba get() const noexcept
Retrieves the primary colour as rgba values.
Definition color.hpp:55
Inherits from all type of hardware components like grid, buttons... Provides the hardware type with t...
Definition component.hpp:14
Empty struct fro device's that do not feature a button grid.
Definition grid.hpp:18
The painter class.
Definition painter.hpp:12