Line data Source code
1 : #pragma once 2 : 3 : #include <MIDI_Outputs/Abstract/MIDIButton.hpp> 4 : #include <MIDI_Senders/DigitalCCSender.hpp> 5 : 6 : BEGIN_CS_NAMESPACE 7 : 8 : /** 9 : * @brief A class of MIDIOutputElement%s that read the input of a **momentary 10 : * push button or switch**, and send out MIDI **Control Change** 11 : * events. 12 : * 13 : * A value of 0x7F is sent when the button is pressed, and a value of 14 : * 0x00 is sent when the button is released. 15 : * The button is debounced in software. 16 : * This version cannot be banked. 17 : * 18 : * @ingroup MIDIOutputElements 19 : */ 20 2 : class CCButton 21 : : public MIDIButton<DigitalCCSender> { 22 : public: 23 : /** 24 : * @brief Create a new CCButton object with the given pin, 25 : * the given controller number and channel. 26 : * 27 : * @param pin 28 : * The digital input pin with the button connected. 29 : * The internal pull-up resistor will be enabled. 30 : * @param address 31 : * The MIDI address containing the controller number [0, 119], 32 : * channel [CHANNEL_1, CHANNEL_16], and optional cable number 33 : * [0, 15]. 34 : * @param sender 35 : * The MIDI sender to use. 36 : */ 37 2 : CCButton(pin_t pin, const MIDICNChannelAddress &address, const DigitalCCSender &sender = {}) 38 2 : : MIDIButton(pin, address, sender) {} 39 : }; 40 : 41 : END_CS_NAMESPACE