Control Surface  1.1.1
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
TimeDisplay Class Reference

#include <MIDI_Inputs/MCU/TimeDisplay.hpp>

Inheritance diagram for TimeDisplay:
Collaboration diagram for TimeDisplay:

Public Member Functions

 TimeDisplay (Channel channel=CHANNEL_1)
 
void print () const
 
void getBars (char *buff) const
 
void getBeats (char *buff) const
 
void getFrames (char *buff) const
 
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

Examples
MCU-OLED-SSD1306-MEGA.ino, MCU-OLED-SSD1306-x2.ino, and MCU-OLED-SSD1306.ino.

Definition at line 12 of file TimeDisplay.hpp.

Constructor & Destructor Documentation

◆ TimeDisplay()

TimeDisplay ( Channel  channel = CHANNEL_1)
inline

Definition at line 14 of file TimeDisplay.hpp.

Member Function Documentation

◆ print()

void print ( ) const
inline

Definition at line 18 of file TimeDisplay.hpp.

◆ getBars()

void getBars ( char *  buff) const
inline

Definition at line 26 of file TimeDisplay.hpp.

◆ getBeats()

void getBeats ( char *  buff) const
inline

Definition at line 35 of file TimeDisplay.hpp.

◆ getFrames()

void getFrames ( char *  buff) const
inline

Definition at line 44 of file TimeDisplay.hpp.

◆ fillWithSpaces()

void fillWithSpaces ( )
inlineinherited

Definition at line 23 of file SevenSegmentDisplay.hpp.

◆ reset()

void reset ( )
inlineoverridevirtualinherited

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 MIDICNChannelAddress target 
)
inlineoverrideprivatevirtualinherited

Update a character.

Implements MIDIInputElement.

Definition at line 38 of file SevenSegmentDisplay.hpp.

◆ match()

bool match ( const MIDICNChannelAddress target) const
inlineoverrideprivatevirtualinherited

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 MIDICNChannelAddress target) const
inlineprivateinherited
Todo:

Definition at line 60 of file SevenSegmentDisplay.hpp.

◆ getText()

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

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
inlineinherited

Get the character at the given index.

Todo:
Documentation.

Definition at line 93 of file SevenSegmentDisplay.hpp.

◆ getDecimalPoints()

void getDecimalPoints ( bool *  buffer) const
inlineinherited

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
inlineinherited

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
inlineoverrideinherited

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 50 of file MIDIInputElementCC.hpp.

◆ updateAll()

static void updateAll ( )
inlinestaticinherited

Update all MIDIInputElementCC elements.

See also
MIDIInputElementCC::update

Definition at line 58 of file MIDIInputElementCC.hpp.

◆ resetAll()

static void 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 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 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 begin ( )
inlinevirtualinherited

Initialize the input element.

Reimplemented in VPotRing_Base< NumValues, Callback >, VPotRing_Base< NumBanks, Callback >, VPotRing_Base< 1, VPotRingLEDsCallback >, VPotRing_Base< NumBanks, VPotEmptyCallback >, VPotRing_Base< 1, VPotEmptyCallback >, VPotRing_Base< 1, Callback >, VPotRing_Base< NumBanks, VPotRingLEDsCallback >, VU_Base< NumValues, Callback >, VU_Base< NumBanks, Callback >, VU_Base< NumBanks, VULEDsCallback< NumLEDs > >, VU_Base< NumBanks, VUEmptyCallback >, VU_Base< 1, VUEmptyCallback >, VU_Base< 1, VULEDsCallback< NumLEDs > >, VU_Base< 1, Callback >, NoteCCRange< MIDIInputElementCC, RangeLen, NumBanks, NoteCCLEDBarCallback< NumLEDs > >, NoteCCRange< MIDIInputElementNote, RangeLen, 1, NoteCCLEDPWM< 1 > >, NoteCCRange< MIDIInputElementNote, RangeLen, NumBanks, NoteCCLEDPWM< RangeLen > >, 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< MIDIInputElementNote, RangeLen, NumBanks, NoteCCLED< 1 > >, NoteCCRange< MIDIInputElementCC, RangeLen, NumBanks, NoteCCLEDPWM< RangeLen > >, NoteCCRange< MIDIInputElementNote, RangeLen, NumBanks, NoteCCFastLEDCallback< ColorMapper > >, NoteCCRange< MIDIInputElementCC, RangeLen, 1, NoteCCLEDBarCallback< NumLEDs > >, NoteCCRange< MIDIInputElementNote, RangeLen, NumBanks, NoteCCLEDBarCallback< NumLEDs > >, NoteCCRange< MIDIInputElementNote, RangeLen, NumBanks, NoteCCLED< RangeLen > >, NoteCCRange< MIDIInputElementCC, RangeLen, 1, NoteCCLED< RangeLen > >, NoteCCRange< MIDIInputElementNote, RangeLen, 1, NoteCCFastLEDCallback< ColorMapper > >, NoteCCRange< MIDIInputElementCC, RangeLen, NumBanks, NoteCCFastLEDCallback< ColorMapper > >, NoteCCRange< MIDIInputElementCC, RangeLen, NumBanks, NoteCCLEDPWM< 1 > >, NoteCCRange< MIDIInputElementNote, RangeLen, NumBanks, NoteCCLEDPWM< 1 > >, NoteCCRange< MIDIInputElementNote, RangeLen, 1, NoteCCLEDBarCallback< NumLEDs > >, NoteCCRange< MIDIInputElementCC, RangeLen, 1, NoteCCLEDPWM< 1 > >, NoteCCRange< MIDIInputElementCC, RangeLen, 1, NoteCCLEDPWM< RangeLen > >, NoteCCRange< MIDIInputElementCC, RangeLen, 1, NoteCCFastLEDCallback< ColorMapper > >, NoteCCRange< MIDIInputElementCC, RangeLen, NumBanks, NoteCCLED< RangeLen > >, NoteCCRange< MIDIInputElementNote, RangeLen, 1, NoteCCLED< 1 > >, GenericProgramChangeSelector< N, Callback >, GenericProgramChangeSelector< N >, and GenericProgramChangeSelector< N, SelectorLEDsCallback< N > >.

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

Definition at line 64 of file MIDIInputElement.hpp.

Member Data Documentation

◆ text

char text[LENGTH]
privateinherited

Definition at line 127 of file SevenSegmentDisplay.hpp.

◆ elements

DoublyLinkedList< MIDIInputElementCC > elements
staticprivateinherited

Definition at line 97 of file MIDIInputElementCC.hpp.

◆ address

const MIDICNChannelAddress address
protectedinherited

Definition at line 80 of file MIDIInputElement.hpp.

◆ next

MIDIInputElementCC * next
protectedinherited

Definition at line 305 of file LinkedList.hpp.

◆ previous

MIDIInputElementCC * previous
protectedinherited

Definition at line 306 of file LinkedList.hpp.


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