LCOV - code coverage report
Current view: top level - src/MIDI_Outputs/ManyAddresses - CCButton.hpp (source / functions) Hit Total Coverage
Test: 19d2efc7037c2e176feca44750a12594c76f466f Lines: 4 4 100.0 %
Date: 2019-11-24 14:50:27 Functions: 2 3 66.7 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : #pragma once
       2             : 
       3             : #include <Banks/BankAddresses.hpp>
       4             : #include <MIDI_Outputs/Bankable/Abstract/MIDIButton.hpp>
       5             : #include <MIDI_Senders/DigitalCCSender.hpp>
       6             : 
       7             : BEGIN_CS_NAMESPACE
       8             : namespace Bankable {
       9             : namespace ManyAddresses {
      10             : 
      11             : /**
      12             :  * @brief   A class of MIDIOutputElement%s that read the input of a **momentary
      13             :  *          push button or switch**, and send out MIDI **Control Change**
      14             :  *          events.
      15             :  * 
      16             :  * A value of 0x7F is sent when the button is pressed, and a value of
      17             :  * 0x00 is sent when the button is released.  
      18             :  * The button is debounced in software.  
      19             :  * This version can be banked using an arbitrary list of alternative
      20             :  * addresses.
      21             :  *          
      22             :  * @tparam  N
      23             :  *          The number of variants/alternative addresses the element has.
      24             :  *
      25             :  * @ingroup ManyAddressesMIDIOutputElements
      26             :  */
      27             : template <setting_t N>
      28           1 : class CCButton
      29             :     : public Bankable::MIDIButton<ManyAddresses<N>, DigitalCCSender> {
      30             :   public:
      31             :     /**
      32             :      * @brief   Create a new Bankable CCButton object with the given bank 
      33             :      *          configuration, button pin, and address.
      34             :      *
      35             :      * @param   bank
      36             :      *          The bank that selects the address to use.
      37             :      * @param   pin
      38             :      *          The digital input pin with the button connected.  
      39             :      *          The internal pull-up resistor will be enabled.
      40             :      * @param   addresses
      41             :      *          The list of MIDI addresses containing the controller number 
      42             :      *          [0, 119], channel [CHANNEL_1, CHANNEL_16], and optional cable 
      43             :      *          number [0, 15].
      44             :      * @param   sender
      45             :      *          The MIDI sender to use.
      46             :      * 
      47             :      * @ingroup MIDIOutputElementConstructors
      48             :      */
      49           1 :     CCButton(const Bank<N> &bank, pin_t pin,
      50             :              const Array<MIDICNChannelAddress, N> &addresses,
      51             :              const DigitalCCSender &sender = {})
      52           1 :         : MIDIButton<ManyAddresses<N>, DigitalCCSender>{
      53           2 :               {bank, addresses}, pin, sender} {}
      54             : };
      55             : 
      56             : } // namespace ManyAddresses
      57             : } // namespace Bankable
      58             : 
      59             : END_CS_NAMESPACE

Generated by: LCOV version 1.14-5-g4ff2ed6