Control Surface
main
MIDI Control Surface library for Arduino
Toggle main menu visibility
Loading...
Searching...
No Matches
src
MIDI_Inputs
InterfaceMIDIInputElements.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <AH/STL/cstdint>
4
#include <
Settings/NamespaceSettings.hpp
>
5
6
BEGIN_CS_NAMESPACE
7
8
namespace
Interfaces
{
9
12
class
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
33
class
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
52
namespace
MCU
{
53
54
class
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
84
class
IVU
{
85
public
:
86
IVU
(uint8_t
max
,
bool
alwaysDirty
=
false
)
87
:
max
(
max
),
alwaysDirty
(
alwaysDirty
) {}
88
91
94
bool
getDirty
()
const
{
return
dirty
; }
96
void
clearDirty
() {
dirty
=
alwaysDirty
; }
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
;
111
bool
alwaysDirty
;
112
bool
dirty
=
true
;
113
};
114
115
}
// namespace MCU
116
117
}
// namespace Interfaces
118
119
END_CS_NAMESPACE
NamespaceSettings.hpp
END_CS_NAMESPACE
#define END_CS_NAMESPACE
Definition
Settings/NamespaceSettings.hpp:14
BEGIN_CS_NAMESPACE
#define BEGIN_CS_NAMESPACE
Definition
Settings/NamespaceSettings.hpp:11
Interfaces::IValue14
Abstract interface for MIDI input elements that receive and store a 14-bit value.
Definition
InterfaceMIDIInputElements.hpp:33
Interfaces::IValue14::getValue
virtual uint16_t getValue() const =0
Interfaces::IValue14::getDirty
bool getDirty() const
Check if the value was updated since the last time the dirty flag was cleared.
Definition
InterfaceMIDIInputElements.hpp:40
Interfaces::IValue14::dirty
bool dirty
Definition
InterfaceMIDIInputElements.hpp:49
Interfaces::IValue14::clearDirty
void clearDirty()
Clear the dirty flag.
Definition
InterfaceMIDIInputElements.hpp:42
Interfaces::IValue
Abstract interface for MIDI input elements that receive and store a 7-bit value.
Definition
InterfaceMIDIInputElements.hpp:12
Interfaces::IValue::getValue
virtual uint8_t getValue() const =0
Interfaces::IValue::getDirty
bool getDirty() const
Check if the value was updated since the last time the dirty flag was cleared.
Definition
InterfaceMIDIInputElements.hpp:19
Interfaces::IValue::dirty
bool dirty
Definition
InterfaceMIDIInputElements.hpp:28
Interfaces::IValue::clearDirty
void clearDirty()
Clear the dirty flag.
Definition
InterfaceMIDIInputElements.hpp:21
Interfaces::MCU::IVPot
Definition
InterfaceMIDIInputElements.hpp:54
Interfaces::MCU::IVPot::getStartOn
virtual uint8_t getStartOn() const =0
Interfaces::MCU::IVPot::getCenterLed
virtual bool getCenterLed() const =0
Interfaces::MCU::IVPot::getDirty
bool getDirty() const
Check if the value was updated since the last time the dirty flag was cleared.
Definition
InterfaceMIDIInputElements.hpp:61
Interfaces::MCU::IVPot::getStartOff
virtual uint8_t getStartOff() const =0
Interfaces::MCU::IVPot::dirty
bool dirty
Definition
InterfaceMIDIInputElements.hpp:72
Interfaces::MCU::IVPot::clearDirty
void clearDirty()
Clear the dirty flag.
Definition
InterfaceMIDIInputElements.hpp:63
Interfaces::MCU::IVU::getOverload
virtual bool getOverload()=0
Return the overload status.
Interfaces::MCU::IVU::getDirty
bool getDirty() const
Check if the value was updated since the last time the dirty flag was cleared.
Definition
InterfaceMIDIInputElements.hpp:94
Interfaces::MCU::IVU::getFloatValue
virtual float getFloatValue()
Get the VU meter value as a floating point number.
Definition
InterfaceMIDIInputElements.hpp:105
Interfaces::MCU::IVU::getMax
uint8_t getMax() const
Get the maximum value that this VU meter can return.
Definition
InterfaceMIDIInputElements.hpp:107
Interfaces::MCU::IVU::alwaysDirty
bool alwaysDirty
Definition
InterfaceMIDIInputElements.hpp:111
Interfaces::MCU::IVU::getValue
virtual uint8_t getValue()=0
Return the VU meter value as an integer.
Interfaces::MCU::IVU::IVU
IVU(uint8_t max, bool alwaysDirty=false)
Definition
InterfaceMIDIInputElements.hpp:86
Interfaces::MCU::IVU::dirty
bool dirty
Definition
InterfaceMIDIInputElements.hpp:112
Interfaces::MCU::IVU::max
uint8_t max
Definition
InterfaceMIDIInputElements.hpp:110
Interfaces::MCU::IVU::clearDirty
void clearDirty()
Clear the dirty flag.
Definition
InterfaceMIDIInputElements.hpp:96
Interfaces
Definition
InterfaceMIDIInputElements.hpp:8
MCU
Definition
LCDDisplay.hpp:10
Generated by
1.17.0