A class of MIDIOutputElements that read the input from a matrix of momentary push buttons or switches, and send out MIDI Control Change events. More...
#include <MIDI_Outputs/Bankable/CCButtonMatrix.hpp>
 Inheritance diagram for CCButtonMatrix< nb_rows, nb_cols >:
 Collaboration diagram for CCButtonMatrix< nb_rows, nb_cols >:Public Types | |
| using | Mutex = typename std::conditional< ThreadSafe, DefaultMutEx, EmptyMutex >::type | 
| using | LockGuard = typename std::conditional< ThreadSafe, DefaultLockGuard< Mutex >, EmptyLockGuard< Mutex > >::type | 
Public Member Functions | |
| CCButtonMatrix (OutputBankConfig<> config, const PinList< nb_rows > &rowPins, const PinList< nb_cols > &colPins, const AddressMatrix< nb_rows, nb_cols > &controllers, MIDIChannelCN channelCN, const DigitalCCSender &sender={}) | |
| Create a new Bankable CCButtonMatrix object with the given pins, controller numbers and channel.  More... | |
| void | begin () override | 
| Initialize this updatable.  More... | |
| void | update () override | 
| Update this updatable.  More... | |
| bool | getPrevState (uint8_t col, uint8_t row) | 
| Get the state of the button in the given column and row.  More... | |
Static Public Member Functions | |
| static Mutex & | getMutex () | 
Public Attributes | |
| DigitalCCSender | sender | 
Protected Attributes | |
| Updatable< NormalUpdatable, false > * | next | 
| Updatable< NormalUpdatable, false > * | previous | 
Static Protected Attributes | |
| static DoublyLinkedList< Updatable< NormalUpdatable, false > > | updatables | 
| static Mutex | mutex | 
Private Member Functions | |
| void | onButtonChanged (uint8_t row, uint8_t col, bool state) final override | 
| The callback function that is called whenever a button changes state.  More... | |
| void | setPrevState (uint8_t col, uint8_t row, bool state) | 
Static Private Member Functions | |
| static uint8_t | positionToBits (uint8_t col, uint8_t row) | 
| static uint8_t | bitsToIndex (uint8_t bits) | 
| static uint8_t | bitsToBitmask (uint8_t bits) | 
Private Attributes | |
| MatrixAddress< nb_rows, nb_cols > | address | 
| uint16_t | activeButtons | 
| unsigned long | prevRefresh = 0 | 
| uint8_t | prevStates [(nb_cols *nb_rows+7)/8] | 
| const PinList< nb_rows > | rowPins | 
| const PinList< nb_cols > | colPins | 
Main initialization and updating methods | |
| static void | applyToAll (const LockGuard &, void(Derived::*method)(Args &&...), Args &&... args) | 
| static void | applyToAll (void(Derived::*method)(Args &&...), Args &&... args) | 
Enabling and disabling updatables | |
| void | enable (const LockGuard &lock) | 
| Enable this updatable: insert it into the linked list of instances, so it gets updated automatically.  More... | |
| void | enable () | 
| Enable this updatable: insert it into the linked list of instances, so it gets updated automatically.  More... | |
| void | disable (const LockGuard &lock) | 
| Disable this updatable: remove it from the linked list of instances, so it no longer gets updated automatically.  More... | |
| void | disable () | 
| Disable this updatable: remove it from the linked list of instances, so it no longer gets updated automatically.  More... | |
| bool | isEnabled (const LockGuard &) const | 
| Check if this updatable is enabled.  More... | |
| bool | isEnabled () | 
| Check if this updatable is enabled.  More... | |
| void | moveDown (const LockGuard &) | 
| Move down this element in the list.  More... | |
| void | moveDown () | 
| Move down this element in the list.  More... | |
| static void | enable (UpdatableCRTP *element) | 
| Enable this updatable: insert it into the linked list of instances, so it gets updated automatically.  More... | |
| static void | enable (UpdatableCRTP &element) | 
| Enable this updatable: insert it into the linked list of instances, so it gets updated automatically.  More... | |
| static void | enable (U(&array)[N]) | 
| Enable this updatable: insert it into the linked list of instances, so it gets updated automatically.  More... | |
| static void | disable (UpdatableCRTP *element) | 
| Disable this updatable: remove it from the linked list of instances, so it no longer gets updated automatically.  More... | |
| static void | disable (UpdatableCRTP &element) | 
| Disable this updatable: remove it from the linked list of instances, so it no longer gets updated automatically.  More... | |
| static void | disable (U(&array)[N]) | 
| Disable this updatable: remove it from the linked list of instances, so it no longer gets updated automatically.  More... | |
Main initialization and updating methods | |
| static void | beginAll () | 
| Begin all enabled instances of this class.  More... | |
| static void | updateAll () | 
| Update all enabled instances of this class.  More... | |
A class of MIDIOutputElements that read the input from a matrix of momentary push buttons or switches, and send out MIDI Control Change events.
A value of 0x7F is sent when a button is pressed, and a value of 0x00 is sent when a button is released. 
 Crude software debouncing is implemented by limiting the refresh rate. 
 This version can be banked.
| nb_rows | The number of rows of the matrix. | 
| nb_cols | The number of columns of the matrix. | 
Definition at line 29 of file Bankable/CCButtonMatrix.hpp.
      
  | 
  inherited | 
Definition at line 36 of file Updatable.hpp.
      
  | 
  inherited | 
Definition at line 38 of file Updatable.hpp.
      
  | 
  inline | 
Create a new Bankable CCButtonMatrix object with the given pins, controller numbers and channel.
| config | The bank configuration to use: the bank to add this element to, and whether to change the address, channel or cable number. | 
| rowPins | A list of pin numbers connected to the rows of the button matrix.  ⚠ These pins will be driven LOW as outputs (Lo-Z).  | 
| colPins | A list of pin numbers connected to the columns of the button matrix.  These pins will be used as inputs (Hi-Z), and the internal pull-up resistor will be enabled.  | 
| controllers | A 2-dimensional array of the same dimensions as the button matrix that contains the MIDI Controller number of each button. [0, 119] | 
| channelCN | The MIDI channel [CHANNEL_1, CHANNEL_16] and Cable Number [CABLE_1, CABLE_16]. | 
| sender | The MIDI sender to use. | 
Definition at line 59 of file Bankable/CCButtonMatrix.hpp.
      
  | 
  inlineoverridevirtualinherited | 
Initialize this updatable.
Implements Updatable<>.
Definition at line 57 of file Bankable/Abstract/MIDIButtonMatrix.hpp.
      
  | 
  inlineoverridevirtualinherited | 
Update this updatable.
Implements Updatable<>.
Definition at line 59 of file Bankable/Abstract/MIDIButtonMatrix.hpp.
      
  | 
  inlinefinaloverrideprivatevirtualinherited | 
The callback function that is called whenever a button changes state.
| row | The row of the button that changed state. | 
| col | The column of the button that changed state. | 
| state | The new state of the button. | 
Implements ButtonMatrix< nb_rows, nb_cols >.
Definition at line 62 of file Bankable/Abstract/MIDIButtonMatrix.hpp.
      
  | 
  inlinestaticinherited | 
Begin all enabled instances of this class.
Definition at line 208 of file Updatable.hpp.
      
  | 
  inlinestaticinherited | 
Update all enabled instances of this class.
Definition at line 212 of file Updatable.hpp.
      
  | 
  inlinestaticinherited | 
Definition at line 79 of file Updatable.hpp.
      
  | 
  inlinestaticinherited | 
Definition at line 85 of file Updatable.hpp.
      
  | 
  inlinestaticinherited | 
Definition at line 93 of file Updatable.hpp.
      
  | 
  inlineinherited | 
Enable this updatable: insert it into the linked list of instances, so it gets updated automatically.
Definition at line 106 of file Updatable.hpp.
      
  | 
  inlineinherited | 
Enable this updatable: insert it into the linked list of instances, so it gets updated automatically.
Definition at line 115 of file Updatable.hpp.
      
  | 
  inlinestaticinherited | 
Enable this updatable: insert it into the linked list of instances, so it gets updated automatically.
Definition at line 144 of file Updatable.hpp.
      
  | 
  inlinestaticinherited | 
Enable this updatable: insert it into the linked list of instances, so it gets updated automatically.
Definition at line 146 of file Updatable.hpp.
      
  | 
  inlinestaticinherited | 
Enable this updatable: insert it into the linked list of instances, so it gets updated automatically.
Definition at line 149 of file Updatable.hpp.
      
  | 
  inlineinherited | 
Disable this updatable: remove it from the linked list of instances, so it no longer gets updated automatically.
Definition at line 119 of file Updatable.hpp.
      
  | 
  inlineinherited | 
Disable this updatable: remove it from the linked list of instances, so it no longer gets updated automatically.
Definition at line 128 of file Updatable.hpp.
      
  | 
  inlinestaticinherited | 
Disable this updatable: remove it from the linked list of instances, so it no longer gets updated automatically.
Definition at line 155 of file Updatable.hpp.
      
  | 
  inlinestaticinherited | 
Disable this updatable: remove it from the linked list of instances, so it no longer gets updated automatically.
Definition at line 157 of file Updatable.hpp.
      
  | 
  inlinestaticinherited | 
Disable this updatable: remove it from the linked list of instances, so it no longer gets updated automatically.
Definition at line 160 of file Updatable.hpp.
      
  | 
  inlineinherited | 
Check if this updatable is enabled.
Definition at line 136 of file Updatable.hpp.
      
  | 
  inlineinherited | 
Check if this updatable is enabled.
Definition at line 141 of file Updatable.hpp.
      
  | 
  inlineinherited | 
Move down this element in the list.
Definition at line 166 of file Updatable.hpp.
      
  | 
  inlineinherited | 
Move down this element in the list.
Definition at line 168 of file Updatable.hpp.
      
  | 
  inherited | 
Get the state of the button in the given column and row.
Definition at line 69 of file ButtonMatrix.ipp.
      
  | 
  inlinestaticprivateinherited | 
Definition at line 52 of file ButtonMatrix.ipp.
      
  | 
  inlinestaticprivateinherited | 
Definition at line 59 of file ButtonMatrix.ipp.
      
  | 
  inlinestaticprivateinherited | 
Definition at line 64 of file ButtonMatrix.ipp.
      
  | 
  privateinherited | 
Definition at line 75 of file ButtonMatrix.ipp.
      
  | 
  privateinherited | 
Definition at line 76 of file Bankable/Abstract/MIDIButtonMatrix.hpp.
      
  | 
  privateinherited | 
Definition at line 77 of file Bankable/Abstract/MIDIButtonMatrix.hpp.
      
  | 
  inherited | 
Definition at line 80 of file Bankable/Abstract/MIDIButtonMatrix.hpp.
      
  | 
  staticprotectedinherited | 
Definition at line 173 of file Updatable.hpp.
      
  | 
  staticprotectedinherited | 
Definition at line 174 of file Updatable.hpp.
      
  | 
  protectedinherited | 
Definition at line 323 of file LinkedList.hpp.
      
  | 
  protectedinherited | 
Definition at line 324 of file LinkedList.hpp.
      
  | 
  privateinherited | 
Definition at line 82 of file ButtonMatrix.hpp.
      
  | 
  privateinherited | 
Definition at line 83 of file ButtonMatrix.hpp.
      
  | 
  privateinherited | 
Definition at line 85 of file ButtonMatrix.hpp.
      
  | 
  privateinherited | 
Definition at line 86 of file ButtonMatrix.hpp.