Control Surface  1.1.0
MIDI Control Surface library for Arduino
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
CCLEDBar< NumLEDs > Class Template Reference

Class that listens for Control Change events and displays the velocity on an LED Bar Graph. More...

#include <NoteCCRangeLEDBar.hpp>

Inheritance diagram for CCLEDBar< NumLEDs >:
Collaboration diagram for CCLEDBar< NumLEDs >:

Public Member Functions

 CCLEDBar (const AH::DotBarDisplayLEDs< NumLEDs > &leds, MIDICNChannelAddress address)
 
void dotMode ()
 Set the mode to dot mode. More...
 
void barMode ()
 Set the mode to bar mode. More...
 
void setMode (AH::DotBarMode mode)
 Set the mode to either dot or bar mode. More...
 
uint8_t getValue (uint8_t index) const override
 
virtual uint8_t getValue (uint8_t index) const =0
 
uint8_t getValue () const
 
uint8_t getValue () const
 
void begin () override
 Initialize. More...
 
void reset () override
 Reset all values to zero. More...
 
uint8_t length () const
 
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

constexpr static uint8_t length ()
 
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...
 

Public Attributes

NoteCCLEDBarCallback< NumLEDs > callback
 

Protected Attributes

const MIDICNChannelAddress address
 
MIDIInputElementCCnext
 
MIDIInputElementCCprevious
 

Private Member Functions

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...
 
bool updateImpl (const ChannelMessageMatcher &midimsg, const MIDICNChannelAddress &target) override
 
virtual uint8_t getSelection () const
 Get the active bank selection. More...
 
virtual setting_t getBankIndex (MIDICNChannelAddress target) const
 Get the bank index from a MIDI address. More...
 
virtual uint8_t getRangeIndex (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...
 

Static Private Member Functions

static uint8_t getValueFromMIDIMessage (const ChannelMessageMatcher &midimsg)
 

Private Attributes

Array< Array< uint8_t, RangeLen >, NumBanks > values
 
uint8_t rangeLength
 

Static Private Attributes

static DoublyLinkedList< MIDIInputElementCCelements
 

Detailed Description

template<uint8_t NumLEDs>
class CCLEDBar< NumLEDs >

Class that listens for Control Change events and displays the velocity on an LED Bar Graph.

Template Parameters
NumLEDsThe number of LEDs the display has.

Definition at line 82 of file NoteCCRangeLEDBar.hpp.

Constructor & Destructor Documentation

◆ CCLEDBar()

template<uint8_t NumLEDs>
CCLEDBar< NumLEDs >::CCLEDBar ( const AH::DotBarDisplayLEDs< NumLEDs > &  leds,
MIDICNChannelAddress  address 
)
inline

Definition at line 85 of file NoteCCRangeLEDBar.hpp.

Member Function Documentation

◆ dotMode()

template<uint8_t NumLEDs>
void CCLEDBar< NumLEDs >::dotMode ( )
inline

Set the mode to dot mode.

Definition at line 94 of file NoteCCRangeLEDBar.hpp.

◆ barMode()

template<uint8_t NumLEDs>
void CCLEDBar< NumLEDs >::barMode ( )
inline

Set the mode to bar mode.

Definition at line 96 of file NoteCCRangeLEDBar.hpp.

◆ setMode()

template<uint8_t NumLEDs>
void CCLEDBar< NumLEDs >::setMode ( AH::DotBarMode  mode)
inline

Set the mode to either dot or bar mode.

Parameters
modeThe mode.

Definition at line 98 of file NoteCCRangeLEDBar.hpp.

◆ match()

bool GenericNoteCCRange< MIDIInputElementCC , RangeLen, NoteCCLEDBarCallback< NumLEDs > >::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 114 of file NoteCCRange.hpp.

◆ getValue() [1/4]

uint8_t NoteCCRange< MIDIInputElementCC , RangeLen, NumBanks, NoteCCLEDBarCallback< NumLEDs > >::getValue ( uint8_t  index) const
inlineoverridevirtualinherited
Todo:
check index bounds

Implements INoteCCValue.

Definition at line 51 of file NoteCCRange.hpp.

◆ getValue() [2/4]

virtual uint8_t INoteCCValue::getValue
inherited

◆ getValue() [3/4]

uint8_t INoteCCValue::getValue
inlineinherited

Definition at line 16 of file NoteCCRange.hpp.

◆ getValue() [4/4]

uint8_t INoteCCValue::getValue ( ) const
inlineinherited

Definition at line 16 of file NoteCCRange.hpp.

◆ begin()

void NoteCCRange< MIDIInputElementCC , RangeLen, NumBanks, NoteCCLEDBarCallback< NumLEDs > >::begin ( )
inlineoverridevirtualinherited

Initialize.

Reimplemented from MIDIInputElement.

Definition at line 57 of file NoteCCRange.hpp.

◆ reset()

void NoteCCRange< MIDIInputElementCC , RangeLen, NumBanks, NoteCCLEDBarCallback< NumLEDs > >::reset ( )
inlineoverridevirtualinherited

Reset all values to zero.

Reimplemented from MIDIInputElement.

Definition at line 59 of file NoteCCRange.hpp.

◆ updateImpl()

bool NoteCCRange< MIDIInputElementCC , RangeLen, NumBanks, NoteCCLEDBarCallback< NumLEDs > >::updateImpl ( const ChannelMessageMatcher midimsg,
const MIDICNChannelAddress target 
)
inlineoverrideprivatevirtualinherited

Implements MIDIInputElement.

Definition at line 65 of file NoteCCRange.hpp.

◆ getValueFromMIDIMessage()

static uint8_t NoteCCRange< MIDIInputElementCC , RangeLen, NumBanks, NoteCCLEDBarCallback< NumLEDs > >::getValueFromMIDIMessage ( const ChannelMessageMatcher midimsg)
inlinestaticprivateinherited

Definition at line 77 of file NoteCCRange.hpp.

◆ getSelection()

virtual uint8_t NoteCCRange< MIDIInputElementCC , RangeLen, NumBanks, NoteCCLEDBarCallback< NumLEDs > >::getSelection ( ) const
inlineprivatevirtualinherited

Get the active bank selection.

Definition at line 82 of file NoteCCRange.hpp.

◆ getBankIndex()

virtual setting_t NoteCCRange< MIDIInputElementCC , RangeLen, NumBanks, NoteCCLEDBarCallback< NumLEDs > >::getBankIndex ( MIDICNChannelAddress  target) const
inlineprivatevirtualinherited

Get the bank index from a MIDI address.

Definition at line 85 of file NoteCCRange.hpp.

◆ getRangeIndex()

virtual uint8_t NoteCCRange< MIDIInputElementCC , RangeLen, NumBanks, NoteCCLEDBarCallback< NumLEDs > >::getRangeIndex ( MIDICNChannelAddress  target) const
inlineprivatevirtualinherited

Definition at line 90 of file NoteCCRange.hpp.

◆ length() [1/2]

constexpr static uint8_t NoteCCRange< MIDIInputElementCC , RangeLen, NumBanks, NoteCCLEDBarCallback< NumLEDs > >::length ( )
inlinestaticconstexprinherited

Definition at line 98 of file NoteCCRange.hpp.

◆ length() [2/2]

uint8_t INoteCCValue::length ( ) const
inlineinherited

Definition at line 14 of file NoteCCRange.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.

◆ 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

◆ values

Array<Array<uint8_t, RangeLen>, NumBanks> NoteCCRange< MIDIInputElementCC , RangeLen, NumBanks, NoteCCLEDBarCallback< NumLEDs > >::values
privateinherited

Definition at line 94 of file NoteCCRange.hpp.

◆ callback

NoteCCLEDBarCallback< NumLEDs > NoteCCRange< MIDIInputElementCC , RangeLen, NumBanks, NoteCCLEDBarCallback< NumLEDs > >::callback
inherited

Definition at line 97 of file NoteCCRange.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 305 of file LinkedList.hpp.

◆ previous

MIDIInputElementCC * DoublyLinkable< MIDIInputElementCC >::previous
protectedinherited

Definition at line 306 of file LinkedList.hpp.

◆ rangeLength

uint8_t INoteCCValue::rangeLength
privateinherited

Definition at line 19 of file NoteCCRange.hpp.


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