Control Surface  1.1.1
MIDI Control Surface library for Arduino
Public Member Functions | Static Public Member Functions | Public Attributes | Static Protected Member Functions | Protected Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
GenericVPotRing< Callback > Class Template Reference

A class for MIDI input elements that represent Mackie Control Universal V-Pots. More...

#include <MIDI_Inputs/MCU/VPotRing.hpp>

Inheritance diagram for GenericVPotRing< Callback >:
Collaboration diagram for GenericVPotRing< Callback >:

Public Member Functions

 GenericVPotRing (uint8_t track, const MIDICNChannel &channelCN, const Callback &callback)
 
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
 

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<class Callback = VPotEmptyCallback>
class MCU::GenericVPotRing< Callback >

A class for MIDI input elements that represent Mackie Control Universal V-Pots.

This version is generic to allow for custom callbacks.
This version cannot be banked.

Definition at line 144 of file VPotRing.hpp.

Constructor & Destructor Documentation

◆ GenericVPotRing()

GenericVPotRing ( uint8_t  track,
const MIDICNChannel channelCN,
const Callback &  callback 
)
inline

Definition at line 146 of file VPotRing.hpp.

Member Function Documentation

◆ begin()

void begin ( )
inlineoverridevirtualinherited

Initialize.

Reimplemented from MIDIInputElement.

Definition at line 92 of file VPotRing.hpp.

◆ reset()

void reset ( )
inlineoverridevirtualinherited

Reset all values to zero.

Reimplemented from MIDIInputElement.

Definition at line 95 of file VPotRing.hpp.

◆ sanitizeValue()

static uint8_t sanitizeValue ( uint8_t  value)
inlinestaticprotectedinherited

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

Update the internal state with the new MIDI message.

Implements MIDIInputElement.

Definition at line 110 of file VPotRing.hpp.

◆ getValue()

uint8_t getValue ( ) const
inlineoverrideprivatevirtualinherited

Implements IVPotRing.

Definition at line 118 of file VPotRing.hpp.

◆ getSelection()

virtual uint8_t getSelection ( ) const
inlineprivatevirtualinherited

Get the active bank selection.

Definition at line 121 of file VPotRing.hpp.

◆ getBankIndex()

virtual setting_t getBankIndex ( const MIDICNChannelAddress target) const
inlineprivatevirtualinherited

Get the bank index from a MIDI address.

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

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

◆ match()

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

Definition at line 75 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
privateinherited

Definition at line 129 of file VPotRing.hpp.

◆ callback

Callback callback
inherited

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