Control Surface master
MIDI Control Surface library for Arduino
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
LCD< BufferSize > Class Template Referenceabstract

#include <MIDI_Inputs/MCU/LCD.hpp>

Detailed Description

template<uint8_t BufferSize = 112>
class MCU::LCD< BufferSize >

A class that represents the Mackie Control Universal LCD display and saves the text it receives.

The format of the MIDI message is as follows (hex):

SysEx Start Data 1 Data 2 Data 3 Data 4 Data 5 Data 6 Data 7  ...  SysEx End
F0 mm mm mm nn 12 oo yy ... F7

The manufacturer ID and model number are ignored by this class.

Examples
MCU-OLED-SSD1306-x2.ino.

Definition at line 51 of file LCD.hpp.

+ Inheritance diagram for LCD< BufferSize >:
+ Collaboration diagram for LCD< BufferSize >:

Data access

const char * getText () const
 Get a pointer to the null-terminated display text. More...
 

Detecting changes

bool getDirty () const
 Check if the text was updated since the last time the dirty flag was cleared. More...
 
void clearDirty ()
 Clear the dirty flag. More...
 

Enabling and disabling updatables

void enable ()
 Enable this updatable: insert it into the linked list of instances, so it gets updated automatically. More...
 
void disable ()
 Disable this updatable: remove it from the linked list of instances, so it no longer gets updated automatically. More...
 
bool isEnabled () const
 Check if this updatable is enabled. More...
 
void moveDown ()
 Move down this element in the list. More...
 
static void enable (UpdatableCRTP *element)
 Enable this updatable: insert it into the linked list of instances, so it gets updated automatically. More...
 
static void enable (UpdatableCRTP &element)
 Enable this updatable: insert it into the linked list of instances, so it gets updated automatically. More...
 
static void enable (U(&array)[N])
 Enable this updatable: insert it into the linked list of instances, so it gets updated automatically. More...
 
static void disable (UpdatableCRTP *element)
 Disable this updatable: remove it from the linked list of instances, so it no longer gets updated automatically. More...
 
static void disable (UpdatableCRTP &element)
 Disable this updatable: remove it from the linked list of instances, so it no longer gets updated automatically. More...
 
static void disable (U(&array)[N])
 Disable this updatable: remove it from the linked list of instances, so it no longer gets updated automatically. More...
 

Public Types

using MessageType = typename std::conditional< Type==MIDIMessageType::SYSEX_START, SysExMessage, ChannelMessage >::type
 

Public Member Functions

 LCD (uint8_t offset=0, Cable cable=CABLE_1)
 
virtual void begin ()
 Initialize the input element. More...
 
virtual void reset ()
 Reset the input element to its initial state. More...
 
virtual void update ()
 Update the value of the input element. Used for decaying VU meters etc. More...
 
virtual bool updateWith (MessageType midimsg)=0
 Receive a new MIDI message and update the internal state. More...
 

Static Public Member Functions

static bool updateAllWith (MessageType midimsg)
 Update all. More...
 
static void updateAll ()
 Update all. More...
 
static void beginAll ()
 Begin all. More...
 
static void resetAll ()
 Reset all. More...
 

Protected Member Functions

bool updateWith (SysExMessage midimsg) override
 

Protected Attributes

MIDIInputElement< Type > * next
 
MIDIInputElement< Type > * previous
 

Static Protected Attributes

static DoublyLinkedList< MIDIInputElement< Type > > updatables
 

Static Private Member Functions

static uint8_t getInstances ()
 

Private Attributes

Array< char, BufferSize+1 > buffer
 
uint8_t offset
 
Cable cable
 
bool dirty = true
 

Static Private Attributes

static uint8_t instances = 0
 

Member Typedef Documentation

◆ MessageType

using MessageType = typename std::conditional<Type == MIDIMessageType::SYSEX_START, SysExMessage, ChannelMessage>::type
inherited

Definition at line 29 of file MIDIInputElement.hpp.

Constructor & Destructor Documentation

◆ LCD()

LCD ( uint8_t  offset = 0,
Cable  cable = CABLE_1 
)
inline
Parameters
offsetThe text sent over MIDI is 112 characters long, by changing the offset within this text and the length of the text, we can listen to just a section of the text. E.g. offset = 56 and BufferSize = 56 will listen to just the second line of the LCD display. The default is offset = 0 and BufferSize = 112, i.e. listening to the entire display.
cableThe MIDI USB cable number to listen for.

Definition at line 62 of file LCD.hpp.

Member Function Documentation

◆ updateWith() [1/2]

bool updateWith ( SysExMessage  midimsg)
inlineoverrideprotected

Definition at line 72 of file LCD.hpp.

◆ getText()

const char * getText ( ) const
inline

Get a pointer to the null-terminated display text.

Definition at line 137 of file LCD.hpp.

◆ getDirty()

bool getDirty ( ) const
inline

Check if the text was updated since the last time the dirty flag was cleared.

Definition at line 146 of file LCD.hpp.

◆ clearDirty()

void clearDirty ( )
inline

Clear the dirty flag.

Definition at line 148 of file LCD.hpp.

◆ begin()

virtual void begin ( )
inlinevirtualinherited

◆ reset()

virtual void reset ( )
inlinevirtualinherited

◆ update()

virtual void update ( )
inlinevirtualinherited

Update the value of the input element. Used for decaying VU meters etc.

Reimplemented in VULEDs< NumLEDs >, VULEDs< BankSize, NumLEDs >, VU, and VU< BankSize >.

Definition at line 40 of file MIDIInputElement.hpp.

◆ updateWith() [2/2]

virtual bool updateWith ( MessageType  midimsg)
pure virtualinherited

◆ updateAllWith()

static bool updateAllWith ( MessageType  midimsg)
inlinestaticinherited

Update all.

Definition at line 46 of file MIDIInputElement.hpp.

◆ updateAll()

static void updateAll ( )
inlinestaticinherited

Update all.

Definition at line 57 of file MIDIInputElement.hpp.

◆ beginAll()

static void beginAll ( )
inlinestaticinherited

Begin all.

Definition at line 62 of file MIDIInputElement.hpp.

◆ resetAll()

static void resetAll ( )
inlinestaticinherited

Reset all.

Definition at line 67 of file MIDIInputElement.hpp.

◆ enable() [1/4]

void enable ( )
inlineinherited

Enable this updatable: insert it into the linked list of instances, so it gets updated automatically.

Definition at line 100 of file Updatable.hpp.

◆ enable() [2/4]

static void enable ( UpdatableCRTP< MIDIInputElement< Type > > *  element)
inlinestaticinherited

Enable this updatable: insert it into the linked list of instances, so it gets updated automatically.

Definition at line 129 of file Updatable.hpp.

◆ enable() [3/4]

static void enable ( UpdatableCRTP< MIDIInputElement< Type > > &  element)
inlinestaticinherited

Enable this updatable: insert it into the linked list of instances, so it gets updated automatically.

Definition at line 131 of file Updatable.hpp.

◆ enable() [4/4]

static void enable ( U(&)  array[N])
inlinestaticinherited

Enable this updatable: insert it into the linked list of instances, so it gets updated automatically.

Definition at line 134 of file Updatable.hpp.

◆ disable() [1/4]

void disable ( )
inlineinherited

Disable this updatable: remove it from the linked list of instances, so it no longer gets updated automatically.

Definition at line 110 of file Updatable.hpp.

◆ disable() [2/4]

static void disable ( UpdatableCRTP< MIDIInputElement< Type > > *  element)
inlinestaticinherited

Disable this updatable: remove it from the linked list of instances, so it no longer gets updated automatically.

Definition at line 140 of file Updatable.hpp.

◆ disable() [3/4]

static void disable ( UpdatableCRTP< MIDIInputElement< Type > > &  element)
inlinestaticinherited

Disable this updatable: remove it from the linked list of instances, so it no longer gets updated automatically.

Definition at line 142 of file Updatable.hpp.

◆ disable() [4/4]

static void disable ( U(&)  array[N])
inlinestaticinherited

Disable this updatable: remove it from the linked list of instances, so it no longer gets updated automatically.

Definition at line 145 of file Updatable.hpp.

◆ isEnabled()

bool isEnabled ( ) const
inlineinherited

Check if this updatable is enabled.

Note
Assumes that the updatable is not added to a different linked list by the user.

Definition at line 124 of file Updatable.hpp.

◆ moveDown()

void moveDown ( )
inlineinherited

Move down this element in the list.

Definition at line 151 of file Updatable.hpp.

◆ getInstances()

static uint8_t getInstances ( )
inlinestaticinherited

Definition at line 27 of file LCD.hpp.

Member Data Documentation

◆ buffer

Array<char, BufferSize + 1> buffer
private

Definition at line 153 of file LCD.hpp.

◆ offset

uint8_t offset
private

Definition at line 154 of file LCD.hpp.

◆ cable

Cable cable
private

Definition at line 155 of file LCD.hpp.

◆ dirty

bool dirty = true
private

Definition at line 156 of file LCD.hpp.

◆ updatables

DoublyLinkedList< MIDIInputElement< Type > > updatables
staticprotectedinherited

Definition at line 156 of file Updatable.hpp.

◆ next

MIDIInputElement< Type > * next
protectedinherited

Definition at line 324 of file LinkedList.hpp.

◆ previous

MIDIInputElement< Type > * previous
protectedinherited

Definition at line 325 of file LinkedList.hpp.

◆ instances

uint8_t instances = 0
staticprivateinherited

Definition at line 30 of file LCD.hpp.


The documentation for this class was generated from the following file: