LCOV - code coverage report
Current view: top level - src/MIDI_Outputs/Bankable - CCButtonLatching.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/MIDIButtonLatching.hpp>
       5             : #include <MIDI_Senders/DigitalCCSender.hpp>
       6             : 
       7             : BEGIN_CS_NAMESPACE
       8             : 
       9             : namespace Bankable {
      10             : 
      11             : /**
      12             :  * @brief   A class of MIDIOutputElement%s that read the input of a **latching
      13             :  *          push button or toggle switch**, and send out MIDI **Control Change**
      14             :  *          events.
      15             :  * 
      16             :  * When the switch changes state, two MIDI events are sent: the first
      17             :  * one with a value of 0x7F, followed immediately by a second one with
      18             :  * a value of 0x00.  
      19             :  * The switch is debounced in software.  
      20             :  * This version can be banked.
      21             :  *
      22             :  * @ingroup BankableMIDIOutputElements
      23             :  */
      24           1 : class CCButtonLatching
      25             :     : public MIDIButtonLatching<SingleAddress, DigitalCCSender> {
      26             :   public:
      27             :     /**
      28             :      * @brief   Create a new Bankable CCButtonLatching object with the given
      29             :      *          pin, the given controller number and channel.
      30             :      *
      31             :      * @param   config
      32             :      *          The bank configuration to use: the bank to add this element to,
      33             :      *          and whether to change the address, channel or cable number.
      34             :      * @param   pin
      35             :      *          The digital input pin with the button connected.  
      36             :      *          The internal pull-up resistor will be enabled.
      37             :      * @param   address
      38             :      *          The MIDI address containing the controller number [0, 119], 
      39             :      *          channel [CHANNEL_1, CHANNEL_16], and optional cable number 
      40             :      *          [0, 15].
      41             :      * @param   sender
      42             :      *          The MIDI sender to use.
      43             :      */
      44           1 :     CCButtonLatching(const OutputBankConfig &config, pin_t pin,
      45             :                      const MIDICNChannelAddress &address,
      46             :                      const DigitalCCSender &sender = {})
      47           1 :         : MIDIButtonLatching<SingleAddress, DigitalCCSender>{
      48           2 :               {config, address}, pin, sender} {}
      49             : };
      50             : 
      51             : } // namespace Bankable
      52             : 
      53             : END_CS_NAMESPACE

Generated by: LCOV version 1.14-5-g4ff2ed6