This is an old version of the documentation. View the latest version here.
Control Surface  1.0.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
MCU::SevenSegmentDisplay< LENGTH > Class Template Reference

#include <SevenSegmentDisplay.hpp>

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

Public Member Functions

 SevenSegmentDisplay (const MIDICNChannelAddress &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 MIDICNChannelAddress address
 
MIDIInputElementCCnext
 
MIDIInputElementCCprevious
 

Private Member Functions

virtual bool updateImpl (const ChannelMessageMatcher &midimsg, const MIDICNChannelAddress &target) override
 Update a character. More...
 
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. More...
 
uint8_t getRangeIndex (const MIDICNChannelAddress &target) const
 
void moveDown ()
 Move down this element in the linked list of elements. More...
 
virtual MIDICNChannelAddress 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()

template<uint8_t LENGTH>
MCU::SevenSegmentDisplay< LENGTH >::SevenSegmentDisplay ( const MIDICNChannelAddress address)
inline

Constructor.

Todo:
Documentation.

Definition at line 18 of file SevenSegmentDisplay.hpp.

Member Function Documentation

◆ fillWithSpaces()

template<uint8_t LENGTH>
void MCU::SevenSegmentDisplay< LENGTH >::fillWithSpaces ( )
inline

Definition at line 23 of file SevenSegmentDisplay.hpp.

◆ reset()

template<uint8_t LENGTH>
void MCU::SevenSegmentDisplay< LENGTH >::reset ( )
inlineoverridevirtual

Reset the input element to its initial state.

Reimplemented from MIDIInputElement.

Definition at line 28 of file SevenSegmentDisplay.hpp.

◆ updateImpl()

template<uint8_t LENGTH>
virtual bool MCU::SevenSegmentDisplay< LENGTH >::updateImpl ( const ChannelMessageMatcher midimsg,
const MIDICNChannelAddress target 
)
inlineoverrideprivatevirtual

Update a character.

Implements MIDIInputElement.

Definition at line 38 of file SevenSegmentDisplay.hpp.

◆ match()

template<uint8_t LENGTH>
bool MCU::SevenSegmentDisplay< LENGTH >::match ( const MIDICNChannelAddress 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()

template<uint8_t LENGTH>
uint8_t MCU::SevenSegmentDisplay< LENGTH >::getRangeIndex ( const MIDICNChannelAddress target) const
inlineprivate
Todo:

Definition at line 60 of file SevenSegmentDisplay.hpp.

◆ getText()

template<uint8_t LENGTH>
void MCU::SevenSegmentDisplay< LENGTH >::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()

template<uint8_t LENGTH>
char MCU::SevenSegmentDisplay< LENGTH >::getCharacterAt ( uint8_t  index) const
inline

Get the character at the given index.

Todo:
Documentation.

Definition at line 93 of file SevenSegmentDisplay.hpp.

◆ getDecimalPoints()

template<uint8_t LENGTH>
void MCU::SevenSegmentDisplay< LENGTH >::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()

template<uint8_t LENGTH>
bool MCU::SevenSegmentDisplay< LENGTH >::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()

template<uint8_t LENGTH>
size_t MCU::SevenSegmentDisplay< LENGTH >::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 MIDIInputElementCC::beginAll ( )
inlinestaticinherited

Initialize all MIDIInputElementCC elements.

See also
MIDIInputElementCC::begin

Definition at line 50 of file MIDIInputElementCC.hpp.

◆ updateAll()

static void MIDIInputElementCC::updateAll ( )
inlinestaticinherited

Update all MIDIInputElementCC elements.

See also
MIDIInputElementCC::update

Definition at line 58 of file MIDIInputElementCC.hpp.

◆ resetAll()

static void MIDIInputElementCC::resetAll ( )
inlinestaticinherited

Reset all MIDIInputElementCC elements to their initial state.

See also
MIDIInputElementCC::reset

Definition at line 66 of file MIDIInputElementCC.hpp.

◆ updateAllWith()

static void MIDIInputElementCC::updateAllWith ( const ChannelMessageMatcher midimsg)
inlinestaticinherited

Update all MIDIInputElementCC elements with a new MIDI message.

See also
MIDIInputElementCC::updateWith

Definition at line 74 of file MIDIInputElementCC.hpp.

◆ moveDown()

void MIDIInputElementCC::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 92 of file MIDIInputElementCC.hpp.

◆ begin()

virtual void MIDIInputElement::begin ( )
inlinevirtualinherited

Initialize the input element.

Reimplemented in MCU::VPotRing_Base< NumValues, Callback >, MCU::VPotRing_Base< NumBanks, Callback >, MCU::VPotRing_Base< 1, VPotRingLEDsCallback >, MCU::VPotRing_Base< NumBanks, VPotEmptyCallback >, MCU::VPotRing_Base< 1, VPotEmptyCallback >, MCU::VPotRing_Base< 1, Callback >, MCU::VPotRing_Base< NumBanks, VPotRingLEDsCallback >, MCU::VU_Base< NumValues, Callback >, MCU::VU_Base< NumBanks, Callback >, MCU::VU_Base< NumBanks, VULEDsCallback< NumLEDs > >, MCU::VU_Base< NumBanks, VUEmptyCallback >, MCU::VU_Base< 1, VUEmptyCallback >, MCU::VU_Base< 1, VULEDsCallback< NumLEDs > >, MCU::VU_Base< 1, Callback >, NoteCCRange< MIDIInputElementCC, RangeLen, NumBanks, NoteCCLEDBarCallback< NumLEDs > >, NoteCCRange< MIDIInputElementNote, RangeLen, 1, NoteCCLED< RangeLen > >, NoteCCRange< MIDIInputElementCC, RangeLen, 1, NoteCCFastLED< ColorMapper > >, NoteCCRange< MIDIInputElementCC, RangeLen, NumBanks, NoteCCFastLED< ColorMapper > >, NoteCCRange< MIDIInputElementCC, RangeLen, 1, NoteCCLED< 1 > >, NoteCCRange< MIDIInputElementCC, RangeLen, NumBanks, NoteCCLED< 1 > >, NoteCCRange< MIDIInputElementNote, RangeLen, NumBanks, NoteCCLED< 1 > >, NoteCCRange< MIDIInputElementCC, RangeLen, NumBanks, NoteCCRangeEmptyCallback >, NoteCCRange< MIDIInputElementCC, RangeLen, 1, NoteCCLEDBarCallback< NumLEDs > >, NoteCCRange< MIDIInputElementNote, RangeLen, NumBanks, NoteCCFastLED< ColorMapper > >, NoteCCRange< MIDIInputElementNote, RangeLen, NumBanks, NoteCCLEDBarCallback< NumLEDs > >, NoteCCRange< MIDIInputElementNote, RangeLen, NumBanks, NoteCCLED< RangeLen > >, NoteCCRange< MIDIInputElementCC, RangeLen, 1, NoteCCLED< RangeLen > >, NoteCCRange< MIDIInputElementCC, RangeLen, 1, NoteCCRangeEmptyCallback >, NoteCCRange< MIDIInputElementNote, RangeLen, NumBanks, NoteCCRangeEmptyCallback >, NoteCCRange< MIDIInputElementNote, RangeLen, 1, NoteCCRangeEmptyCallback >, NoteCCRange< MIDIInputElementNote, RangeLen, 1, NoteCCLEDBarCallback< NumLEDs > >, NoteCCRange< MIDIInputElementCC, RangeLen, NumBanks, NoteCCLED< RangeLen > >, NoteCCRange< MIDIInputElementNote, RangeLen, 1, NoteCCLED< 1 > >, NoteCCRange< MIDIInputElementNote, RangeLen, 1, NoteCCFastLED< ColorMapper > >, GenericProgramChangeSelector< N, Callback >, GenericProgramChangeSelector< N >, and GenericProgramChangeSelector< N, SelectorLEDsCallback< N > >.

Definition at line 30 of file MIDIInputElement.hpp.

◆ update()

virtual void MIDIInputElement::update ( )
inlinevirtualinherited

◆ updateWith()

bool MIDIInputElement::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 MIDICNChannelAddress MIDIInputElement::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 MCU::VU_Base< NumValues, Callback >, MCU::VU_Base< NumBanks, Callback >, MCU::VU_Base< NumBanks, VULEDsCallback< NumLEDs > >, MCU::VU_Base< NumBanks, VUEmptyCallback >, MCU::VU_Base< 1, VUEmptyCallback >, MCU::VU_Base< 1, VULEDsCallback< NumLEDs > >, MCU::VU_Base< 1, Callback >, MIDIInputElementChannelPressure, and MIDIInputElementPC.

Definition at line 64 of file MIDIInputElement.hpp.

Member Data Documentation

◆ text

template<uint8_t LENGTH>
char MCU::SevenSegmentDisplay< LENGTH >::text[LENGTH]
private

Definition at line 127 of file SevenSegmentDisplay.hpp.

◆ elements

DoublyLinkedList< MIDIInputElementCC > MIDIInputElementCC::elements
staticprivateinherited

Definition at line 97 of file MIDIInputElementCC.hpp.

◆ address

const MIDICNChannelAddress MIDIInputElement::address
protectedinherited

Definition at line 80 of file MIDIInputElement.hpp.

◆ next

MIDIInputElementCC * DoublyLinkable< MIDIInputElementCC >::next
protectedinherited

Definition at line 301 of file LinkedList.hpp.

◆ previous

MIDIInputElementCC * DoublyLinkable< MIDIInputElementCC >::previous
protectedinherited

Definition at line 302 of file LinkedList.hpp.


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