LCOV - code coverage report
Current view: top level - src/MIDI_Outputs/Bankable - CCIncrementDecrementButtons.hpp (source / functions) Hit Total Coverage
Test: 169c36a3797bc662d84b5726f34a3f37d3c58247 Lines: 3 3 100.0 %
Date: 2024-11-09 15:32:27 Functions: 1 1 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : #pragma once
       2             : 
       3             : #include <Banks/BankAddresses.hpp>
       4             : #include <MIDI_Outputs/Bankable/Abstract/MIDIIncrementDecrementButtons.hpp>
       5             : #include <MIDI_Senders/RelativeCCSender.hpp>
       6             : 
       7             : BEGIN_CS_NAMESPACE
       8             : 
       9             : namespace Bankable {
      10             : 
      11             : /**
      12             :  * @brief   A class of MIDIOutputElement%s that read the input of **two
      13             :  *          momentary push buttons** to increment or decrement a **relative 
      14             :  *          setting** using relative MIDI **Control Change** events.  
      15             :  *          An optional note number can be provided to reset the setting.
      16             :  * 
      17             :  * This version can be banked.
      18             :  *
      19             :  * @ingroup BankableMIDIOutputElements
      20             :  */
      21             : class CCIncrementDecrementButtons
      22             :     : public MIDIIncrementDecrementButtons<DualAddresses, RelativeCCSender,
      23             :                                            DigitalNoteSender> {
      24             :   public:
      25             :     /**
      26             :      * @brief   Construct a new Bankable CCIncrementDecrementButtons object.
      27             :      * 
      28             :      * @param   config
      29             :      *          The bank configuration to use: the bank to add this element to,
      30             :      *          and whether to change the address, channel or cable number.
      31             :      * @param   buttons
      32             :      *          The pins with the increment and decrement buttons connected.  
      33             :      *          The internal pull-up resistors will be enabled.
      34             :      * @param   address
      35             :      *          The address to use for the relative events, containing the 
      36             :      *          controller number [0, 119], channel [Channel_1, Channel_16], and
      37             :      *          optional cable number [Cable_1, Cable_16].
      38             :      * @param   multiplier
      39             :      *          The multiplier for the relative events. When setting it to 2,
      40             :      *          it will scroll twice as fast, for example.
      41             :      * @param   resetNote
      42             :      *          The MIDI address to use to reset the setting, containing the 
      43             :      *          note number [0, 119], channel [Channel_1, Channel_16], and 
      44             :      *          optional cable number [Cable_1, Cable_16].
      45             :      *          It will be triggered when the increment and decrement buttons
      46             :      *          are pressed simultaneously.
      47             :      * @param   relativeSender
      48             :      *          The MIDI sender to use for the relative events.
      49             :      * @param   resetSender
      50             :      *          The MIDI sender to use for reset events.
      51             :      */
      52           1 :     CCIncrementDecrementButtons(OutputBankConfig<> config,
      53             :                                 AH::IncrementDecrementButtons buttons,
      54             :                                 MIDIAddress address, uint8_t multiplier = 1,
      55             :                                 MIDIAddress resetNote = MIDIAddress::invalid(),
      56             :                                 const RelativeCCSender &relativeSender = {},
      57             :                                 const DigitalNoteSender &resetSender = {})
      58           1 :         : MIDIIncrementDecrementButtons<DualAddresses, RelativeCCSender,
      59             :                                         DigitalNoteSender>(
      60             :               {config, {address, resetNote}}, buttons, multiplier,
      61           1 :               relativeSender, resetSender) {}
      62             : };
      63             : 
      64             : } // namespace Bankable
      65             : 
      66             : END_CS_NAMESPACE

Generated by: LCOV version 1.15