Line data Source code
1 : #pragma once 2 : 3 : #include <MIDI_Outputs/Abstract/MIDIIncrementDecrementButtons.hpp> 4 : #include <MIDI_Senders/DigitalNoteSender.hpp> 5 : #include <MIDI_Senders/RelativeCCSender.hpp> 6 : 7 : BEGIN_CS_NAMESPACE 8 : 9 : /** 10 : * @brief A class of MIDIOutputElement%s that read the input of **two 11 : * momentary push buttons** to increment or decrement a **relative 12 : * setting** using relative MIDI **Control Change** events. 13 : * An optional note number can be provided to reset the setting. 14 : * 15 : * This version cannot be banked. 16 : * 17 : * @ingroup MIDIOutputElements 18 : */ 19 1 : class CCIncrementDecrementButtons 20 : : public MIDIIncrementDecrementButtons<RelativeCCSender, 21 : DigitalNoteSender> { 22 : public: 23 : /** 24 : * @brief Construct a new CCIncrementDecrementButtons object. 25 : * 26 : * @param buttons 27 : * The pins with the increment and decrement buttons connected. 28 : * The internal pull-up resistors will be enabled. 29 : * @param address 30 : * The address to use for the relative events, containing the 31 : * controller number [0, 119], channel [CHANNEL_1, CHANNEL_16], and 32 : * optional cable number [CABLE_1, CABLE_16]. 33 : * @param multiplier 34 : * The multiplier for the relative events. When setting it to 2, 35 : * it will scroll twice as fast, for example. 36 : * @param resetNote 37 : * The MIDI address to use to reset the setting, containing the 38 : * note number [0, 119], channel [CHANNEL_1, CHANNEL_16], and 39 : * optional cable number [CABLE_1, CABLE_16]. 40 : * It will be triggered when the increment and decrement buttons 41 : * are pressed simultaneously. 42 : * @param relativeSender 43 : * The MIDI sender to use for the relative events. 44 : * @param resetSender 45 : * The MIDI sender to use for reset events. 46 : */ 47 1 : CCIncrementDecrementButtons(const AH::IncrementDecrementButtons &buttons, 48 : const MIDIAddress &address, 49 : uint8_t multiplier = 1, 50 : const MIDIAddress &resetNote = {}, 51 : const RelativeCCSender &relativeSender = {}, 52 : const DigitalNoteSender &resetSender = {}) 53 2 : : MIDIIncrementDecrementButtons(buttons, address, multiplier, resetNote, 54 3 : relativeSender, resetSender) {} 55 : }; 56 : 57 : END_CS_NAMESPACE