LCOV - code coverage report
Current view: top level - src/MIDI_Outputs - ProgramChanger.hpp (source / functions) Hit Total Coverage
Test: b8a30b4b7040ae1abf162fd0a258beaa2de43626 Lines: 6 6 100.0 %
Date: 2024-12-21 21:28:55 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