Control Surface main
MIDI Control Surface library for Arduino
Loading...
Searching...
No Matches
InterfaceMIDIInputElements.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <AH/STL/cstdint>
4#include <Settings/NamespaceSettings.hpp>
5
7
8namespace Interfaces {
9
12class IValue {
13 public:
16
19 bool getDirty() const { return dirty; }
21 void clearDirty() { dirty = false; }
22
24
25 virtual uint8_t getValue() const = 0;
26
27 protected:
28 bool dirty = true;
29};
30
33class IValue14 {
34 public:
37
40 bool getDirty() const { return dirty; }
42 void clearDirty() { dirty = false; }
43
45
46 virtual uint16_t getValue() const = 0;
47
48 protected:
49 bool dirty = true;
50};
51
52namespace MCU {
53
54class IVPot {
55 public:
58
61 bool getDirty() const { return dirty; }
63 void clearDirty() { dirty = false; }
64
66
67 virtual bool getCenterLed() const = 0;
68 virtual uint8_t getStartOn() const = 0;
69 virtual uint8_t getStartOff() const = 0;
70
71 protected:
72 bool dirty = true;
73};
74
84class IVU {
85 public:
86 IVU(uint8_t max, bool alwaysDirty = false)
87 : max(max), alwaysDirty(alwaysDirty) {}
88
91
94 bool getDirty() const { return dirty; }
97
99
101 virtual uint8_t getValue() = 0;
103 virtual bool getOverload() = 0;
105 virtual float getFloatValue() { return (float)getValue() / getMax(); }
107 uint8_t getMax() const { return max; }
108
109 protected:
110 uint8_t max;
112 bool dirty = true;
113};
114
115} // namespace MCU
116
117} // namespace Interfaces
118
#define END_CS_NAMESPACE
#define BEGIN_CS_NAMESPACE
Abstract interface for MIDI input elements that receive and store a 14-bit value.
virtual uint16_t getValue() const =0
bool getDirty() const
Check if the value was updated since the last time the dirty flag was cleared.
void clearDirty()
Clear the dirty flag.
Abstract interface for MIDI input elements that receive and store a 7-bit value.
virtual uint8_t getValue() const =0
bool getDirty() const
Check if the value was updated since the last time the dirty flag was cleared.
void clearDirty()
Clear the dirty flag.
virtual uint8_t getStartOn() const =0
virtual bool getCenterLed() const =0
bool getDirty() const
Check if the value was updated since the last time the dirty flag was cleared.
virtual uint8_t getStartOff() const =0
void clearDirty()
Clear the dirty flag.
An abstract interface for VU meters.
virtual bool getOverload()=0
Return the overload status.
bool getDirty() const
Check if the value was updated since the last time the dirty flag was cleared.
virtual float getFloatValue()
Get the VU meter value as a floating point number.
uint8_t getMax() const
Get the maximum value that this VU meter can return.
virtual uint8_t getValue()=0
Return the VU meter value as an integer.
IVU(uint8_t max, bool alwaysDirty=false)
void clearDirty()
Clear the dirty flag.