Expand preset bank to 128 categorized presets, shorten sync delays, add menu UI polish and hold-to-repeat nav

This commit is contained in:
Armin 2026-09-13 21:19:49 +02:00
commit 78e8ee80ad
10 changed files with 761 additions and 413 deletions

View file

@ -11,7 +11,7 @@ constexpr uint8_t kFont[95][8] =
{10,10,10,0,0,0,0,0}, // "
{0,10,31,10,31,10,0,0}, // #
{4,15,20,14,5,30,4,0}, // $
{2,4,8,16,14,17,14,0}, // %
{3,3,8,4,2,1,24,24}, // %
{8,20,20,8,21,18,13,0}, // &
{4,4,4,0,0,0,0,0}, // '
{2,4,8,8,8,4,2,0}, // (
@ -82,7 +82,7 @@ constexpr uint8_t kFont[95][8] =
{0,6,0,4,4,4,4,0}, // i
{0,6,0,4,4,4,8,0}, // j
{0,0,16,18,20,24,20,0}, // k
{0,0,12,4,4,4,4,0}, // l
{0,4,4,4,4,4,4,14}, // l
{0,0,26,21,21,21,21,0}, // m
{0,0,18,29,17,17,17,0}, // n
{0,0,14,17,17,17,14,0}, // o
@ -117,12 +117,21 @@ void LcdDisplay::setLine (int row, const juce::String& s)
lines[row] = s;
}
void LcdDisplay::setInverted (int row, bool inverted)
{
if (row >= 0 && row < kRows)
rowInverted[row] = inverted;
}
void LcdDisplay::showCursor (bool show) { cursorVisible = show; }
void LcdDisplay::clear()
{
for (int r = 0; r < kRows; ++r)
{
lines[r] = "";
rowInverted[r] = false;
}
cursorCol = 0;
cursorRow = 0;
cursorVisible = false;
@ -140,10 +149,11 @@ void LcdDisplay::paint (juce::Graphics& g)
const float w = (float) getWidth();
const float h = (float) getHeight();
const juce::Colour bgCol (0xFF0D1A05);
const juce::Colour pixOn (0xFF4AE038);
const juce::Colour pixOnDim (0xFF1E3A12);
const juce::Colour pixOff (0xFF0F1C07);
const juce::Colour bgCol (0xFF000000);
const juce::Colour pixOn (0xFFE2E2E2);
const juce::Colour pixOnDim (0xFF303030);
const juce::Colour pixOff (0xFF0A0A0A);
const juce::Colour pixInvert (0xFF8A8A8A);
g.fillAll (bgCol);
@ -173,6 +183,7 @@ void LcdDisplay::paint (juce::Graphics& g)
for (int row = 0; row < kRows; ++row)
{
const bool inverted = rowInverted[row];
const juce::String& line = lines[row];
for (int col = 0; col < kCols; ++col)
{
@ -182,7 +193,7 @@ void LcdDisplay::paint (juce::Graphics& g)
float cx = ox + (float) col * cw;
float cy = oy + (float) row * ch;
g.setColour (pixOff);
g.setColour (inverted ? pixInvert : pixOff);
g.fillRect (cx + 0.5f, cy + 0.5f, cw - 1.0f, ch - 1.0f);
float gridX = cx + padX + (gw - cellW * gridW) * 0.5f;
@ -199,16 +210,24 @@ void LcdDisplay::paint (juce::Graphics& g)
float px = gridX + (float) gCol * stepX;
float py = gridY + (float) gRow * stepY;
g.setColour (pixOnDim);
g.fillRect (px - cellW * 0.10f, py - cellH * 0.05f,
cellW * 1.20f, cellH * 1.10f);
g.setColour (pixOn);
g.fillRect (px, py, cellW, cellH);
if (inverted)
{
g.setColour (pixOff);
g.fillRect (px, py, cellW, cellH);
}
else
{
g.setColour (pixOnDim);
g.fillRect (px - cellW * 0.10f, py - cellH * 0.05f,
cellW * 1.20f, cellH * 1.10f);
g.setColour (pixOn);
g.fillRect (px, py, cellW, cellH);
}
}
}
}
if (blinkOn && col == cursorCol && row == cursorRow)
if (blinkOn && ! inverted && col == cursorCol && row == cursorRow)
{
g.setColour (pixOn);
g.fillRect (cx + padX, cy + ch - padY - ch * 0.22f, cw - padX * 2.0f, ch * 0.18f);