#include <Audio/AudioVULEDs.hpp>
A VU meter that reads from an Audio stream using the AudioAnalyzePeak class, and displays it on an LED bar graph.
N | The number of LEDs. |
Definition at line 21 of file AudioVULEDs.hpp.
Detecting changes | |
bool | getDirty () const |
Check if the value was updated since the last time the dirty flag was cleared. | |
void | clearDirty () |
Clear the dirty flag. | |
Enabling and disabling updatables | |
void | enable () |
Enable this updatable: insert it into the linked list of instances, so it gets updated automatically. | |
void | disable () |
Disable this updatable: remove it from the linked list of instances, so it no longer gets updated automatically. | |
bool | isEnabled () const |
Check if this updatable is enabled. | |
void | moveDown () |
Move down this element in the list. | |
static void | enable (UpdatableCRTP *element) |
Enable this updatable: insert it into the linked list of instances, so it gets updated automatically. | |
static void | enable (UpdatableCRTP &element) |
Enable this updatable: insert it into the linked list of instances, so it gets updated automatically. | |
template<class U , size_t N> | |
static void | enable (U(&array)[N]) |
Enable this updatable: insert it into the linked list of instances, so it gets updated automatically. | |
static void | disable (UpdatableCRTP *element) |
Disable this updatable: remove it from the linked list of instances, so it no longer gets updated automatically. | |
static void | disable (UpdatableCRTP &element) |
Disable this updatable: remove it from the linked list of instances, so it no longer gets updated automatically. | |
template<class U , size_t N> | |
static void | disable (U(&array)[N]) |
Disable this updatable: remove it from the linked list of instances, so it no longer gets updated automatically. | |
Main initialization and updating methods | |
static void | beginAll () |
Begin all enabled instances of this class. | |
static void | updateAll () |
Update all enabled instances of this class. | |
Public Member Functions | |
AudioVULEDs (const AH::DotBarDisplayLEDs< N > &vuleds, AudioAnalyzePeak &level, float gain=1.0) | |
Create a new AudioVULEDs object. | |
void | begin () override |
Initialize. | |
void | update () override |
Update the LEDs with the latest level. | |
void | setMode (AH::DotBarMode mode) |
Set the mode to either dot or bar mode. | |
void | dotMode () |
Set the mode to dot mode. | |
void | barMode () |
Set the mode to bar mode. | |
uint8_t | getValue () override |
Get the value of the VU meter. | |
float | getFloatValue () override |
Get the value of the VU meter. | |
bool | getOverload () override |
void | setGain (float gain) |
Set the gain for the VU meter. | |
uint8_t | getMax () const |
Get the maximum value that this VU meter can return. | |
Protected Attributes | |
uint8_t | max |
bool | alwaysDirty |
bool | dirty = true |
Derived * | next |
Derived * | previous |
Static Protected Attributes | |
static DoublyLinkedList< Derived > | updatables |
Private Attributes | |
AH::DotBarDisplayLEDs< N > | vuleds |
uint8_t | previousValue = 0 |
MovingCoilBallistics | ballistics = MovingCoilBallistics::responsiveVU() |
class AudioVU::Analyzer | level |
float | gain |
|
inline |
Create a new AudioVULEDs object.
vuleds | The LEDs to display the VU meter to. |
level | The Teensy Audio peak analyzer object. Note that it is kept by reference, so it must outlive the AudioVU instance. |
gain | A multiplier to calibrate the VU meter. |
Definition at line 35 of file AudioVULEDs.hpp.
Update the LEDs with the latest level.
Implements Updatable< AudioVU >.
Definition at line 47 of file AudioVULEDs.hpp.
|
inline |
Set the mode to either dot or bar mode.
mode | The mode. |
Definition at line 61 of file AudioVULEDs.hpp.
Set the mode to dot mode.
Definition at line 66 of file AudioVULEDs.hpp.
Set the mode to bar mode.
Definition at line 71 of file AudioVULEDs.hpp.
|
inlineoverridevirtualinherited |
Get the value of the VU meter.
Implements IVU.
Definition at line 60 of file AudioVU.hpp.
|
inlineoverridevirtualinherited |
Get the value of the VU meter.
Reimplemented from IVU.
Definition at line 70 of file AudioVU.hpp.
|
inlineoverridevirtualinherited |
Implements IVU.
Definition at line 83 of file AudioVU.hpp.
|
inlineinherited |
Set the gain for the VU meter.
gain | The new gain. |
Definition at line 91 of file AudioVU.hpp.
|
inlineinherited |
Check if the value was updated since the last time the dirty flag was cleared.
Definition at line 94 of file InterfaceMIDIInputElements.hpp.
|
inlineinherited |
Clear the dirty flag.
Definition at line 96 of file InterfaceMIDIInputElements.hpp.
|
inlineinherited |
Get the maximum value that this VU meter can return.
Definition at line 107 of file InterfaceMIDIInputElements.hpp.
Begin all enabled instances of this class.
Definition at line 182 of file Updatable.hpp.
Update all enabled instances of this class.
Definition at line 186 of file Updatable.hpp.
Enable this updatable: insert it into the linked list of instances, so it gets updated automatically.
Definition at line 96 of file Updatable.hpp.
|
inlinestaticinherited |
Enable this updatable: insert it into the linked list of instances, so it gets updated automatically.
Definition at line 125 of file Updatable.hpp.
|
inlinestaticinherited |
Enable this updatable: insert it into the linked list of instances, so it gets updated automatically.
Definition at line 127 of file Updatable.hpp.
Enable this updatable: insert it into the linked list of instances, so it gets updated automatically.
Definition at line 130 of file Updatable.hpp.
Disable this updatable: remove it from the linked list of instances, so it no longer gets updated automatically.
Definition at line 106 of file Updatable.hpp.
|
inlinestaticinherited |
Disable this updatable: remove it from the linked list of instances, so it no longer gets updated automatically.
Definition at line 136 of file Updatable.hpp.
|
inlinestaticinherited |
Disable this updatable: remove it from the linked list of instances, so it no longer gets updated automatically.
Definition at line 138 of file Updatable.hpp.
Disable this updatable: remove it from the linked list of instances, so it no longer gets updated automatically.
Definition at line 141 of file Updatable.hpp.
Check if this updatable is enabled.
Definition at line 120 of file Updatable.hpp.
Move down this element in the list.
Definition at line 147 of file Updatable.hpp.
|
private |
Definition at line 74 of file AudioVULEDs.hpp.
Definition at line 75 of file AudioVULEDs.hpp.
|
privateinherited |
Definition at line 94 of file AudioVU.hpp.
|
privateinherited |
|
privateinherited |
Definition at line 135 of file AudioVU.hpp.
|
protectedinherited |
Definition at line 110 of file InterfaceMIDIInputElements.hpp.
|
protectedinherited |
Definition at line 111 of file InterfaceMIDIInputElements.hpp.
Definition at line 112 of file InterfaceMIDIInputElements.hpp.
|
staticprotectedinherited |
Definition at line 152 of file Updatable.hpp.
|
protectedinherited |
Definition at line 320 of file LinkedList.hpp.
|
protectedinherited |
Definition at line 321 of file LinkedList.hpp.