Control Surface  1.2.0
MIDI Control Surface library for Arduino
Public Member Functions | Public Attributes | Static Private Member Functions | Private Attributes | List of all members
NoteCCFastLEDCallback< ColorMapper > Class Template Reference

Callback for Note or CC range or value input that displays the value to a FastLED strip. More...

#include <MIDI_Inputs/LEDs/FastLED.hpp>

+ Inheritance diagram for NoteCCFastLEDCallback< ColorMapper >:
+ Collaboration diagram for NoteCCFastLEDCallback< ColorMapper >:

Public Member Functions

 NoteCCFastLEDCallback (CRGB *ledcolors, const ColorMapper &colormapper)
 
 NoteCCFastLEDCallback (CRGB *ledcolors, const ColorMapper &colormapper, index_permuter_f index_permuter)
 
void setBrightness (uint8_t brightness)
 Set the maximum brightness of the LEDs. More...
 
uint8_t getBrightness () const
 Get the maximum brightness of the LEDs. More...
 
void setLEDIndexPermuter (index_permuter_f permuter)
 Change the mapping from the MIDI index to the LED index. More...
 
void begin (const INoteCCValue &input) override
 Initialize: called once. More...
 
void update (const INoteCCValue &input, uint8_t index) override
 Update the given index: called when a new message is received for this index. More...
 
virtual void updateAll (const INoteCCValue &noteccval)
 Update all values: called when a bank change causes all values to (possibly) change, or when the entire range is reset to zero. More...
 

Public Attributes

ColorMapper colormapper
 

Static Private Member Functions

static uint8_t identityPermuter (uint8_t i)
 

Private Attributes

CRGB * ledcolors
 
uint8_t brightness = 255
 
index_permuter_f ledIndexPermuter = identityPermuter
 

Detailed Description

template<class ColorMapper>
class NoteCCFastLEDCallback< ColorMapper >

Callback for Note or CC range or value input that displays the value to a FastLED strip.

Definition at line 41 of file FastLED.hpp.

Constructor & Destructor Documentation

◆ NoteCCFastLEDCallback() [1/2]

NoteCCFastLEDCallback ( CRGB *  ledcolors,
const ColorMapper &  colormapper 
)
inline

Definition at line 43 of file FastLED.hpp.

◆ NoteCCFastLEDCallback() [2/2]

NoteCCFastLEDCallback ( CRGB *  ledcolors,
const ColorMapper &  colormapper,
index_permuter_f  index_permuter 
)
inline

Definition at line 46 of file FastLED.hpp.

Member Function Documentation

◆ setBrightness()

void setBrightness ( uint8_t  brightness)
inline

Set the maximum brightness of the LEDs.

Parameters
brightnessThe maximum brightness [0, 255]

Definition at line 56 of file FastLED.hpp.

◆ getBrightness()

uint8_t getBrightness ( ) const
inline

Get the maximum brightness of the LEDs.

Definition at line 58 of file FastLED.hpp.

◆ setLEDIndexPermuter()

void setLEDIndexPermuter ( index_permuter_f  permuter)
inline

Change the mapping from the MIDI index to the LED index.

The MIDI index is derived from the note or controller number.

The function should take the (zer-based) MIDI index value as a parameter, and return the corresponding LED index (zero-based). By default, the LED index is the same as the MIDI index.

Definition at line 69 of file FastLED.hpp.

◆ begin()

void begin ( const INoteCCValue )
inlineoverridevirtual

Initialize: called once.

Reimplemented from SimpleNoteCCValueCallback.

Definition at line 74 of file FastLED.hpp.

◆ update()

void update ( const INoteCCValue noteccval,
uint8_t  index 
)
inlineoverridevirtual

Update the given index: called when a new message is received for this index.

Implements SimpleNoteCCValueCallback.

Definition at line 83 of file FastLED.hpp.

◆ identityPermuter()

static uint8_t identityPermuter ( uint8_t  i)
inlinestaticprivate

Definition at line 101 of file FastLED.hpp.

◆ updateAll()

virtual void updateAll ( const INoteCCValue noteccval)
inlinevirtualinherited

Update all values: called when a bank change causes all values to (possibly) change, or when the entire range is reset to zero.

Definition at line 58 of file NoteCCRange.hpp.

Member Data Documentation

◆ ledcolors

CRGB* ledcolors
private

Definition at line 97 of file FastLED.hpp.

◆ brightness

uint8_t brightness = 255
private

Definition at line 98 of file FastLED.hpp.

◆ ledIndexPermuter

index_permuter_f ledIndexPermuter = identityPermuter
private

Definition at line 99 of file FastLED.hpp.

◆ colormapper

ColorMapper colormapper

Definition at line 104 of file FastLED.hpp.


The documentation for this class was generated from the following file: