Control Surface  1.2.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
VPotRing_Base< NumValues, Callback > Class Template Reference

#include <MIDI_Inputs/MCU/VPotRing.hpp>

+ Inheritance diagram for VPotRing_Base< NumValues, Callback >:
+ Collaboration diagram for 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 MIDIChannelCN &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 MIDIAddress address
 
MIDIInputElementCCnext
 
MIDIInputElementCCprevious
 

Private Member Functions

bool updateImpl (const ChannelMessageMatcher &midimsg, const MIDIAddress &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 MIDIAddress &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 MIDIAddress getTarget (const ChannelMessageMatcher &midimsg) const
 Extract the target address from a MIDI message. More...
 
virtual bool match (const MIDIAddress &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()

VPotRing_Base ( uint8_t  track,
const MIDIChannelCN channelCN,
const Callback &  callback 
)
inlineprotected

Definition at line 85 of file VPotRing.hpp.

Member Function Documentation

◆ begin()

void begin ( )
inlineoverridevirtual

Initialize.

Reimplemented from MIDIInputElement.

Definition at line 92 of file VPotRing.hpp.

◆ reset()

void reset ( )
inlineoverridevirtual

Reset all values to zero.

Reimplemented from MIDIInputElement.

Definition at line 95 of file VPotRing.hpp.

◆ sanitizeValue()

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

bool updateImpl ( const ChannelMessageMatcher midimsg,
const MIDIAddress target 
)
inlineoverrideprivatevirtual

Update the internal state with the new MIDI message.

Implements MIDIInputElement.

Definition at line 110 of file VPotRing.hpp.

◆ getValue()

uint8_t getValue ( ) const
inlineoverrideprivatevirtual

Implements IVPotRing.

Definition at line 120 of file VPotRing.hpp.

◆ getSelection()

virtual uint8_t getSelection ( ) const
inlineprivatevirtual

Get the active bank selection.

Reimplemented in GenericVPotRing< NumBanks >, and GenericVPotRing< NumBanks, VPotRingLEDsCallback >.

Definition at line 123 of file VPotRing.hpp.

◆ getBankIndex()

virtual setting_t getBankIndex ( const MIDIAddress target) const
inlineprivatevirtual

Get the bank index from a MIDI address.

Reimplemented in GenericVPotRing< NumBanks, Callback >, GenericVPotRing< NumBanks >, and GenericVPotRing< NumBanks, VPotRingLEDsCallback >.

Definition at line 126 of file VPotRing.hpp.

◆ beginAll()

static void beginAll ( )
inlinestaticinherited

Initialize all MIDIInputElementCC elements.

See also
MIDIInputElementCC::begin

Definition at line 52 of file MIDIInputElementCC.hpp.

◆ updateAll()

static void updateAll ( )
inlinestaticinherited

Update all MIDIInputElementCC elements.

See also
MIDIInputElementCC::update

Definition at line 60 of file MIDIInputElementCC.hpp.

◆ resetAll()

static void resetAll ( )
inlinestaticinherited

Reset all MIDIInputElementCC elements to their initial state.

See also
MIDIInputElementCC::reset

Definition at line 68 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 76 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 94 of file MIDIInputElementCC.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 MIDIAddress 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 MIDIInputElementPC, MIDIInputElementChannelPressure, VU_Base< NumValues, Callback >, VU_Base< NumBanks, VULEDsCallback< NumLEDs > >, VU_Base< NumBanks, VUEmptyCallback >, VU_Base< 1, VUEmptyCallback >, and VU_Base< 1, VULEDsCallback< NumLEDs > >.

Definition at line 63 of file MIDIInputElement.hpp.

◆ match()

virtual bool match ( const MIDIAddress 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 GenericNoteCCRange< MIDIInputElementCC, RangeLen, BankSize, NoteCCFastLEDCallback< DefaultColorMapper > >, GenericNoteCCRange< MIDIInputElementNote, 1, BankSize, NoteCCLEDPWM< 1 > >, GenericNoteCCRange< MIDIInputElementNote, 1, BankSize, NoteCCFastLEDCallback< DefaultColorMapper > >, GenericNoteCCRange< MIDIInputElementNote, RangeLen, BankSize, NoteCCFastLEDCallback< DefaultColorMapper > >, GenericNoteCCRange< MIDIInputElementCC, 1, BankSize, NoteCCLED< 1 > >, GenericNoteCCRange< MIDIInputElementCC, 1, BankSize, NoteCCFastLEDCallback< DefaultColorMapper > >, GenericNoteCCRange< MIDIInputElementCC, RangeLen, BankSize, NoteCCLEDPWM< RangeLen > >, GenericNoteCCRange< MIDIInputElementNote, RangeLen, BankSize, NoteCCLED< RangeLen > >, GenericNoteCCRange< MIDIInputElementNote, 1, BankSize, NoteCCLEDBarCallback< NumLEDs > >, GenericNoteCCRange< MIDIInputElementCC, 1, BankSize, NoteCCLEDPWM< 1 > >, GenericNoteCCRange< MIDIInputElementNote, RangeLen, BankSize, NoteCCLEDPWM< RangeLen > >, GenericNoteCCRange< MIDIInputElementNote, 1, BankSize, NoteCCLED< 1 > >, GenericNoteCCRange< MIDIInputElementCC, 1, BankSize, NoteCCLEDBarCallback< NumLEDs > >, GenericNoteCCRange< MIDIInputElementCC, RangeLen, BankSize, NoteCCLED< RangeLen > >, GenericNoteCCRange< MIDIInputElementCC, 1, NoteCCLED< 1 > >, GenericNoteCCRange< MIDIInputElementNote, RangeLen, NoteCCFastLEDCallback< DefaultColorMapper > >, GenericNoteCCRange< MIDIInputElementNote, 1, NoteCCLED< 1 > >, GenericNoteCCRange< MIDIInputElementNote, RangeLen, NoteCCLED< RangeLen > >, GenericNoteCCRange< MIDIInputElementCC, 1, NoteCCFastLEDCallback< DefaultColorMapper > >, GenericNoteCCRange< MIDIInputElementNote, 1, NoteCCLEDPWM< 1 > >, GenericNoteCCRange< MIDIInputElementCC, 1, NoteCCLEDPWM< 1 > >, GenericNoteCCRange< MIDIInputElementCC, RangeLen, NoteCCLED< RangeLen > >, GenericNoteCCRange< MIDIInputElementNote, 1, NoteCCFastLEDCallback< DefaultColorMapper > >, GenericNoteCCRange< MIDIInputElementCC, 1, NoteCCLEDBarCallback< NumLEDs > >, GenericNoteCCRange< MIDIInputElementNote, RangeLen, NoteCCLEDPWM< RangeLen > >, GenericNoteCCRange< MIDIInputElementNote, 1, NoteCCLEDBarCallback< NumLEDs > >, GenericNoteCCRange< MIDIInputElementCC, RangeLen, NoteCCLEDPWM< RangeLen > >, GenericNoteCCRange< MIDIInputElementCC, RangeLen, NoteCCFastLEDCallback< DefaultColorMapper > >, GenericVU< NumBanks, Callback >, GenericVU< NumBanks >, GenericVU< NumBanks, VULEDsCallback< NumLEDs > >, GenericVPotRing< NumBanks, Callback >, GenericVPotRing< NumBanks >, GenericVPotRing< NumBanks, VPotRingLEDsCallback >, SevenSegmentDisplay< LENGTH >, SevenSegmentDisplay< AssignmentDisplayLength >, and SevenSegmentDisplay< TimeDisplayLength >.

Definition at line 78 of file MIDIInputElement.hpp.

◆ getPosition() [1/2]

uint8_t 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 getPosition ( uint8_t  value)
inlinestaticprivateinherited

Extract the position from the raw value.

Definition at line 72 of file VPotRing.hpp.

◆ getCenterLed() [1/2]

bool 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 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 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 getMode ( uint8_t  value)
inlinestaticprivateinherited

Extract the mode from the raw value.

Definition at line 79 of file VPotRing.hpp.

◆ getStartOn()

uint8_t getStartOn ( ) const
inlineinherited

Get the first segment that should be on.

Definition at line 40 of file VPotRing.hpp.

◆ getStartOff()

uint8_t getStartOff ( ) const
inlineinherited

Get the first segment that should be off.

Definition at line 56 of file VPotRing.hpp.

Member Data Documentation

◆ values

Array<uint8_t, NumValues> values = {{}}
private

Definition at line 131 of file VPotRing.hpp.

◆ callback

Callback callback

Definition at line 134 of file VPotRing.hpp.

◆ elements

DoublyLinkedList< MIDIInputElementCC > elements
staticprivateinherited

Definition at line 99 of file MIDIInputElementCC.hpp.

◆ address

const MIDIAddress address
protectedinherited

Definition at line 83 of file MIDIInputElement.hpp.

◆ next

MIDIInputElementCC * next
protectedinherited

Definition at line 323 of file LinkedList.hpp.

◆ previous

MIDIInputElementCC * previous
protectedinherited

Definition at line 324 of file LinkedList.hpp.


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