This is an old version of the documentation. View the latest version here.
Control Surface  1.0.0
MIDI Control Surface library for Arduino
TimeDisplayDisplay.hpp
Go to the documentation of this file.
1 #pragma once
2 
6 
8 
9 namespace MCU {
10 
12  public:
15  uint8_t size, uint16_t color)
17  size(size), color(color) {}
18 
19  void draw() override {
22  display.setCursor(x, y);
23 
24  char barStr[6], beatStr[3], frameStr[4];
25  timedisplay.getBars(barStr);
26  timedisplay.getBeats(beatStr);
27  timedisplay.getFrames(frameStr);
28  display.print(barStr);
29  display.print(' ');
30  display.print(beatStr);
31  display.print(' ');
32  display.print(frameStr);
33  }
34 
35  int16_t getX() const { return x; }
36  int16_t getY() const { return y; }
37  uint8_t getSize() const { return size; }
38  uint16_t getColor() const { return color; }
39 
40  void setX(int16_t x) { this->x = x; }
41  void setY(int16_t y) { this->y = y; }
42  void setSize(uint8_t size) { this->size = size; }
43  void setColor(uint16_t color) { this->color = color; }
44 
45  private:
47  int16_t x, y;
48  uint8_t size;
49  uint16_t color;
50 };
51 
52 } // namespace MCU
53 
DisplayElement
An interface for elements that draw to a display.
Definition: DisplayElement.hpp:11
MCU::TimeDisplayDisplay::y
int16_t y
Definition: TimeDisplayDisplay.hpp:47
MCU::TimeDisplayDisplay::TimeDisplayDisplay
TimeDisplayDisplay(DisplayInterface &display, const TimeDisplay &timedisplay, PixelLocation loc, uint8_t size, uint16_t color)
Definition: TimeDisplayDisplay.hpp:13
DisplayInterface
An interface for displays.
Definition: DisplayInterface.hpp:14
MCU
Names and note and controller numbers for the Mackie Control Universal (MCU) protocol.
Definition: LCDDisplay.hpp:10
MCU::TimeDisplayDisplay
Definition: TimeDisplayDisplay.hpp:11
MCU::TimeDisplayDisplay::getSize
uint8_t getSize() const
Definition: TimeDisplayDisplay.hpp:37
MCU::TimeDisplay::getFrames
void getFrames(char *buff) const
Definition: TimeDisplay.hpp:44
MCU::TimeDisplayDisplay::x
int16_t x
Definition: TimeDisplayDisplay.hpp:47
DisplayInterface.hpp
PixelLocation
A simple struct representing a pixel with integer coordinates.
Definition: Def.hpp:74
TimeDisplay.hpp
BEGIN_CS_NAMESPACE
#define BEGIN_CS_NAMESPACE
Definition: NamespaceSettings.hpp:9
DisplayElement.hpp
DisplayInterface::setCursor
virtual void setCursor(int16_t x, int16_t y)=0
Set the cursor position.
DisplayInterface::setTextSize
virtual void setTextSize(uint8_t size)=0
Set the text size.
MCU::TimeDisplayDisplay::size
uint8_t size
Definition: TimeDisplayDisplay.hpp:48
MCU::TimeDisplay
Definition: TimeDisplay.hpp:12
END_CS_NAMESPACE
#define END_CS_NAMESPACE
Definition: NamespaceSettings.hpp:10
MCU::TimeDisplayDisplay::setColor
void setColor(uint16_t color)
Definition: TimeDisplayDisplay.hpp:43
MCU::TimeDisplay::getBars
void getBars(char *buff) const
Definition: TimeDisplay.hpp:26
DisplayElement::display
DisplayInterface & display
Definition: DisplayElement.hpp:44
MCU::TimeDisplayDisplay::color
uint16_t color
Definition: TimeDisplayDisplay.hpp:49
MCU::TimeDisplayDisplay::draw
void draw() override
Draw this DisplayElement to the display buffer.
Definition: TimeDisplayDisplay.hpp:19
MCU::TimeDisplay::getBeats
void getBeats(char *buff) const
Definition: TimeDisplay.hpp:35
MCU::TimeDisplayDisplay::timedisplay
const TimeDisplay & timedisplay
Definition: TimeDisplayDisplay.hpp:46
MCU::TimeDisplayDisplay::setY
void setY(int16_t y)
Definition: TimeDisplayDisplay.hpp:41
MCU::TimeDisplayDisplay::getColor
uint16_t getColor() const
Definition: TimeDisplayDisplay.hpp:38
MCU::TimeDisplayDisplay::setSize
void setSize(uint8_t size)
Definition: TimeDisplayDisplay.hpp:42
MCU::TimeDisplayDisplay::setX
void setX(int16_t x)
Definition: TimeDisplayDisplay.hpp:40
MCU::TimeDisplayDisplay::getX
int16_t getX() const
Definition: TimeDisplayDisplay.hpp:35
DisplayInterface::setTextColor
virtual void setTextColor(uint16_t color)=0
Set the text color.
MCU::TimeDisplayDisplay::getY
int16_t getY() const
Definition: TimeDisplayDisplay.hpp:36