Line data Source code
1 : #pragma once 2 : 3 : #include <Banks/BankAddresses.hpp> 4 : #include <MIDI_Outputs/Bankable/Abstract/MIDIIncrementDecrementButtons.hpp> 5 : #include <MIDI_Senders/RelativeCCSender.hpp> 6 : 7 : BEGIN_CS_NAMESPACE 8 : 9 : namespace Bankable { 10 : namespace ManyAddresses { 11 : /** 12 : * @brief A class of MIDIOutputElement%s that read the input of **two 13 : * momentary push buttons** to increment or decrement a **relative 14 : * setting** using relative MIDI **Control Change** events. 15 : * An optional note number can be provided to reset the setting. 16 : * 17 : * This version can be banked using an arbitrary list of alternative 18 : * addresses. 19 : * 20 : * @tparam NumBanks 21 : * The number of variants/alternative addresses the element has. 22 : * 23 : * @ingroup ManyAddressesMIDIOutputElements 24 : */ 25 : template <setting_t NumBanks> 26 : class CCIncrementDecrementButtons 27 : : public MIDIIncrementDecrementButtons< 28 : DualManyAddresses<NumBanks>, RelativeCCSender, DigitalNoteSender> { 29 : public: 30 : /** 31 : * @brief Construct a new Bankable CCIncrementDecrementButtons object. 32 : * 33 : * @param bank 34 : * The bank to add this element to. 35 : * @param buttons 36 : * The pins with the increment and decrement buttons connected. 37 : * The internal pull-up resistors will be enabled. 38 : * @param addresses 39 : * The list of MIDI addresses to use for the relative events, 40 : * containing the controller number [0, 119], channel [Channel_1, 41 : * Channel_16], and optional cable number [Cable_1, Cable_16]. 42 : * @param multiplier 43 : * The multiplier for the relative events. When setting it to 2, 44 : * it will scroll twice as fast, for example. 45 : * @param resetNotes 46 : * The list of MIDI addresses to use to reset the setting, 47 : * containing the note number [0, 127], channel [Channel_1, 48 : * Channel_16], and optional cable number [Cable_1, Cable_16]. 49 : * It will be triggered when the increment and decrement buttons 50 : * are pressed simultaneously. 51 : * @param relativeSender 52 : * The MIDI sender to use for the relative events. 53 : * @param resetSender 54 : * The MIDI sender to use for reset events. 55 : */ 56 1 : CCIncrementDecrementButtons( 57 : const Bank<NumBanks> &bank, 58 : const AH::IncrementDecrementButtons &buttons, 59 : const Array<MIDIAddress, NumBanks> &addresses, uint8_t multiplier = 1, 60 : const Array<MIDIAddress, NumBanks> &resetNotes = {}, 61 : const RelativeCCSender &relativeSender = {}, 62 : const DigitalNoteSender &resetSender = {}) 63 : : MIDIIncrementDecrementButtons<DualManyAddresses<NumBanks>, 64 : RelativeCCSender, DigitalNoteSender>( 65 : {bank, {addresses, resetNotes}}, buttons, multiplier, 66 1 : relativeSender, resetSender) {} 67 : }; 68 : } // namespace ManyAddresses 69 : } // namespace Bankable 70 : 71 : END_CS_NAMESPACE