Control Surface  1.1.0
MIDI Control Surface library for Arduino
Bankable/CCButtonLatching.hpp
Go to the documentation of this file.
1 #pragma once
2 
6 
8 
9 namespace Bankable {
10 
11 /**
12  * @brief A class of MIDIOutputElement%s that read the input of a **latching
13  * push button or toggle switch**, and send out MIDI **Control Change**
14  * events.
15  *
16  * When the switch changes state, two MIDI events are sent: the first
17  * one with a value of 0x7F, followed immediately by a second one with
18  * a value of 0x00.
19  * The switch is debounced in software.
20  * This version can be banked.
21  *
22  * @ingroup BankableMIDIOutputElements
23  */
25  : public MIDIButtonLatching<SingleAddress, DigitalCCSender> {
26  public:
27  /**
28  * @brief Create a new Bankable CCButtonLatching object with the given
29  * pin, the given controller number and channel.
30  *
31  * @param config
32  * The bank configuration to use: the bank to add this element to,
33  * and whether to change the address, channel or cable number.
34  * @param pin
35  * The digital input pin with the button connected.
36  * The internal pull-up resistor will be enabled.
37  * @param address
38  * The MIDI address containing the controller number [0, 119],
39  * channel [CHANNEL_1, CHANNEL_16], and optional cable number
40  * [0, 15].
41  * @param sender
42  * The MIDI sender to use.
43  */
46  const DigitalCCSender &sender = {})
48  {config, address}, pin, sender} {}
49 };
50 
51 } // namespace Bankable
52 
Bankable
A namespace for MIDI elements that can be added to a Bank, to change their address or channel.
Definition: BankAddresses.hpp:7
DigitalCCSender.hpp
Bankable::CCButtonLatching::CCButtonLatching
CCButtonLatching(const OutputBankConfig &config, pin_t pin, const MIDICNChannelAddress &address, const DigitalCCSender &sender={})
Create a new Bankable CCButtonLatching object with the given pin, the given controller number and cha...
Definition: Bankable/CCButtonLatching.hpp:44
BEGIN_CS_NAMESPACE
#define BEGIN_CS_NAMESPACE
Definition: Settings/NamespaceSettings.hpp:9
BankAddresses.hpp
DigitalCCSender
Definition: DigitalCCSender.hpp:7
END_CS_NAMESPACE
#define END_CS_NAMESPACE
Definition: Settings/NamespaceSettings.hpp:10
Bankable::MIDIButtonLatching< SingleAddress, DigitalCCSender >::sender
DigitalCCSender sender
Definition: Bankable/Abstract/MIDIButtonLatching.hpp:55
Bankable::MIDIButtonLatching< SingleAddress, DigitalCCSender >::address
SingleAddress address
Definition: Bankable/Abstract/MIDIButtonLatching.hpp:51
MIDICNChannelAddress
A type-safe utility class for saving a MIDI address consisting of a 7-bit address,...
Definition: MIDICNChannelAddress.hpp:82
MIDIButtonLatching.hpp
Bankable::CCButtonLatching
A class of MIDIOutputElements that read the input of a latching push button or toggle switch,...
Definition: Bankable/CCButtonLatching.hpp:24
AH::pin_t
uint16_t pin_t
The type for Arduino pins (and ExtendedIOElement pins).
Definition: Hardware-Types.hpp:17
OutputBankConfig
A struct for selecting the bank of BankableMIDIOutputs and the bank type.
Definition: BankConfig.hpp:50
Bankable::MIDIButtonLatching
A class for latching buttons and switches that send MIDI events.
Definition: Bankable/Abstract/MIDIButtonLatching.hpp:20