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 [0, 15]. 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 [0, 15]. It will be triggered when the 40 : * increment and decrement buttons are pressed simultaneously. 41 : * @param relativeSender 42 : * The MIDI sender to use for the relative events. 43 : * @param resetSender 44 : * The MIDI sender to use for reset events. 45 : */ 46 1 : CCIncrementDecrementButtons(const AH::IncrementDecrementButtons &buttons, 47 : const MIDICNChannelAddress &address, 48 : uint8_t multiplier = 1, 49 : const MIDICNChannelAddress &resetNote = {}, 50 : const RelativeCCSender &relativeSender = {}, 51 : const DigitalNoteSender &resetSender = {}) 52 2 : : MIDIIncrementDecrementButtons(buttons, address, multiplier, resetNote, 53 3 : relativeSender, resetSender) {} 54 : }; 55 : 56 : END_CS_NAMESPACE