LCOV - code coverage report
Current view: top level - src/MIDI_Outputs/Bankable - ProgramChanger.hpp (source / functions) Hit Total Coverage
Test: b8a30b4b7040ae1abf162fd0a258beaa2de43626 Lines: 2 7 28.6 %
Date: 2024-12-21 21:28:55 Functions: 1 2 50.0 %
Legend: Lines: hit not hit

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

Generated by: LCOV version 1.15