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 : 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. 18 : * 19 : * @ingroup BankableMIDIOutputElements 20 : */ 21 1 : class CCIncrementDecrementButtons 22 : : public MIDIIncrementDecrementButtons<TwoSingleAddresses, RelativeCCSender, 23 : DigitalNoteSender> { 24 : public: 25 : /** 26 : * @brief Construct a new Bankable CCIncrementDecrementButtons object. 27 : * 28 : * @param config 29 : * The bank configuration to use: the bank to add this element to, 30 : * and whether to change the address, channel or cable number. 31 : * @param buttons 32 : * The pins with the increment and decrement buttons connected. 33 : * The internal pull-up resistors will be enabled. 34 : * @param address 35 : * The address to use for the relative events, containing the 36 : * controller number [0, 119], channel [CHANNEL_1, CHANNEL_16], and 37 : * optional cable number [0, 15]. 38 : * @param multiplier 39 : * The multiplier for the relative events. When setting it to 2, 40 : * it will scroll twice as fast, for example. 41 : * @param resetNote 42 : * The MIDI address to use to reset the setting, containing the 43 : * note number [0, 119], channel [CHANNEL_1, CHANNEL_16], and 44 : * optional cable number [0, 15]. It will be triggered when the 45 : * increment and decrement buttons are pressed simultaneously. 46 : * @param relativeSender 47 : * The MIDI sender to use for the relative events. 48 : * @param resetSender 49 : * The MIDI sender to use for reset events. 50 : */ 51 1 : CCIncrementDecrementButtons(const OutputBankConfig &config, 52 : const AH::IncrementDecrementButtons &buttons, 53 : const MIDICNChannelAddress &address, 54 : uint8_t multiplier = 1, 55 : const MIDICNChannelAddress &resetNote = {}, 56 : const RelativeCCSender &relativeSender = {}, 57 : const DigitalNoteSender &resetSender = {}) 58 1 : : MIDIIncrementDecrementButtons<TwoSingleAddresses, RelativeCCSender, 59 : DigitalNoteSender>( 60 1 : {config, {address, resetNote}}, buttons, multiplier, 61 3 : relativeSender, resetSender) {} 62 : }; 63 : 64 : } // namespace Bankable 65 : 66 : END_CS_NAMESPACE