mirror of
https://codeberg.org/armin/sm-26.git
synced 2026-10-11 17:01:53 +02:00
SM-26 synthesizer: initial implementation
This commit is contained in:
commit
8734ac25f1
18 changed files with 2619 additions and 0 deletions
42
Source/LcdDisplay.h
Normal file
42
Source/LcdDisplay.h
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
#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;
|
||||
|
||||
static constexpr int kCharW = 6;
|
||||
static constexpr int kCharH = 9;
|
||||
|
||||
juce::String lines[kRows];
|
||||
int cursorCol = 0;
|
||||
int cursorRow = 0;
|
||||
bool cursorVisible = false;
|
||||
|
||||
struct GlyphCache {
|
||||
uint8_t rows[8] = {};
|
||||
bool cached = false;
|
||||
};
|
||||
|
||||
GlyphCache glyphCache[256];
|
||||
|
||||
void rasterize (juce::uint32 c);
|
||||
uint8_t* getGlyph (juce::uint32 c);
|
||||
juce::Font getMonoFont() const;
|
||||
|
||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (LcdDisplay)
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue