BuGUI
BUtton Grid User Interface
Loading...
Searching...
No Matches
base_hardware.hpp
1#pragma once
2#include <bugui/io/painter.hpp>
3#include <bugui/io/button_painter.hpp>
4
5#include <libremidi/libremidi.hpp>
6
7namespace bugui
8{
11struct base_hardware
12{
13 virtual ~base_hardware() = default;
14 virtual stdx::error set_midi_in_port
15 (const libremidi::observer& observer
16 , std::string_view port_name)
17 { return std::errc::protocol_not_supported; };
18 virtual stdx::error set_midi_out_port
19 (const libremidi::observer& observer
20 , std::string_view port_name)
21 { return std::errc::protocol_not_supported; };
26 virtual void setup() = 0;
28 virtual void reset() = 0;
30 virtual int width() const { return 0; };
32 virtual int height() const { return 0; };
35 virtual void set_grid(painter&) {};
38 virtual void set_button(const button_painter&) {};
39
40protected:
41 base_hardware() = default;
42};
43
44} // namespace bugui
Provides base functionalities of the hardware object, and enables access from the base_controller.
Definition base_hardware.hpp:12
virtual void reset()=0
Turns off all diplays (LEDs, screens, visual feedback).
virtual void set_button(const button_painter &)
Pass a reference to the button_painter object and display it's content to the device's buttons.
Definition base_hardware.hpp:38
virtual int height() const
Retrieves the height of the device's grid.
Definition base_hardware.hpp:32
virtual void set_grid(painter &)
Pass a reference to the painter object and display it's content to the grid.
Definition base_hardware.hpp:35
virtual void setup()=0
Sends any preliminary commands needed by the device ie. initialising to a particular mode like XY (La...
virtual int width() const
Retrieves the with of the device's grid.
Definition base_hardware.hpp:30
Conveys button colors from the controller to the base_hardware.
Definition button_painter.hpp:10
Adds 2D information on top of a base_painter. The painter is used in user defined paint funcions to d...
Definition painter.hpp:17