Control Surface main
MIDI Control Surface library for Arduino
Loading...
Searching...
No Matches
VPotRingLEDs.hpp
Go to the documentation of this file.
1#pragma once
2
5
7
8namespace MCU {
9
10class VPotRingLEDsDriver : public AH::LEDs<11> {
11 public:
12 VPotRingLEDsDriver(const AH::LEDs<11> &leds) : AH::LEDs<11>(leds) {}
13
15 this->displayRange(v.getStartOn(), v.getStartOff());
16 }
17};
18
19// -------------------------------------------------------------------------- //
20
28 public:
31
43 VPotRingLEDs(const PinList<11> &leds, uint8_t track,
44 MIDIChannelCable channelCN = Channel_1)
45 : Parent(track, channelCN), VPotRingLEDsDriver(leds) {}
46
47 protected:
48 void handleUpdate(typename Matcher::Result match) override {
49 bool newdirty = Parent::handleUpdateImpl(match);
50 if (newdirty)
52 this->dirty |= newdirty;
53 }
54
55 void updateDisplay() { this->displayVPot(this->getState()); }
56
57 public:
58 void begin() override {
62 }
63
64 void reset() override {
67 }
68};
69
70namespace Bankable {
71
81template <uint8_t BankSize>
82class VPotRingLEDs : public VPotRing<BankSize>, public VPotRingLEDsDriver {
83 public:
85 using Matcher = typename Parent::Matcher;
86
101 VPotRingLEDs(BankConfig<BankSize> config, const PinList<11> &leds,
102 uint8_t track, MIDIChannelCable channelCN = Channel_1)
103 : Parent(config, track, channelCN), VPotRingLEDsDriver(leds) {}
104
105 protected:
106 void handleUpdate(typename Matcher::Result match) override {
107 bool newdirty = Parent::handleUpdateImpl(match);
108 if (newdirty)
110 this->dirty |= newdirty;
111 }
112
113 void updateDisplay() { this->displayVPot(this->getState()); }
114
115 public:
116 void begin() override {
120 }
121
122 void reset() override {
125 }
126
127 protected:
128 void onBankSettingChange() override {
131 }
132};
133
134} // namespace Bankable
135
136} // namespace MCU
137
constexpr Channel Channel_1
Definition Channel.hpp:118
#define END_CS_NAMESPACE
#define BEGIN_CS_NAMESPACE
A class for collections of LEDs that can display ranges.
Definition LEDs.hpp:18
LEDs(const PinList< N > &ledPins)
Create a LEDs object.
Definition LEDs.hpp:26
void begin() const
Initialize (set LED pins as outputs).
Definition LEDs.hpp:31
void displayRange(uint16_t startOn, uint16_t startOff) const
Turn on a range of the LEDs.
Definition LEDs.hpp:45
A class for serial-in/parallel-out shift registers, like the 74HC595 that are connected to the SPI bu...
A MIDI input element that represents a Mackie Control Universal VPot ring and displays its value usin...
void onBankSettingChange() override
A function to be executed each time the bank setting changes.
void begin() override
Initialize the input element.
VPotRingLEDs(BankConfig< BankSize > config, const PinList< 11 > &leds, uint8_t track, MIDIChannelCable channelCN=Channel_1)
Constructor.
void handleUpdate(typename Matcher::Result match) override
typename Parent::Matcher Matcher
void reset() override
Reset all states to zero.
A MIDI input element that represents a Mackie Control Universal VPot ring.
Definition VPotRing.hpp:239
BankableVPotMatcher< BankSize > Matcher
Definition VPotRing.hpp:241
void onBankSettingChange() override
A function to be executed each time the bank setting changes.
Definition VPotRing.hpp:343
VPotState getState() const
Get the full state of the VPot ring. (For the active bank.)
Definition VPotRing.hpp:307
bool handleUpdateImpl(typename Matcher::Result match)
Definition VPotRing.hpp:262
void reset() override
Reset all states to zero.
Definition VPotRing.hpp:335
VPotRingLEDsDriver(const AH::LEDs< 11 > &leds)
void displayVPot(VPotState v)
A MIDI input element that represents a Mackie Control Universal VPot ring and displays it using LEDs.
void begin() override
Initialize the input element.
void handleUpdate(typename Matcher::Result match) override
void reset() override
Reset the state to zero.
VPotRingLEDs(const PinList< 11 > &leds, uint8_t track, MIDIChannelCable channelCN=Channel_1)
Constructor.
A MIDI input element that represents a Mackie Control Universal VPot ring.
Definition VPotRing.hpp:156
VPotRing(uint8_t track, MIDIChannelCable channelCN=Channel_1)
Constructor.
Definition VPotRing.hpp:171
VPotMatcher Matcher
Definition VPotRing.hpp:158
VPotState getState() const
Get the full state of the VPot ring.
Definition VPotRing.hpp:188
bool handleUpdateImpl(typename Matcher::Result match)
Definition VPotRing.hpp:175
void reset() override
Reset the state to zero.
Definition VPotRing.hpp:205
A class for saving a MIDI channel and cable number.
virtual void begin()
Initialize the input element.
PrintStream library
Definition Array.hpp:10
A namespace for MIDI elements that can be added to a Bank, to change their address or channel.
MIDI Input matcher for Mackie Control Universal VPot LED rings.
Definition VPotRing.hpp:108
Struct that keeps track of the value and overload indicator of a Mackie Control Universal VPot LED ri...
Definition VPotRing.hpp:14
uint8_t getStartOff() const
Get the first segment that should be off.
Definition VPotRing.hpp:61
uint8_t getStartOn() const
Get the first segment that should be on.
Definition VPotRing.hpp:46