terion/Source/VectorScope.h

32 lines
962 B
C
Raw Permalink Normal View History

2026-09-16 17:47:45 +02:00
#pragma once
#include <juce_audio_processors/juce_audio_processors.h>
#include <juce_opengl/juce_opengl.h>
#include "PluginProcessor.h"
class VectorScope : public juce::Component, private juce::Timer
{
public:
explicit VectorScope(TerionProcessor& p);
~VectorScope() override;
void paint(juce::Graphics& g) override;
void resized() override;
void timerCallback() override;
float getRadius() const;
void setScale(float s) { currentScale = s; }
2026-09-16 17:47:45 +02:00
private:
TerionProcessor& processor;
float currentScale = 1.0f;
2026-09-16 17:47:45 +02:00
juce::Image trail;
2026-09-17 11:29:01 +02:00
StereoMetrics cachedMetrics;
int metricFrame = 0;
static constexpr int kMetricsRateHz = 2;
2026-09-16 17:47:45 +02:00
void drawLegends(juce::Graphics& g, float cx, float cy, float radius);
void drawHairCross(juce::Graphics& g, float cx, float cy);
void drawMetricsOverlay(juce::Graphics& g, const juce::Rectangle<int>& bounds);
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(VectorScope)
};