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

          Line data    Source code
       1             : #pragma once
       2             : 
       3             : #include <Control_Surface/Control_Surface_Class.hpp>
       4             : #include <Def/Def.hpp>
       5             : #include <Selectors/Selectable.hpp>
       6             : 
       7             : BEGIN_CS_NAMESPACE
       8             : 
       9             : template <setting_t N>
      10             : class ProgramChanger : public Selectable<N> {
      11             :   public:
      12           2 :     ProgramChanger(const Array<uint8_t, N> &programs,
      13             :                    MIDIChannelCable channelCN)
      14           2 :         : programs(programs), channelCN(channelCN) {}
      15             : 
      16           1 :     void select(setting_t setting) override {
      17           1 :         setting = this->validateSetting(setting);
      18           1 :         Control_Surface.sendProgramChange(channelCN, programs[setting]);
      19           1 :     }
      20             : 
      21             :   private:
      22             :     Array<uint8_t, N> programs;
      23             :     MIDIChannelCable channelCN;
      24             : };
      25             : 
      26             : END_CS_NAMESPACE

Generated by: LCOV version 1.15