This is an old version of the documentation. View the latest version here.
Control Surface  1.0.0
MIDI Control Surface library for Arduino
IncrementDecrementButtons.hpp
Go to the documentation of this file.
1 /* ✔ */
2 
3 #pragma once
4 
5 #include "Button.hpp"
6 
8 
23  public:
35  const Button &decrementButton)
37 
39  void begin() {
42  }
43 
49  enum State {
50  Nothing = 0,
54  };
55 
60 
67  State getState() const { return state; }
68 
69 #ifdef INDIVIDUAL_BUTTON_INVERT
70  void invert() {
74  }
75 #endif
76 
77  protected:
79 
80  private:
83 
84  enum {
89  unsigned long longPressRepeat;
91 };
92 
IncrementDecrementButtons::LongPress
Definition: IncrementDecrementButtons.hpp:86
Button::invert
INDIVIDUAL_BUTTON_INVERT_STATIC void invert()
Invert the state of all buttons, or of this specific button (button pressed is HIGH instead of LOW).
Definition: Button.cpp:11
Button.hpp
IncrementDecrementButtons::decrementButton
Button decrementButton
Definition: IncrementDecrementButtons.hpp:82
Button
A class for reading and debouncing buttons and switches.
Definition: Button.hpp:15
IncrementDecrementButtons::state
State state
Definition: IncrementDecrementButtons.hpp:90
IncrementDecrementButtons::longPressState
enum IncrementDecrementButtons::@2 longPressState
IncrementDecrementButtons::Nothing
The counter should not be incremented.
Definition: IncrementDecrementButtons.hpp:50
IncrementDecrementButtons::update
State update()
Update and return the state of the increment/decrement button.
Definition: IncrementDecrementButtons.hpp:59
IncrementDecrementButtons::getState
State getState() const
Return the state of the increment/decrement button without updating it.
Definition: IncrementDecrementButtons.hpp:67
IncrementDecrementButtons::incrementButton
Button incrementButton
Definition: IncrementDecrementButtons.hpp:81
IncrementDecrementButtons::Initial
Definition: IncrementDecrementButtons.hpp:85
BEGIN_CS_NAMESPACE
#define BEGIN_CS_NAMESPACE
Definition: NamespaceSettings.hpp:9
IncrementDecrementButtons::AfterReset
Definition: IncrementDecrementButtons.hpp:87
IncrementDecrementButtons::longPressRepeat
unsigned long longPressRepeat
Definition: IncrementDecrementButtons.hpp:89
IncrementDecrementButtons::updateImplementation
State updateImplementation()
Definition: IncrementDecrementButtons.cpp:6
IncrementDecrementButtons::begin
void begin()
Definition: IncrementDecrementButtons.hpp:39
END_CS_NAMESPACE
#define END_CS_NAMESPACE
Definition: NamespaceSettings.hpp:10
IncrementDecrementButtons::IncrementDecrementButtons
IncrementDecrementButtons(const Button &incrementButton, const Button &decrementButton)
Create a IncrementDecrementButtons object.
Definition: IncrementDecrementButtons.hpp:34
IncrementDecrementButtons
A class for buttons that increment and decrement some counter or setting.
Definition: IncrementDecrementButtons.hpp:22
Button::begin
void begin()
Initialize (enable the internal pull-up resistor).
Definition: Button.cpp:9
IncrementDecrementButtons::State
State
An enumeration of the different actions to be performed by the counter.
Definition: IncrementDecrementButtons.hpp:49
IncrementDecrementButtons::Increment
The counter should be incremented.
Definition: IncrementDecrementButtons.hpp:51
IncrementDecrementButtons::Decrement
The counter should be decremented.
Definition: IncrementDecrementButtons.hpp:52
IncrementDecrementButtons::Reset
The counter should be reset to the initial value.
Definition: IncrementDecrementButtons.hpp:53