Files
serumalt/Source/GUI/LFODisplay.h
T
biggy 4b0db50271 refactor(source): move every implementation into its module directory
- 36 files move into the module whose AGENTS.md already claimed them:
  Engine/, Synth/, Modulation/, Params/, Plugin/, GUI/, EffectUnits/, Resources/
- Source/engine, modulation, params, plugin and synth become Engine,
  Modulation, Params, Plugin and Synth, matching the directories that already
  hold code
- ExactCompare.h stays at the Source/ root as the one shared header
- SERUMALT_INCLUDE_DIRS adds one include directory per module, so the 31
  parent-relative includes become plain names with no path prefix
- the module AGENTS.md files list owned files instead of describing a move
  that had not happened, and README.md and AGENTS.md describe the real tree

Verified: the harness passes CTest, the Linux VST3 and Standalone link, the
Windows cross-build passes its module checks, each configure exposes only its
own targets, no first-party warning line appears, and the generated Windows
manifest is unchanged.
2026-10-06 09:17:49 +02:00

48 lines
1.8 KiB
C++

#pragma once
#include <JuceHeader.h>
#include "Resources.h"
#include "Params.h"
#include "LFO.h"
namespace serum
{
// ===========================================================================
// LFO shape view. Step-sequencer and freehand shapes are click/drag editable.
// The preview evaluates the same lfoShapeValue() function as the audio path, so
// the drawn shape cannot drift from the sound. Sample and hold has no phase
// function (the audio level is stateful), so its preview is a labelled
// schematic rather than a fabricated sequence.
// ===========================================================================
class LFODisplay : public juce::Component
{
public:
void setShape (int s) { if (shape != s) { shape = s; repaint(); } }
void setShapeData (const std::vector<float>& data, int steps);
void setOnShapeEdited (std::function<void (const std::vector<float>&, int)> cb) { onEdited = std::move (cb); }
void paint (juce::Graphics& g) override;
void mouseDown (const juce::MouseEvent& e) override;
void mouseDrag (const juce::MouseEvent& e) override;
// Level the sample-and-hold preview draws. The audio LFO holds a level that
// the display cannot observe on the message thread, so the preview shows a
// flat schematic line at this value instead of inventing a sequence.
static constexpr float kSampleHoldLevel = 0.0f;
// Value of the current shape at `phase` (0..1); the audio path calls the
// same lfoShapeValue() with its live sample-and-hold level.
float valueAt (float phase) const noexcept;
private:
int shape = 0;
std::vector<float> shapeData;
int steps = 16;
std::function<void (const std::vector<float>&, int)> onEdited;
void editAt (float x, float y);
};
} // namespace serum