Control Surface main
MIDI Control Surface library for Arduino
Loading...
Searching...
No Matches
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.
 

Detecting changes

bool getDirty () const
 Check if the text was updated since the last time the dirty flag was cleared.
 
void clearDirty ()
 Clear the dirty flag.
 
void markDirty ()
 Set the dirty counter to the number of subscribers (or one).
 
void addSubscriber ()
 
void removeSubscriber ()
 

Enabling and disabling updatables

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

Public Types

using MessageType
 

Public Member Functions

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

Static Public Member Functions

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

Protected Member Functions

bool updateWith (SysExMessage midimsg) override
 

Protected Attributes

Node * next = nullptr
 
Node * previous = nullptr
 

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
 
uint8_t dirty = 0
 
uint8_t num_subscribers = 0
 

Static Private Attributes

static uint8_t instances = 0
 

Member Typedef Documentation

◆ MessageType

template<MIDIMessageType Type>
using MessageType
inherited
Initial value:
typename std::conditional<Type == MIDIMessageType::SysExStart,
@ SysExStart
Start of System Exclusive.

Definition at line 29 of file MIDIInputElement.hpp.

Constructor & Destructor Documentation

◆ LCD()

template<uint8_t BufferSize = 112>
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]

template<uint8_t BufferSize = 112>
bool updateWith ( SysExMessage midimsg)
inlineoverrideprotected

Definition at line 71 of file LCD.hpp.

◆ begin()

template<uint8_t BufferSize = 112>
void begin ( )
inlineoverridevirtual

Initialize the input element.

Reimplemented from MIDIInputElement< Type >.

Definition at line 132 of file LCD.hpp.

◆ getText()

template<uint8_t BufferSize = 112>
const char * getText ( ) const
inline

Get a pointer to the null-terminated display text.

Definition at line 138 of file LCD.hpp.

◆ getDirty()

template<uint8_t BufferSize = 112>
bool getDirty ( ) const
inline

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

Definition at line 148 of file LCD.hpp.

◆ clearDirty()

template<uint8_t BufferSize = 112>
void clearDirty ( )
inline

Clear the dirty flag.

Definition at line 150 of file LCD.hpp.

◆ markDirty()

template<uint8_t BufferSize = 112>
void markDirty ( )
inline

Set the dirty counter to the number of subscribers (or one).

Definition at line 155 of file LCD.hpp.

◆ addSubscriber()

template<uint8_t BufferSize = 112>
void addSubscriber ( )
inline

Definition at line 156 of file LCD.hpp.

◆ removeSubscriber()

template<uint8_t BufferSize = 112>
void removeSubscriber ( )
inline

Definition at line 157 of file LCD.hpp.

◆ reset()

template<MIDIMessageType Type>
virtual void reset ( )
inlinevirtualinherited

◆ update()

template<MIDIMessageType Type>
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]

template<MIDIMessageType Type>
virtual bool updateWith ( MessageType midimsg)
pure virtualinherited

◆ updateAllWith()

template<MIDIMessageType Type>
static bool updateAllWith ( MessageType midimsg)
inlinestaticinherited

Update all.

Definition at line 46 of file MIDIInputElement.hpp.

◆ updateAll()

template<MIDIMessageType Type>
static void updateAll ( )
inlinestaticinherited

Update all.

Definition at line 57 of file MIDIInputElement.hpp.

◆ beginAll()

template<MIDIMessageType Type>
static void beginAll ( )
inlinestaticinherited

Begin all.

Definition at line 62 of file MIDIInputElement.hpp.

◆ resetAll()

template<MIDIMessageType Type>
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 96 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 125 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 127 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 130 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 106 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 136 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 138 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 141 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 120 of file Updatable.hpp.

◆ moveDown()

void moveDown ( )
inlineinherited

Move down this element in the list.

Definition at line 147 of file Updatable.hpp.

◆ getInstances()

static uint8_t getInstances ( )
inlinestaticinherited

Definition at line 27 of file LCD.hpp.

Member Data Documentation

◆ buffer

template<uint8_t BufferSize = 112>
Array<char, BufferSize + 1> buffer
private

Definition at line 162 of file LCD.hpp.

◆ offset

template<uint8_t BufferSize = 112>
uint8_t offset
private

Definition at line 163 of file LCD.hpp.

◆ cable

template<uint8_t BufferSize = 112>
Cable cable
private

Definition at line 164 of file LCD.hpp.

◆ dirty

template<uint8_t BufferSize = 112>
uint8_t dirty = 0
private

Definition at line 165 of file LCD.hpp.

◆ num_subscribers

template<uint8_t BufferSize = 112>
uint8_t num_subscribers = 0
private

Definition at line 166 of file LCD.hpp.

◆ updatables

DoublyLinkedList< MIDIInputElement< Type > > updatables
staticprotectedinherited

Definition at line 152 of file Updatable.hpp.

◆ next

template<class Node >
Node* next = nullptr
protectedinherited

Definition at line 320 of file LinkedList.hpp.

◆ previous

template<class Node >
Node* previous = nullptr
protectedinherited

Definition at line 321 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: