LCOV - code coverage report
Current view: top level - src/MIDI_Outputs/ManyAddresses - PBPotentiometer.hpp (source / functions) Hit Total Coverage
Test: 19d2efc7037c2e176feca44750a12594c76f466f Lines: 7 7 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 <Helpers/ArrayHelpers.hpp>
       5             : #include <MIDI_Outputs/Bankable/Abstract/MIDIFilteredAnalog.hpp>
       6             : #include <MIDI_Senders/PitchBendSender.hpp>
       7             : 
       8             : BEGIN_CS_NAMESPACE
       9             : 
      10             : namespace Bankable {
      11             : namespace ManyAddresses {
      12             : 
      13             : /**
      14             :  * @brief   A class of MIDIOutputElement%s that read the analog input from a
      15             :  *          **potentiometer or fader**, and send out 14-bit MIDI **Pitch Bend** 
      16             :  *          events.
      17             :  * 
      18             :  * The analog input is filtered and hysteresis is applied for maximum
      19             :  * stability.  
      20             :  * The actual precision is "only" 10 bits, because this is the resolution of the
      21             :  * built-in ADC, and this is the default resolution used by the Mackie Control
      22             :  * Universal protocol.  
      23             :  * This version can be banked using an arbitrary list of alternative
      24             :  * addresses.
      25             :  *          
      26             :  * @tparam  N
      27             :  *          The number of variants/alternative addresses the element has.
      28             :  *
      29             :  * @ingroup ManyAddressesMIDIOutputElements
      30             :  */
      31             : template <setting_t N>
      32           1 : class PBPotentiometer
      33             :     : public Bankable::MIDIFilteredAnalog<ManyAddresses<N>,
      34             :                                           PitchBendSender<10>> {
      35             :   public:
      36             :     /** 
      37             :      * @brief   Create a new Bankable PBPotentiometer object with the given 
      38             :      *          analog pin and channel.
      39             :      * 
      40             :      * @param   bank
      41             :      *          The bank that selects the address to use.
      42             :      * @param   analogPin
      43             :      *          The analog input pin to read from.
      44             :      * @param   addresses
      45             :      *          The list of MIDI channels [CHANNEL_1, CHANNEL_16] and optional 
      46             :      *          Cable Numbers [0, 15].
      47             :      * @param   sender
      48             :      *          The MIDI sender to use.
      49             :      */
      50           1 :     PBPotentiometer(const Bank<N> &bank, pin_t analogPin,
      51             :                     const Array<MIDICNChannel, N> &addresses,
      52             :                     const PitchBendSender<10> &sender = {})
      53           1 :         : MIDIFilteredAnalog<ManyAddresses<N>, PitchBendSender<10>>{
      54           1 :               {bank, copyAs<MIDICNChannelAddress>(addresses)},
      55           1 :               analogPin,
      56           1 :               sender,
      57           2 :           } {}
      58             : };
      59             : 
      60             : } // namespace ManyAddresses
      61             : } // namespace Bankable
      62             : 
      63             : END_CS_NAMESPACE

Generated by: LCOV version 1.14-5-g4ff2ed6