Control Surface main
MIDI Control Surface library for Arduino
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions | Private Attributes | List of all members
VUDisplay< VU_t > Class Template Reference

#include <Display/MCU/VUDisplay.hpp>

Detailed Description

template<class VU_t = Interfaces::MCU::IVU &>
class MCU::VUDisplay< VU_t >

Displays a MCU level meter.

Examples
2.VU-Meter-OLED-USB-DAC.ino, MCU-OLED-SSD1306-x2.ino, MCU-OLED-SSD1306.ino, and VU-Meter-Bridge.ino.

Definition at line 16 of file VUDisplay.hpp.

+ Inheritance diagram for VUDisplay< VU_t >:
+ Collaboration diagram for VUDisplay< VU_t >:

Enabling and disabling display elements

void enable ()
 Enable this display element: insert it into the linked list of instances, so it gets drawn to the display.
 
void disable ()
 Disable this display element: remove it from the linked list of instances, so it no longer gets drawn to the display.
 
bool isEnabled () const
 Check if this display element is enabled.
 
static void enable (DisplayElement *element)
 Enable this display element: insert it into the linked list of instances, so it gets drawn to the display.
 
static void enable (DisplayElement &element)
 Enable this display element: insert it into the linked list of instances, so it gets drawn to the display.
 
template<class U , size_t N>
static void enable (U(&array)[N])
 Enable this display element: insert it into the linked list of instances, so it gets drawn to the display.
 
static void disable (DisplayElement *element)
 Disable this display element: remove it from the linked list of instances, so it no longer gets drawn to the display.
 
static void disable (DisplayElement &element)
 Disable this display element: remove it from the linked list of instances, so it no longer gets drawn to the display.
 
template<class U , size_t N>
static void disable (U(&array)[N])
 Disable this display element: remove it from the linked list of instances, so it no longer gets drawn to the display.
 

Public Member Functions

 VUDisplay (DisplayInterface &display, VU_t &&vu, PixelLocation loc, uint16_t width, uint8_t blockheight, uint8_t spacing, uint16_t color)
 
void draw () override
 Draw this DisplayElement to the display buffer.
 
bool getDirty () const override
 Check if this DisplayElement has to be re-drawn.
 
DisplayInterfacegetDisplay ()
 Get a reference to the display that this element draws to.
 
const DisplayInterfacegetDisplay () const
 Get a const reference to the display that this element draws to.
 

Static Public Member Functions

static DoublyLinkedList< DisplayElement > & getAll ()
 Get the list of all DisplayElement instances.
 

Protected Member Functions

virtual void drawPeak (uint8_t peak)
 
virtual void drawBlocks (uint8_t value)
 

Protected Attributes

DisplayInterfacedisplay
 
DisplayElementnext
 
DisplayElementprevious
 

Static Protected Attributes

static DoublyLinkedList< DisplayElementelements
 

Private Member Functions

void updatePeak (uint8_t value)
 
bool shouldStartDecaying () const
 
bool shouldUpdateDecay () const
 

Private Attributes

VU_t vu
 
int16_t x
 
int16_t y
 
uint16_t width
 
uint8_t blockheight
 
uint8_t spacing
 
uint16_t color
 
int16_t peak = 0
 
unsigned long previousDecay = 0
 
bool decaying = false
 
unsigned long decayTime
 

Constructor & Destructor Documentation

◆ VUDisplay()

template<class VU_t = Interfaces::MCU::IVU &>
VUDisplay ( DisplayInterface & display,
VU_t && vu,
PixelLocation loc,
uint16_t width,
uint8_t blockheight,
uint8_t spacing,
uint16_t color )
inline

Definition at line 18 of file VUDisplay.hpp.

Member Function Documentation

◆ draw()

template<class VU_t = Interfaces::MCU::IVU &>
void draw ( )
inlineoverridevirtual

Draw this DisplayElement to the display buffer.

Implements DisplayElement.

Definition at line 28 of file VUDisplay.hpp.

◆ getDirty()

template<class VU_t = Interfaces::MCU::IVU &>
bool getDirty ( ) const
inlineoverridevirtual

Check if this DisplayElement has to be re-drawn.

Implements DisplayElement.

Definition at line 38 of file VUDisplay.hpp.

◆ drawPeak()

template<class VU_t = Interfaces::MCU::IVU &>
virtual void drawPeak ( uint8_t peak)
inlineprotectedvirtual

Definition at line 43 of file VUDisplay.hpp.

◆ drawBlocks()

template<class VU_t = Interfaces::MCU::IVU &>
virtual void drawBlocks ( uint8_t value)
inlineprotectedvirtual

Definition at line 50 of file VUDisplay.hpp.

◆ updatePeak()

template<class VU_t = Interfaces::MCU::IVU &>
void updatePeak ( uint8_t value)
inlineprivate

Definition at line 60 of file VUDisplay.hpp.

◆ shouldStartDecaying()

template<class VU_t = Interfaces::MCU::IVU &>
bool shouldStartDecaying ( ) const
inlineprivate

Definition at line 75 of file VUDisplay.hpp.

◆ shouldUpdateDecay()

template<class VU_t = Interfaces::MCU::IVU &>
bool shouldUpdateDecay ( ) const
inlineprivate

Definition at line 80 of file VUDisplay.hpp.

◆ enable() [1/4]

void enable ( )
inlineprotectedinherited

Enable this display element: insert it into the linked list of instances, so it gets drawn to the display.

Definition at line 35 of file DisplayElement.hpp.

◆ enable() [2/4]

static void enable ( DisplayElement * element)
inlinestaticprotectedinherited

Enable this display element: insert it into the linked list of instances, so it gets drawn to the display.

Definition at line 62 of file DisplayElement.hpp.

◆ enable() [3/4]

static void enable ( DisplayElement & element)
inlinestaticprotectedinherited

Enable this display element: insert it into the linked list of instances, so it gets drawn to the display.

Definition at line 64 of file DisplayElement.hpp.

◆ enable() [4/4]

template<class U , size_t N>
static void enable ( U(&) array[N])
inlinestaticprotectedinherited

Enable this display element: insert it into the linked list of instances, so it gets drawn to the display.

Definition at line 67 of file DisplayElement.hpp.

◆ disable() [1/4]

void disable ( )
inlineprotectedinherited

Disable this display element: remove it from the linked list of instances, so it no longer gets drawn to the display.

Definition at line 45 of file DisplayElement.hpp.

◆ disable() [2/4]

static void disable ( DisplayElement * element)
inlinestaticprotectedinherited

Disable this display element: remove it from the linked list of instances, so it no longer gets drawn to the display.

Definition at line 73 of file DisplayElement.hpp.

◆ disable() [3/4]

static void disable ( DisplayElement & element)
inlinestaticprotectedinherited

Disable this display element: remove it from the linked list of instances, so it no longer gets drawn to the display.

Definition at line 75 of file DisplayElement.hpp.

◆ disable() [4/4]

template<class U , size_t N>
static void disable ( U(&) array[N])
inlinestaticprotectedinherited

Disable this display element: remove it from the linked list of instances, so it no longer gets drawn to the display.

Definition at line 78 of file DisplayElement.hpp.

◆ isEnabled()

bool isEnabled ( ) const
inlineprotectedinherited

Check if this display element is enabled.

Note
Assumes that the element is not added to a different linked list by the user.

Definition at line 59 of file DisplayElement.hpp.

◆ getDisplay() [1/2]

DisplayInterface & getDisplay ( )
inlineinherited

Get a reference to the display that this element draws to.

Definition at line 95 of file DisplayElement.hpp.

◆ getDisplay() [2/2]

const DisplayInterface & getDisplay ( ) const
inlineinherited

Get a const reference to the display that this element draws to.

Definition at line 97 of file DisplayElement.hpp.

◆ getAll()

static DoublyLinkedList< DisplayElement > & getAll ( )
inlinestaticinherited

Get the list of all DisplayElement instances.

Definition at line 100 of file DisplayElement.hpp.

Member Data Documentation

◆ vu

template<class VU_t = Interfaces::MCU::IVU &>
VU_t vu
private

Definition at line 85 of file VUDisplay.hpp.

◆ x

template<class VU_t = Interfaces::MCU::IVU &>
int16_t x
private

Definition at line 87 of file VUDisplay.hpp.

◆ y

template<class VU_t = Interfaces::MCU::IVU &>
int16_t y
private

Definition at line 88 of file VUDisplay.hpp.

◆ width

template<class VU_t = Interfaces::MCU::IVU &>
uint16_t width
private

Definition at line 89 of file VUDisplay.hpp.

◆ blockheight

template<class VU_t = Interfaces::MCU::IVU &>
uint8_t blockheight
private

Definition at line 90 of file VUDisplay.hpp.

◆ spacing

template<class VU_t = Interfaces::MCU::IVU &>
uint8_t spacing
private

Definition at line 91 of file VUDisplay.hpp.

◆ color

template<class VU_t = Interfaces::MCU::IVU &>
uint16_t color
private

Definition at line 92 of file VUDisplay.hpp.

◆ peak

template<class VU_t = Interfaces::MCU::IVU &>
int16_t peak = 0
private

Definition at line 94 of file VUDisplay.hpp.

◆ previousDecay

template<class VU_t = Interfaces::MCU::IVU &>
unsigned long previousDecay = 0
private

Definition at line 95 of file VUDisplay.hpp.

◆ decaying

template<class VU_t = Interfaces::MCU::IVU &>
bool decaying = false
private

Definition at line 96 of file VUDisplay.hpp.

◆ decayTime

template<class VU_t = Interfaces::MCU::IVU &>
unsigned long decayTime
private

Definition at line 98 of file VUDisplay.hpp.

◆ display

DisplayInterface& display
protectedinherited

Definition at line 103 of file DisplayElement.hpp.

◆ elements

DoublyLinkedList< DisplayElement > elements
staticprotectedinherited

Definition at line 105 of file DisplayElement.hpp.

◆ next

DisplayElement * next
protectedinherited

Definition at line 320 of file LinkedList.hpp.

◆ previous

DisplayElement * previous
protectedinherited

Definition at line 321 of file LinkedList.hpp.


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