2026-09-11 16:38:28 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <JuceHeader.h>
|
|
|
|
|
|
|
|
|
|
class LcdDisplay : public juce::Component,
|
|
|
|
|
private juce::Timer
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
static constexpr int kCols = 80;
|
|
|
|
|
static constexpr int kRows = 4;
|
|
|
|
|
|
|
|
|
|
LcdDisplay();
|
|
|
|
|
|
|
|
|
|
void setLine (int row, const juce::String& s);
|
|
|
|
|
void showCursor (bool show);
|
|
|
|
|
void clear();
|
|
|
|
|
void paint (juce::Graphics&) override;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
void timerCallback() override;
|
|
|
|
|
|
|
|
|
|
juce::String lines[kRows];
|
|
|
|
|
int cursorCol = 0;
|
|
|
|
|
int cursorRow = 0;
|
|
|
|
|
bool cursorVisible = false;
|
|
|
|
|
|
2026-09-12 21:53:16 +02:00
|
|
|
const uint8_t* getGlyph (juce::uint32 c) const;
|
2026-09-11 16:38:28 +02:00
|
|
|
|
|
|
|
|
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (LcdDisplay)
|
|
|
|
|
};
|