Control Surface pin-t-adl
MIDI Control Surface library for Arduino
TimeDisplayDisplay.hpp
Go to the documentation of this file.
1#pragma once
2
6
8
9namespace MCU {
10
12 public:
14 PixelLocation loc, uint8_t size, uint16_t color)
16 size(size), color(color) {}
17
18 void draw() override {
22
23 char barStr[6], beatStr[3], frameStr[4];
24 timedisplay.getBars(barStr);
25 timedisplay.getBeats(beatStr);
26 timedisplay.getFrames(frameStr);
27 display.print(barStr);
28 display.print(' ');
29 display.print(beatStr);
30 display.print(' ');
31 display.print(frameStr);
33 }
34
35 bool getDirty() const override { return timedisplay.getDirty(); }
36
37 int16_t getX() const { return x; }
38 int16_t getY() const { return y; }
39 uint8_t getSize() const { return size; }
40 uint16_t getColor() const { return color; }
41
42 void setX(int16_t x) { this->x = x; }
43 void setY(int16_t y) { this->y = y; }
44 void setSize(uint8_t size) { this->size = size; }
45 void setColor(uint16_t color) { this->color = color; }
46
47 private:
49 int16_t x, y;
50 uint8_t size;
51 uint16_t color;
52};
53
54} // namespace MCU
55
A simple struct representing a pixel with integer coordinates.
Definition: Def.hpp:64
#define END_CS_NAMESPACE
#define BEGIN_CS_NAMESPACE
An interface for elements that draw to a display.
DisplayInterface & display
An interface for displays.
virtual void setTextColor(uint16_t color)=0
Set the text color.
virtual void setCursor(int16_t x, int16_t y)=0
Set the cursor position.
virtual void setTextSize(uint8_t size)=0
Set the text size.
bool getDirty() const
Check if the value was updated since the last time the dirty flag was cleared.
void clearDirty()
Clear the dirty flag.
bool getDirty() const override
Check if this DisplayElement has to be re-drawn.
void setSize(uint8_t size)
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.
Definition: TimeDisplay.hpp:16
void getBars(char *buff) const
Definition: TimeDisplay.hpp:30
void getBeats(char *buff) const
Definition: TimeDisplay.hpp:39
void getFrames(char *buff) const
Definition: TimeDisplay.hpp:48