This is an old version of the documentation. View the latest version here.
Control Surface  1.0.0
MIDI Control Surface library for Arduino
VPotRingLEDs.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <Hardware/LEDs/LEDs.hpp>
5 
7 
8 namespace MCU {
9 
11  public:
13 
14  template <class T>
15  void begin(const T &) {
16  leds.begin();
17  }
18 
19  template <class T>
20  void update(const T &t) {
21  leds.displayRange(t.getStartOn(), t.getStartOff());
22  }
23 
24  private:
25  const LEDs<11> leds;
26 };
27 
28 // -------------------------------------------------------------------------- //
29 
30 class VPotRingLEDs : public GenericVPotRing<VPotRingLEDsCallback> {
31  public:
32  VPotRingLEDs(const PinList<11> &ledPins, uint8_t track,
33  MIDICNChannel channelCN = CHANNEL_1)
34  : GenericVPotRing<VPotRingLEDsCallback>{track, channelCN, {ledPins}} {}
35 };
36 
37 namespace Bankable {
38 
39 template <setting_t NumBanks>
40 class VPotRingLEDs : public GenericVPotRing<NumBanks, VPotRingLEDsCallback> {
41  public:
43  uint8_t track, MIDICNChannel channelCN = CHANNEL_1)
45  config, track, channelCN, {ledPins}} {}
46 };
47 
48 } // namespace Bankable
49 
50 } // namespace MCU
51 
MCU::VPotRingLEDs::VPotRingLEDs
VPotRingLEDs(const PinList< 11 > &ledPins, uint8_t track, MIDICNChannel channelCN=CHANNEL_1)
Definition: VPotRingLEDs.hpp:32
MCU::VPotRingLEDsCallback::update
void update(const T &t)
Definition: VPotRingLEDs.hpp:20
MCU::Bankable::GenericVPotRing
A class for MIDI input elements that represent Mackie Control Universal V-Pots.
Definition: VPotRing.hpp:177
Bankable
A namespace for MIDI elements that can be added to a Bank, to change their address or channel.
Definition: BankAddresses.hpp:7
MCU
Names and note and controller numbers for the Mackie Control Universal (MCU) protocol.
Definition: LCDDisplay.hpp:10
Array< pin_t, N >
BEGIN_CS_NAMESPACE
#define BEGIN_CS_NAMESPACE
Definition: NamespaceSettings.hpp:9
LEDs::begin
void begin() const
Initialize (set LED pins as outputs).
Definition: LEDs.hpp:32
LEDs::displayRange
void displayRange(uint8_t startOn, uint8_t startOff) const
Turn on a range of the LEDs.
Definition: LEDs.hpp:46
MCU::GenericVPotRing
A class for MIDI input elements that represent Mackie Control Universal V-Pots.
Definition: VPotRing.hpp:144
VPotRing.hpp
MIDICNChannel
A class for saving a MIDI channel and cable number.
Definition: MIDICNChannelAddress.hpp:19
END_CS_NAMESPACE
#define END_CS_NAMESPACE
Definition: NamespaceSettings.hpp:10
LEDs.hpp
MCU::VPotRingLEDs
Definition: VPotRingLEDs.hpp:30
LEDs< 11 >
MCU::VPotRingLEDsCallback::leds
const LEDs< 11 > leds
Definition: VPotRingLEDs.hpp:25
MCU::Bankable::VPotRingLEDs::VPotRingLEDs
VPotRingLEDs(BankConfig< NumBanks > config, const PinList< 11 > &ledPins, uint8_t track, MIDICNChannel channelCN=CHANNEL_1)
Definition: VPotRingLEDs.hpp:42
MCU::VPotRingLEDsCallback::VPotRingLEDsCallback
VPotRingLEDsCallback(const LEDs< 11 > &leds)
Definition: VPotRingLEDs.hpp:12
BankConfig
A struct for selecting the bank of BankableMIDIInputs and the bank type.
Definition: BankConfig.hpp:39
MCU::Bankable::VPotRingLEDs
Definition: VPotRingLEDs.hpp:40
MCU::VPotRingLEDsCallback::begin
void begin(const T &)
Definition: VPotRingLEDs.hpp:15
CHANNEL_1
constexpr Channel CHANNEL_1
Definition: Channel.hpp:111
MCU::VPotRingLEDsCallback
Definition: VPotRingLEDs.hpp:10