Control Surface main
MIDI Control Surface library for Arduino
Loading...
Searching...
No Matches
TimeDisplayDisplay.hpp
Go to the documentation of this file.
1#pragma once
2
6
8
9namespace MCU {
15 public:
20
21 void draw() override {
22 display.setTextColor(color);
23 display.setTextSize(size);
24 display.setCursor(x, y);
25
26 char barStr[6], beatStr[3], frameStr[4];
27 timedisplay.getBars(barStr);
28 timedisplay.getBeats(beatStr);
29 timedisplay.getFrames(frameStr);
30 display.print(barStr);
31 display.print(' ');
32 display.print(beatStr);
33 display.print(' ');
34 display.print(frameStr);
35 timedisplay.clearDirty();
36 }
37
38 bool getDirty() const override { return timedisplay.getDirty(); }
39
40 int16_t getX() const { return x; }
41 int16_t getY() const { return y; }
42 uint8_t getSize() const { return size; }
43 uint16_t getColor() const { return color; }
44
45 void setX(int16_t x) { this->x = x; }
46 void setY(int16_t y) { this->y = y; }
47 void setSize(uint8_t size) { this->size = size; }
48 void setColor(uint16_t color) { this->color = color; }
49
50 private:
52 int16_t x, y;
53 uint8_t size;
54 uint16_t color;
55};
56
57} // namespace MCU
58
#define END_CS_NAMESPACE
#define BEGIN_CS_NAMESPACE
DisplayElement(DisplayInterface &display)
Create a new DisplayElement.
DisplayInterface & display
An interface for displays.
bool getDirty() const override
Check if this DisplayElement has to be re-drawn.
TimeDisplayDisplay(DisplayInterface &display, TimeDisplay &timedisplay, PixelLocation loc, uint8_t size, uint16_t color)
void setColor(uint16_t color)
void draw() override
Draw this DisplayElement to the display buffer.
Class that receives and stores the text of the Mackie Control Universal 7-segment time display.
A simple struct representing a pixel with integer coordinates.
Definition Def.hpp:64