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 {
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);
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
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.
Displays the MCU time code display.
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.
void getBars(char *buff) const
void getBeats(char *buff) const
void getFrames(char *buff) const
A simple struct representing a pixel with integer coordinates.
Definition Def.hpp:64