MIDI Control Surface library for Arduino
|
Go to the documentation of this file.
11 template <u
int8_t LENGTH>
44 uint8_t decimalPt = (midimsg.
data2 & 0x40) << 1;
45 uint8_t chardata = midimsg.
data2 & 0x3F;
46 uint8_t character = chardata >= 0x20 ? chardata : chardata + 0x40;
47 character |= decimalPt;
48 text[index] = character;
78 void getText(
char *buffer, uint8_t offset = 0,
79 uint8_t length = LENGTH)
const {
82 if (length > LENGTH - offset)
83 length = LENGTH - offset;
84 for (uint8_t i = 0; i < length; i++)
86 buffer[length] =
'\0';
103 for (uint8_t i = 0; i < LENGTH; i++)
116 size_t printTo(Print &printer)
const override {
118 for (uint8_t i = 0; i < LENGTH; i++) {
121 s += printer.print(
'.');
virtual bool updateImpl(const ChannelMessageMatcher &midimsg, const MIDICNChannelAddress &target) override
Update a character.
SevenSegmentDisplay(const MIDICNChannelAddress &address)
Constructor.
uint8_t getRangeIndex(const MIDICNChannelAddress &target) const
Names and note and controller numbers for the Mackie Control Universal (MCU) protocol.
static bool matchAddressInRange(const MIDICNChannelAddress &toMatch, const MIDICNChannelAddress &base, uint8_t length)
Check if an address falls within a range of addresses, starting with address base,...
void getDecimalPoints(bool *buffer) const
Copy the decimal points into the given buffer.
#define BEGIN_CS_NAMESPACE
bool getDecimalPointAt(uint8_t index) const
Get the decimal point state at the given index.
Struct for easily matching MIDI messages.
A type-safe utility class for saving a MIDI address consisting of a 7-bit address,...
constexpr uint8_t getAddress() const
Get the address [0, 127].
void getText(char *buffer, uint8_t offset=0, uint8_t length=LENGTH) const
Copy the ASCII text into the given buffer.
void reset() override
Reset the input element to its initial state.
size_t printTo(Print &printer) const override
Print out the text of the display to the given Print.
char getCharacterAt(uint8_t index) const
Get the character at the given index.
bool match(const MIDICNChannelAddress &target) const override
Check if the address of the incoming MIDI message is within the range of addresses of this element.