mirror of
https://codeberg.org/armin/monostep.git
synced 2026-09-01 04:10:46 +02:00
Polish GUI, add pattern retrig option, and rework voice DSP
This commit is contained in:
parent
8ed279e84c
commit
4732240cc7
7 changed files with 546 additions and 129 deletions
|
|
@ -66,6 +66,22 @@ void SequencerMatrix::paint (juce::Graphics& g)
|
|||
const float ox = (float) bounds.getX();
|
||||
const float oy = (float) bounds.getY();
|
||||
|
||||
// Slightly-3D header band above the grid.
|
||||
juce::ColourGradient headerGrad (colours::gridLight,
|
||||
0.0f, 0.0f,
|
||||
colours::panel.darker (0.10f),
|
||||
0.0f, headerH, false);
|
||||
g.setGradientFill (headerGrad);
|
||||
g.fillRect (0.0f, 0.0f, (float) getWidth(), headerH);
|
||||
|
||||
g.setColour (colours::gridLight.brighter (0.3f).withAlpha (0.4f));
|
||||
g.fillRect (0.0f, 0.0f, (float) getWidth(), 1.0f);
|
||||
|
||||
g.setColour (colours::grid);
|
||||
g.drawHorizontalLine (juce::roundToInt (headerH) - 1, 0, (float) getWidth());
|
||||
g.setColour (colours::bg);
|
||||
g.drawHorizontalLine (juce::roundToInt (headerH), 0, (float) getWidth());
|
||||
|
||||
// grid background
|
||||
g.setColour (colours::bg);
|
||||
g.fillRect (bounds.toFloat());
|
||||
|
|
@ -156,28 +172,21 @@ void SequencerMatrix::paint (juce::Graphics& g)
|
|||
const bool isSelected = (i == selectedStep);
|
||||
const float radius = 3.0f;
|
||||
|
||||
// cell body
|
||||
juce::ColourGradient grad (colours::accent,
|
||||
cell.getTopLeft().translated (cell.getWidth() * 0.5f, 0.0f),
|
||||
isSelected ? colours::accent.brighter (0.12f) : colours::accent.darker (0.35f),
|
||||
cell.getBottomLeft().translated (cell.getWidth() * 0.5f, 0.0f),
|
||||
false);
|
||||
// cell body: keep a visible top->bottom gradient in both states. The selected
|
||||
// note is brighter overall, but still holds its gradient (a flat bright fill
|
||||
// would read as "no gradient").
|
||||
const juce::Colour noteTop = isSelected ? colours::accent.brighter (0.2f) : colours::accent;
|
||||
const juce::Colour noteBottom = colours::accent.darker (0.3f);
|
||||
|
||||
juce::ColourGradient grad (noteTop,
|
||||
cell.getTopLeft().translated (cell.getWidth() * 0.5f, 0.0f),
|
||||
noteBottom,
|
||||
cell.getBottomLeft().translated (cell.getWidth() * 0.5f, 0.0f),
|
||||
false);
|
||||
|
||||
g.setGradientFill (grad);
|
||||
g.fillRoundedRectangle (cell, radius);
|
||||
|
||||
// slide arrow
|
||||
if (s.slide)
|
||||
{
|
||||
const float ax = cell.getX() + cell.getWidth() * 0.5f;
|
||||
const float ay = cell.getY() + cell.getHeight() - 4.0f;
|
||||
|
||||
g.setColour (colours::selected);
|
||||
juce::Path tri;
|
||||
tri.addTriangle (ax - 3.5f, ay - 1.5f, ax + 3.5f, ay - 1.5f, ax, ay + 3.5f);
|
||||
g.fillPath (tri);
|
||||
}
|
||||
|
||||
// fine-tune indicator
|
||||
if (std::fabs (s.cents) > 0.5f)
|
||||
{
|
||||
|
|
@ -206,9 +215,15 @@ void SequencerMatrix::paint (juce::Graphics& g)
|
|||
continue;
|
||||
|
||||
const auto cell = juce::Rectangle<float> (ox + i * cellW + 1.5f, slideY + 1.5f,
|
||||
cellW - 3.0f, cellH - 3.0f);
|
||||
cellW - 3.0f, cellH - 3.0f);
|
||||
|
||||
g.setColour (colours::accent);
|
||||
// match the gradient style of the note cells
|
||||
juce::ColourGradient grad (colours::accent,
|
||||
cell.getTopLeft().translated (cell.getWidth() * 0.5f, 0.0f),
|
||||
colours::accent.darker (0.3f),
|
||||
cell.getBottomLeft().translated (cell.getWidth() * 0.5f, 0.0f),
|
||||
false);
|
||||
g.setGradientFill (grad);
|
||||
g.fillRoundedRectangle (cell, 3.0f);
|
||||
|
||||
const float ax = cell.getX() + cell.getWidth() * 0.5f;
|
||||
|
|
@ -241,7 +256,15 @@ void SequencerMatrix::paint (juce::Graphics& g)
|
|||
const auto cell = juce::Rectangle<float> (ox + i * cellW + 1.5f, accentY + 1.5f,
|
||||
cellW - 3.0f, cellH - 3.0f);
|
||||
|
||||
g.setColour (colours::accent2);
|
||||
const bool isSelected = (i == selectedStep);
|
||||
|
||||
juce::ColourGradient agrad (isSelected ? colours::accent2.brighter (0.2f) : colours::accent2,
|
||||
cell.getTopLeft().translated (cell.getWidth() * 0.5f, 0.0f),
|
||||
colours::accent2.darker (0.3f),
|
||||
cell.getBottomLeft().translated (cell.getWidth() * 0.5f, 0.0f),
|
||||
false);
|
||||
|
||||
g.setGradientFill (agrad);
|
||||
g.fillRoundedRectangle (cell, 3.0f);
|
||||
|
||||
const float ax = cell.getX() + cell.getWidth() * 0.5f;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue