3#include <AH/STL/utility>
6#include <Settings/SettingsWrapper.hpp>
15template <
class VU_t = Interfaces::MCU::IVU &>
29 uint8_t value =
vu.getValue();
51 for (uint8_t i = 0; i < value; i++)
62 if (newPeak >=
peak) {
111template <
class VU_t = Interfaces::MCU::IVU>
122 float value =
vu.getFloatValue();
#define BEGIN_CS_NAMESPACE
constexpr bool VU_PEAK_SMOOTH_DECAY
If set to true, the VU meter display peak bars will decay smoothly (i.e.
constexpr unsigned long VU_PEAK_HOLD_TIME
The time in milliseconds that a VU meter display peak bar stays at the peak before decaying.
constexpr unsigned long VU_PEAK_DECAY_TIME
The time in milliseconds it takes for the VU meter display peak bar to drop one unit (i....
Line rasterization algorithm for drawing lines to the display.
An interface for elements that draw to a display.
DisplayInterface & display
An interface for displays.
virtual void drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color)=0
Draw a horizontal line.
virtual void drawPixel(int16_t x, int16_t y, uint16_t color)=0
Paint a single pixel with the given color.
virtual void fillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color)
Draw a filled rectangle.
AnalogVUDisplay(DisplayInterface &display, VU_t &vu, PixelLocation loc, uint16_t radius, float theta_min, float theta_diff, uint16_t color)
bool getDirty() const override
Check if this DisplayElement has to be re-drawn.
void drawNeedle(float angle)
void draw() override
Draw this DisplayElement to the display buffer.
Displays a MCU level meter.
bool getDirty() const override
Check if this DisplayElement has to be re-drawn.
bool shouldUpdateDecay() const
unsigned long previousDecay
VUDisplay(DisplayInterface &display, VU_t &&vu, PixelLocation loc, uint16_t width, uint8_t blockheight, uint8_t spacing, uint16_t color)
virtual void drawPeak(uint8_t peak)
void updatePeak(uint8_t value)
bool shouldStartDecaying() const
virtual void drawBlocks(uint8_t value)
void draw() override
Draw this DisplayElement to the display buffer.
unsigned int distanceSquared(Pixel other) const
A simple struct representing a pixel with integer coordinates.