Control Surface  1.2.0
MIDI Control Surface library for Arduino
Public Member Functions | Static Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
SevenSegmentDisplay< LENGTH > Class Template Reference

#include <MIDI_Inputs/MCU/SevenSegmentDisplay.hpp>

+ Inheritance diagram for SevenSegmentDisplay< LENGTH >:
+ Collaboration diagram for SevenSegmentDisplay< LENGTH >:

Public Member Functions

 SevenSegmentDisplay (const MIDIAddress &address)
 Constructor. More...
 
void fillWithSpaces ()
 
void reset () override
 Reset the input element to its initial state. More...
 
void getText (char *buffer, uint8_t offset=0, uint8_t length=LENGTH) const
 Copy the ASCII text into the given buffer. More...
 
char getCharacterAt (uint8_t index) const
 Get the character at the given index. More...
 
void getDecimalPoints (bool *buffer) const
 Copy the decimal points into the given buffer. More...
 
bool getDecimalPointAt (uint8_t index) const
 Get the decimal point state at the given index. More...
 
size_t printTo (Print &printer) const override
 Print out the text of the display to the given Print. More...
 
virtual void begin ()
 Initialize the input element. More...
 
virtual void update ()
 Update the value of the input element. Used for decaying VU meters etc. More...
 
bool updateWith (const ChannelMessageMatcher &midimsg)
 Receive a new MIDI message and update the internal state. More...
 

Static Public Member Functions

static void beginAll ()
 Initialize all MIDIInputElementCC elements. More...
 
static void updateAll ()
 Update all MIDIInputElementCC elements. More...
 
static void resetAll ()
 Reset all MIDIInputElementCC elements to their initial state. More...
 
static void updateAllWith (const ChannelMessageMatcher &midimsg)
 Update all MIDIInputElementCC elements with a new MIDI message. More...
 

Protected Attributes

const MIDIAddress address
 
MIDIInputElementCCnext
 
MIDIInputElementCCprevious
 

Private Member Functions

virtual bool updateImpl (const ChannelMessageMatcher &midimsg, const MIDIAddress &target) override
 Update a character. More...
 
bool match (const MIDIAddress &target) const override
 Check if the address of the incoming MIDI message is within the range of addresses of this element. More...
 
uint8_t getRangeIndex (const MIDIAddress &target) const
 
void moveDown ()
 Move down this element in the linked list of elements. More...
 
virtual MIDIAddress getTarget (const ChannelMessageMatcher &midimsg) const
 Extract the target address from a MIDI message. More...
 

Private Attributes

char text [LENGTH]
 

Static Private Attributes

static DoublyLinkedList< MIDIInputElementCCelements
 

Detailed Description

template<uint8_t LENGTH>
class MCU::SevenSegmentDisplay< LENGTH >

Definition at line 12 of file SevenSegmentDisplay.hpp.

Constructor & Destructor Documentation

◆ SevenSegmentDisplay()

SevenSegmentDisplay ( const MIDIAddress address)
inline

Constructor.

Todo:
Documentation.

Definition at line 18 of file SevenSegmentDisplay.hpp.

Member Function Documentation

◆ fillWithSpaces()

void fillWithSpaces ( )
inline

Definition at line 23 of file SevenSegmentDisplay.hpp.

◆ reset()

void reset ( )
inlineoverridevirtual

Reset the input element to its initial state.

Reimplemented from MIDIInputElement.

Definition at line 28 of file SevenSegmentDisplay.hpp.

◆ updateImpl()

virtual bool updateImpl ( const ChannelMessageMatcher midimsg,
const MIDIAddress target 
)
inlineoverrideprivatevirtual

Update a character.

Implements MIDIInputElement.

Definition at line 38 of file SevenSegmentDisplay.hpp.

◆ match()

bool match ( const MIDIAddress target) const
inlineoverrideprivatevirtual

Check if the address of the incoming MIDI message is within the range of addresses of this element.

Reimplemented from MIDIInputElement.

Definition at line 54 of file SevenSegmentDisplay.hpp.

◆ getRangeIndex()

uint8_t getRangeIndex ( const MIDIAddress target) const
inlineprivate
Todo:

Definition at line 60 of file SevenSegmentDisplay.hpp.

◆ getText()

void getText ( char *  buffer,
uint8_t  offset = 0,
uint8_t  length = LENGTH 
) const
inline

Copy the ASCII text into the given buffer.

Parameters
[out]bufferThe destination to write the text to. Will be null-terminated. Should have a size of at least length+1 bytes.
[in]offsetThe offset to start copying from (in the source text, the offset in the destination buffer is always zero).
[in]lengthThe number of characters to copy.

Definition at line 78 of file SevenSegmentDisplay.hpp.

◆ getCharacterAt()

char getCharacterAt ( uint8_t  index) const
inline

Get the character at the given index.

Todo:
Documentation.

Definition at line 93 of file SevenSegmentDisplay.hpp.

◆ getDecimalPoints()

void getDecimalPoints ( bool *  buffer) const
inline

Copy the decimal points into the given buffer.

Parameters
[out]bufferThe destination to write the decimal points to. Should have a size of at least LENGTH bytes.

Definition at line 102 of file SevenSegmentDisplay.hpp.

◆ getDecimalPointAt()

bool getDecimalPointAt ( uint8_t  index) const
inline

Get the decimal point state at the given index.

Todo:
Documentation.

Definition at line 111 of file SevenSegmentDisplay.hpp.

◆ printTo()

size_t printTo ( Print &  printer) const
inlineoverride

Print out the text of the display to the given Print.

Definition at line 116 of file SevenSegmentDisplay.hpp.

◆ beginAll()

static void beginAll ( )
inlinestaticinherited

Initialize all MIDIInputElementCC elements.

See also
MIDIInputElementCC::begin

Definition at line 52 of file MIDIInputElementCC.hpp.

◆ updateAll()

static void updateAll ( )
inlinestaticinherited

Update all MIDIInputElementCC elements.

See also
MIDIInputElementCC::update

Definition at line 60 of file MIDIInputElementCC.hpp.

◆ resetAll()

static void resetAll ( )
inlinestaticinherited

Reset all MIDIInputElementCC elements to their initial state.

See also
MIDIInputElementCC::reset

Definition at line 68 of file MIDIInputElementCC.hpp.

◆ updateAllWith()

static void updateAllWith ( const ChannelMessageMatcher midimsg)
inlinestaticinherited

Update all MIDIInputElementCC elements with a new MIDI message.

See also
MIDIInputElementCC::updateWith

Definition at line 76 of file MIDIInputElementCC.hpp.

◆ moveDown()

void moveDown ( )
inlineprivateinherited

Move down this element in the linked list of elements.

This means that the element will be checked earlier on the next iteration.

Definition at line 94 of file MIDIInputElementCC.hpp.

◆ begin()

virtual void begin ( )
inlinevirtualinherited

Initialize the input element.

Reimplemented in GenericProgramChangeSelector< N, Callback >, GenericProgramChangeSelector< N >, GenericProgramChangeSelector< N, SelectorLEDsCallback< N > >, NoteCCRange< MIDIInputElementNote, RangeLen, NumBanks, NoteCCLEDPWM< RangeLen > >, NoteCCRange< MIDIInputElementNote, RangeLen, 1, NoteCCLEDPWM< 1 > >, NoteCCRange< MIDIInputElementCC, RangeLen, NumBanks, NoteCCLEDBarCallback< NumLEDs > >, NoteCCRange< MIDIInputElementNote, RangeLen, 1, NoteCCLEDPWM< RangeLen > >, NoteCCRange< MIDIInputElementNote, RangeLen, 1, NoteCCLED< RangeLen > >, NoteCCRange< MIDIInputElementCC, RangeLen, 1, NoteCCLED< 1 > >, NoteCCRange< MIDIInputElementCC, RangeLen, NumBanks, NoteCCLED< 1 > >, NoteCCRange< MIDIInputElementCC, RangeLen, NumBanks, NoteCCLEDPWM< RangeLen > >, NoteCCRange< MIDIInputElementNote, RangeLen, NumBanks, NoteCCLED< 1 > >, NoteCCRange< MIDIInputElementCC, RangeLen, 1, NoteCCLEDBarCallback< NumLEDs > >, NoteCCRange< MIDIInputElementNote, RangeLen, NumBanks, NoteCCLED< RangeLen > >, NoteCCRange< MIDIInputElementCC, RangeLen, 1, NoteCCLED< RangeLen > >, NoteCCRange< MIDIInputElementNote, RangeLen, NumBanks, NoteCCLEDBarCallback< NumLEDs > >, NoteCCRange< MIDIInputElementNote, RangeLen, 1, NoteCCFastLEDCallback< DefaultColorMapper > >, NoteCCRange< MIDIInputElementCC, RangeLen, NumBanks, NoteCCFastLEDCallback< DefaultColorMapper > >, NoteCCRange< MIDIInputElementCC, RangeLen, NumBanks, NoteCCLEDPWM< 1 > >, NoteCCRange< MIDIInputElementCC, RangeLen, 1, NoteCCFastLEDCallback< DefaultColorMapper > >, NoteCCRange< MIDIInputElementNote, RangeLen, NumBanks, NoteCCLEDPWM< 1 > >, NoteCCRange< MIDIInputElementNote, RangeLen, 1, NoteCCLEDBarCallback< NumLEDs > >, NoteCCRange< MIDIInputElementCC, RangeLen, 1, NoteCCLEDPWM< RangeLen > >, NoteCCRange< MIDIInputElementCC, RangeLen, 1, NoteCCLEDPWM< 1 > >, NoteCCRange< MIDIInputElementCC, RangeLen, NumBanks, NoteCCLED< RangeLen > >, NoteCCRange< MIDIInputElementNote, RangeLen, 1, NoteCCLED< 1 > >, NoteCCRange< MIDIInputElementNote, RangeLen, NumBanks, NoteCCFastLEDCallback< DefaultColorMapper > >, VU_Base< NumValues, Callback >, VU_Base< NumBanks, VULEDsCallback< NumLEDs > >, VU_Base< NumBanks, VUEmptyCallback >, VU_Base< 1, VUEmptyCallback >, VU_Base< 1, VULEDsCallback< NumLEDs > >, VPotRing_Base< NumValues, Callback >, VPotRing_Base< 1, VPotRingLEDsCallback >, VPotRing_Base< NumBanks, VPotEmptyCallback >, VPotRing_Base< 1, VPotEmptyCallback >, and VPotRing_Base< NumBanks, VPotRingLEDsCallback >.

Definition at line 30 of file MIDIInputElement.hpp.

◆ update()

virtual void update ( )
inlinevirtualinherited

◆ updateWith()

bool updateWith ( const ChannelMessageMatcher midimsg)
inlineinherited

Receive a new MIDI message and update the internal state.

Definition at line 39 of file MIDIInputElement.hpp.

◆ getTarget()

virtual MIDIAddress getTarget ( const ChannelMessageMatcher midimsg) const
inlineprivatevirtualinherited

Extract the target address from a MIDI message.

Note
This base version of the function is only valid for messages that use data1 as an address (i.e. Note On, Note Off, Polyphonic Key Pressure and Control Change), because it assumes that the target address consists of the address (data 1), the MIDI channel and the cable number.

Reimplemented in MIDIInputElementPC, MIDIInputElementChannelPressure, VU_Base< NumValues, Callback >, VU_Base< NumBanks, VULEDsCallback< NumLEDs > >, VU_Base< NumBanks, VUEmptyCallback >, VU_Base< 1, VUEmptyCallback >, and VU_Base< 1, VULEDsCallback< NumLEDs > >.

Definition at line 63 of file MIDIInputElement.hpp.

Member Data Documentation

◆ text

char text[LENGTH]
private

Definition at line 127 of file SevenSegmentDisplay.hpp.

◆ elements

DoublyLinkedList< MIDIInputElementCC > elements
staticprivateinherited

Definition at line 99 of file MIDIInputElementCC.hpp.

◆ address

const MIDIAddress address
protectedinherited

Definition at line 83 of file MIDIInputElement.hpp.

◆ next

MIDIInputElementCC * next
protectedinherited

Definition at line 323 of file LinkedList.hpp.

◆ previous

MIDIInputElementCC * previous
protectedinherited

Definition at line 324 of file LinkedList.hpp.


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