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 | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
MIDIInputElement Class Referenceabstract

A class for objects that listen for incoming MIDI events. More...

#include <MIDIInputElement.hpp>

Inheritance diagram for MIDIInputElement:
Collaboration diagram for MIDIInputElement:

Public Member Functions

virtual ~MIDIInputElement ()=default
 
virtual void begin ()
 Initialize the input element. More...
 
virtual void reset ()
 Reset the input element to its initial state. 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...
 

Protected Member Functions

 MIDIInputElement ()
 
 MIDIInputElement (const MIDICNChannelAddress &address)
 Create a new MIDIInputElement that listens on the given address. More...
 

Protected Attributes

const MIDICNChannelAddress address
 

Private Member Functions

virtual bool updateImpl (const ChannelMessageMatcher &midimsg, const MIDICNChannelAddress &target)=0
 Update the internal state with the new MIDI message. More...
 
virtual MIDICNChannelAddress getTarget (const ChannelMessageMatcher &midimsg) const
 Extract the target address from a MIDI message. More...
 
virtual bool match (const MIDICNChannelAddress &target) const
 Check if the address of the incoming MIDI message matches an address of this element. More...
 

Detailed Description

A class for objects that listen for incoming MIDI events.

They can either update some kind of display, or they can just save the state.

Definition at line 15 of file MIDIInputElement.hpp.

Constructor & Destructor Documentation

◆ MIDIInputElement() [1/2]

MIDIInputElement::MIDIInputElement ( )
inlineprotected

Definition at line 17 of file MIDIInputElement.hpp.

◆ MIDIInputElement() [2/2]

MIDIInputElement::MIDIInputElement ( const MIDICNChannelAddress address)
inlineprotected

Create a new MIDIInputElement that listens on the given address.

Parameters
addressThe MIDI address to listen to.

Definition at line 24 of file MIDIInputElement.hpp.

◆ ~MIDIInputElement()

virtual MIDIInputElement::~MIDIInputElement ( )
virtualdefault

Member Function Documentation

◆ begin()

virtual void MIDIInputElement::begin ( )
inlinevirtual

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.

◆ reset()

virtual void MIDIInputElement::reset ( )
inlinevirtual

Reset the input element to its initial state.

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 > >, MCU::SevenSegmentDisplay< LENGTH >, MCU::SevenSegmentDisplay< AssignmentDisplayLength >, MCU::SevenSegmentDisplay< TimeDisplayLength >, GenericProgramChangeSelector< N, Callback >, GenericProgramChangeSelector< N >, and GenericProgramChangeSelector< N, SelectorLEDsCallback< N > >.

Definition at line 33 of file MIDIInputElement.hpp.

◆ update()

virtual void MIDIInputElement::update ( )
inlinevirtual

◆ updateWith()

bool MIDIInputElement::updateWith ( const ChannelMessageMatcher midimsg)
inline

Receive a new MIDI message and update the internal state.

Definition at line 39 of file MIDIInputElement.hpp.

◆ updateImpl()

virtual bool MIDIInputElement::updateImpl ( const ChannelMessageMatcher midimsg,
const MIDICNChannelAddress target 
)
privatepure virtual

Update the internal state with the new MIDI message.

Implemented in MCU::VPotRing_Base< NumValues, Callback >, MCU::VU_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< 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 > >, MCU::SevenSegmentDisplay< LENGTH >, MCU::SevenSegmentDisplay< AssignmentDisplayLength >, MCU::SevenSegmentDisplay< TimeDisplayLength >, GenericProgramChangeSelector< N, Callback >, GenericProgramChangeSelector< N >, and GenericProgramChangeSelector< N, SelectorLEDsCallback< N > >.

◆ getTarget()

virtual MIDICNChannelAddress MIDIInputElement::getTarget ( const ChannelMessageMatcher midimsg) const
inlineprivatevirtual

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.

◆ match()

virtual bool MIDIInputElement::match ( const MIDICNChannelAddress target) const
inlineprivatevirtual

Check if the address of the incoming MIDI message matches an address of this element.

Note
This base version of the function is only valid for non-Bankable MIDI input elements, it only matches if the address is equal to the address of this element.

Reimplemented in MCU::Bankable::GenericVU< NumBanks, Callback >, MCU::Bankable::GenericVU< NumBanks >, MCU::Bankable::GenericVU< NumBanks, VULEDsCallback< NumLEDs > >, MCU::Bankable::GenericVPotRing< NumBanks, Callback >, MCU::Bankable::GenericVPotRing< NumBanks >, MCU::Bankable::GenericVPotRing< NumBanks, VPotRingLEDsCallback >, Bankable::GenericNoteCCRange< MIDIInputElementNote, 1, BankSize, NoteCCFastLED< ColorMapper > >, Bankable::GenericNoteCCRange< MIDIInputElementCC, 1, NumBanks >, Bankable::GenericNoteCCRange< MIDIInputElementNote, RangeLen, BankSize, NoteCCFastLED< ColorMapper > >, Bankable::GenericNoteCCRange< MIDIInputElementCC, RangeLen, BankSize, NoteCCFastLED< ColorMapper > >, Bankable::GenericNoteCCRange< MIDIInputElementCC, 1, BankSize, NoteCCLED< 1 > >, Bankable::GenericNoteCCRange< MIDIInputElementNote, RangeLen, BankSize, NoteCCLED< RangeLen > >, Bankable::GenericNoteCCRange< MIDIInputElementNote, RangeLen, NumBanks >, Bankable::GenericNoteCCRange< MIDIInputElementNote, 1, NumBanks >, Bankable::GenericNoteCCRange< MIDIInputElementNote, 1, BankSize, NoteCCLEDBarCallback< NumLEDs > >, Bankable::GenericNoteCCRange< MIDIInputElementNote, 1, BankSize, NoteCCLED< 1 > >, Bankable::GenericNoteCCRange< MIDIInputElementCC, 1, BankSize, NoteCCFastLED< ColorMapper > >, Bankable::GenericNoteCCRange< MIDIInputElementCC, 1, BankSize, NoteCCLEDBarCallback< NumLEDs > >, Bankable::GenericNoteCCRange< MIDIInputElementCC, RangeLen, BankSize, NoteCCLED< RangeLen > >, Bankable::GenericNoteCCRange< MIDIInputElementCC, RangeLen, NumBanks >, GenericNoteCCRange< MIDIInputElementCC, RangeLen, NoteCCFastLED< ColorMapper > >, GenericNoteCCRange< MIDIInputElementCC, 1, NoteCCLED< 1 > >, GenericNoteCCRange< MIDIInputElementNote, RangeLen >, GenericNoteCCRange< MIDIInputElementNote, 1, NoteCCLED< 1 > >, GenericNoteCCRange< MIDIInputElementNote, 1, NoteCCFastLED< ColorMapper > >, GenericNoteCCRange< MIDIInputElementNote, RangeLen, NoteCCLED< RangeLen > >, GenericNoteCCRange< MIDIInputElementNote, RangeLen, NoteCCFastLED< ColorMapper > >, GenericNoteCCRange< MIDIInputElementCC, 1 >, GenericNoteCCRange< MIDIInputElementCC, 1, NoteCCLEDBarCallback< NumLEDs > >, GenericNoteCCRange< MIDIInputElementCC, RangeLen, NoteCCLED< RangeLen > >, GenericNoteCCRange< MIDIInputElementNote, 1, NoteCCLEDBarCallback< NumLEDs > >, GenericNoteCCRange< MIDIInputElementNote, 1 >, GenericNoteCCRange< MIDIInputElementCC, RangeLen >, GenericNoteCCRange< MIDIInputElementCC, 1, NoteCCFastLED< ColorMapper > >, MCU::SevenSegmentDisplay< LENGTH >, MCU::SevenSegmentDisplay< AssignmentDisplayLength >, and MCU::SevenSegmentDisplay< TimeDisplayLength >.

Definition at line 75 of file MIDIInputElement.hpp.

Member Data Documentation

◆ address

const MIDICNChannelAddress MIDIInputElement::address
protected

Definition at line 80 of file MIDIInputElement.hpp.


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