LCOV - code coverage report
Current view: top level - src/MIDI_Senders - PitchBendSender.hpp (source / functions) Hit Total Coverage
Test: 19d2efc7037c2e176feca44750a12594c76f466f Lines: 7 7 100.0 %
Date: 2019-11-24 14:50:27 Functions: 1 1 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : #pragma once
       2             : 
       3             : #include <Control_Surface/Control_Surface_Class.hpp>
       4             : #include <Helpers/IncreaseBitDepth.hpp>
       5             : 
       6             : BEGIN_CS_NAMESPACE
       7             : 
       8             : template <uint8_t INPUT_PRECISION_BITS>
       9             : class PitchBendSender {
      10             :   public:
      11           9 :     static void send(uint16_t value, MIDICNChannelAddress address) {
      12           9 :         value = increaseBitDepth<14, INPUT_PRECISION_BITS, uint16_t, uint16_t>(
      13           9 :             value);
      14             :         // ignore address byte, just use channel and cable numbers
      15          18 :         MIDICNChannel channelCN = {address.getChannel(),
      16           9 :                                    address.getCableNumber()};
      17           9 :         Control_Surface.MIDI().sendPB(channelCN, value);
      18           9 :     }
      19             : 
      20             :     constexpr static uint8_t precision() { return INPUT_PRECISION_BITS; }
      21             : };
      22             : 
      23             : END_CS_NAMESPACE

Generated by: LCOV version 1.14-5-g4ff2ed6