LCOV - code coverage report
Current view: top level - src/MIDI_Outputs/ManyAddresses - PCButton.hpp (source / functions) Hit Total Coverage
Test: 90a1b9beff85a60dc6ebcea034a947a845e56960 Lines: 7 7 100.0 %
Date: 2019-11-30 15:53:32 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/ProgramChangeSender.hpp>
       6             : 
       7             : BEGIN_CS_NAMESPACE
       8             : 
       9             : namespace Bankable {
      10             : namespace ManyAddresses {
      11             : 
      12             : /**
      13             :  * @brief   A class of MIDIOutputElement%s that read the input of a **momentary
      14             :  *          push button or switch**, and send out MIDI **Program Change** 
      15             :  *          events.
      16             :  * 
      17             :  * A Program Change event is sent when the button is pressed.  
      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 PCButton
      29             :     : public Bankable::MIDIButton<ManyAddresses<N>, ProgramChangeSender> {
      30             :   public:
      31             :     /**
      32             :      * @brief   Create a new PCButton object with the given pin, program number
      33             :      *          and channel.
      34             :      * 
      35             :      * @param   bank
      36             :      *          The bank that selects the address to use.
      37             :      * @param   pin
      38             :      *          The digital input pin to read from.  
      39             :      *          The internal pull-up resistor will be enabled.
      40             :      * @param   addresses
      41             :      *          The list of MIDI addresses containing the program number 
      42             :      *          [0, 127], channel [CHANNEL_1, CHANNEL_16], and optional cable 
      43             :      *          number [0, 15].
      44             :      * @param   sender
      45             :      *          The MIDI sender to use.
      46             :      */
      47           1 :     PCButton(const Bank<N> &bank, pin_t pin,
      48             :              const Array<MIDICNChannelAddress, N> &addresses,
      49             :              const ProgramChangeSender &sender = {})
      50           1 :         : MIDIButton<ManyAddresses<N>, ProgramChangeSender>{
      51           1 :               {bank, addresses},
      52           1 :               pin,
      53           1 :               sender,
      54           2 :           } {}
      55             : };
      56             : 
      57             : } // namespace ManyAddresses
      58             : } // namespace Bankable
      59             : 
      60             : END_CS_NAMESPACE

Generated by: LCOV version 1.14-5-g4ff2ed6