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 | Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
MCU::VPotRing_Base< NumValues, Callback > Class Template Reference

#include <VPotRing.hpp>

Inheritance diagram for MCU::VPotRing_Base< NumValues, Callback >:
Collaboration diagram for MCU::VPotRing_Base< NumValues, Callback >:

Public Member Functions

void begin () override
 Initialize. More...
 
void reset () override
 Reset all values to zero. 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...
 
uint8_t getPosition () const
 Return the position of the V-Pot ring. [0, 11]. More...
 
bool getCenterLed () const
 Return the status of the center LED of the V-Pot ring. More...
 
uint8_t getMode () const
 Return the mode of the V-Pot ring: 0 = single dot, 1 = boost/cut, 2 = wrap, 3 = spread. More...
 
uint8_t getStartOn () const
 Get the first segment that should be on. More...
 
uint8_t getStartOff () const
 Get the first segment that should be off. 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...
 

Public Attributes

Callback callback
 

Protected Member Functions

 VPotRing_Base (uint8_t track, const MIDICNChannel &channelCN, const Callback &callback)
 

Static Protected Member Functions

static uint8_t sanitizeValue (uint8_t value)
 Make sure that the received value is valid and will not result in array out of bounds conditions. More...
 

Protected Attributes

const MIDICNChannelAddress address
 
MIDIInputElementCCnext
 
MIDIInputElementCCprevious
 

Private Member Functions

bool updateImpl (const ChannelMessageMatcher &midimsg, const MIDICNChannelAddress &target) override
 Update the internal state with the new MIDI message. More...
 
uint8_t getValue () const override
 
virtual uint8_t getSelection () const
 Get the active bank selection. More...
 
virtual setting_t getBankIndex (const MIDICNChannelAddress &target) const
 Get the bank index from a MIDI address. More...
 
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...
 
virtual bool match (const MIDICNChannelAddress &target) const
 Check if the address of the incoming MIDI message matches an address of this element. More...
 

Static Private Member Functions

static uint8_t getPosition (uint8_t value)
 Extract the position from the raw value. More...
 
static bool getCenterLed (uint8_t value)
 Extract the center LED state from the raw value. More...
 
static uint8_t getMode (uint8_t value)
 Extract the mode from the raw value. More...
 

Private Attributes

Array< uint8_t, NumValues > values = {}
 

Static Private Attributes

static DoublyLinkedList< MIDIInputElementCCelements
 

Detailed Description

template<uint8_t NumValues, class Callback>
class MCU::VPotRing_Base< NumValues, Callback >

Definition at line 83 of file VPotRing.hpp.

Constructor & Destructor Documentation

◆ VPotRing_Base()

template<uint8_t NumValues, class Callback>
MCU::VPotRing_Base< NumValues, Callback >::VPotRing_Base ( uint8_t  track,
const MIDICNChannel channelCN,
const Callback &  callback 
)
inlineprotected

Definition at line 85 of file VPotRing.hpp.

Member Function Documentation

◆ begin()

template<uint8_t NumValues, class Callback>
void MCU::VPotRing_Base< NumValues, Callback >::begin ( )
inlineoverridevirtual

Initialize.

Reimplemented from MIDIInputElement.

Definition at line 92 of file VPotRing.hpp.

◆ reset()

template<uint8_t NumValues, class Callback>
void MCU::VPotRing_Base< NumValues, Callback >::reset ( )
inlineoverridevirtual

Reset all values to zero.

Reimplemented from MIDIInputElement.

Definition at line 95 of file VPotRing.hpp.

◆ sanitizeValue()

template<uint8_t NumValues, class Callback>
static uint8_t MCU::VPotRing_Base< NumValues, Callback >::sanitizeValue ( uint8_t  value)
inlinestaticprotected

Make sure that the received value is valid and will not result in array out of bounds conditions.

Definition at line 105 of file VPotRing.hpp.

◆ updateImpl()

template<uint8_t NumValues, class Callback>
bool MCU::VPotRing_Base< NumValues, Callback >::updateImpl ( const ChannelMessageMatcher midimsg,
const MIDICNChannelAddress target 
)
inlineoverrideprivatevirtual

Update the internal state with the new MIDI message.

Implements MIDIInputElement.

Definition at line 110 of file VPotRing.hpp.

◆ getValue()

template<uint8_t NumValues, class Callback>
uint8_t MCU::VPotRing_Base< NumValues, Callback >::getValue ( ) const
inlineoverrideprivatevirtual

Implements MCU::IVPotRing.

Definition at line 118 of file VPotRing.hpp.

◆ getSelection()

template<uint8_t NumValues, class Callback>
virtual uint8_t MCU::VPotRing_Base< NumValues, Callback >::getSelection ( ) const
inlineprivatevirtual

◆ getBankIndex()

template<uint8_t NumValues, class Callback>
virtual setting_t MCU::VPotRing_Base< NumValues, Callback >::getBankIndex ( const MIDICNChannelAddress target) const
inlineprivatevirtual

◆ 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.

◆ match()

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

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.

◆ getPosition() [1/2]

uint8_t MCU::IVPotRing::getPosition ( ) const
inlineinherited

Return the position of the V-Pot ring. [0, 11].

Definition at line 32 of file VPotRing.hpp.

◆ getPosition() [2/2]

static uint8_t MCU::IVPotRing::getPosition ( uint8_t  value)
inlinestaticprivateinherited

Extract the position from the raw value.

Definition at line 72 of file VPotRing.hpp.

◆ getCenterLed() [1/2]

bool MCU::IVPotRing::getCenterLed ( ) const
inlineinherited

Return the status of the center LED of the V-Pot ring.

Definition at line 34 of file VPotRing.hpp.

◆ getCenterLed() [2/2]

static bool MCU::IVPotRing::getCenterLed ( uint8_t  value)
inlinestaticprivateinherited

Extract the center LED state from the raw value.

Definition at line 77 of file VPotRing.hpp.

◆ getMode() [1/2]

uint8_t MCU::IVPotRing::getMode ( ) const
inlineinherited

Return the mode of the V-Pot ring: 0 = single dot, 1 = boost/cut, 2 = wrap, 3 = spread.

Definition at line 37 of file VPotRing.hpp.

◆ getMode() [2/2]

static uint8_t MCU::IVPotRing::getMode ( uint8_t  value)
inlinestaticprivateinherited

Extract the mode from the raw value.

Definition at line 79 of file VPotRing.hpp.

◆ getStartOn()

uint8_t MCU::IVPotRing::getStartOn ( ) const
inlineinherited

Get the first segment that should be on.

Definition at line 40 of file VPotRing.hpp.

◆ getStartOff()

uint8_t MCU::IVPotRing::getStartOff ( ) const
inlineinherited

Get the first segment that should be off.

Definition at line 56 of file VPotRing.hpp.

Member Data Documentation

◆ values

template<uint8_t NumValues, class Callback>
Array<uint8_t, NumValues> MCU::VPotRing_Base< NumValues, Callback >::values = {}
private

Definition at line 129 of file VPotRing.hpp.

◆ callback

template<uint8_t NumValues, class Callback>
Callback MCU::VPotRing_Base< NumValues, Callback >::callback

Definition at line 132 of file VPotRing.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: