3#include <AH/STL/algorithm>
18template <u
int8_t LENGTH>
21 TwoByteRangeMIDIMatcher>,
42 uint8_t index = LENGTH - 1 - match.
index;
46 uint8_t decimalPt = (match.
value & 0x40) << 1;
47 uint8_t chardata = match.
value & 0x3F;
48 uint8_t character = chardata >= 0x20 ? chardata : chardata + 0x40;
49 character |= decimalPt;
51 text[index] = character;
73 void getText(
char *buffer, uint8_t offset = 0,
74 uint8_t length = LENGTH)
const {
77 if (length > LENGTH - offset)
78 length = LENGTH - offset;
79 for (uint8_t i = 0; i < length; i++)
81 buffer[length] =
'\0';
98 for (uint8_t i = 0; i < LENGTH; i++)
114 size_t printTo(Print &printer)
const override {
116 for (uint8_t i = 0; i < LENGTH; i++) {
119 s += printer.print(
'.');
#define BEGIN_CS_NAMESPACE
A class for serial-in/parallel-out shift registers, like the 74HC595 that are connected to the SPI bu...
Class that receives and saves the text of a Mackie Control Universal 7-segment display like the assig...
void getDecimalPoints(bool *buffer) const
Copy the decimal points into the given buffer.
bool getDecimalPointAt(uint8_t index) const
Get the decimal point state at the given index.
bool ignoreReset
Don't reset the state when calling the reset method.
SevenSegmentDisplay(MIDIAddress address)
bool getDirty() const
Check if the value was updated since the last time the dirty flag was cleared.
char getCharacterAt(uint8_t index) const
Get the character at the given index.
void getText(char *buffer, uint8_t offset=0, uint8_t length=LENGTH) const
Copy the ASCII text into the given buffer.
size_t printTo(Print &printer) const override
Print out the text of the display to the given Print.
AH::Array< char, LENGTH > text
Non-ASCII and not null-terminated.
void handleUpdate(typename Matcher::Result match) override
Update a single character.
void reset() override
Reset the input element to its initial state.
void clearDirty()
Clear the dirty flag.
A type-safe utility class for saving a MIDI address consisting of a 7-bit address,...
Matcher for MIDI messages with 2 data bytes, such as Note On/Off, Control Change, Key Pressure (but n...