mirror of
https://codeberg.org/armin/ambivalence.git
synced 2026-09-01 04:10:48 +02:00
42 lines
No EOL
1.3 KiB
C++
42 lines
No EOL
1.3 KiB
C++
#pragma once
|
|
#include <JuceHeader.h>
|
|
#include "../PluginProcessor.h"
|
|
#include "AmbivalenceUI.h"
|
|
|
|
class DecayCurveViz : public juce::Component, private juce::Timer {
|
|
public:
|
|
DecayCurveViz();
|
|
~DecayCurveViz() override;
|
|
|
|
void setProcessor(FDNReverbAudioProcessor* p) noexcept { processor = p; }
|
|
void paint(juce::Graphics& g) override;
|
|
void resized() override;
|
|
|
|
private:
|
|
void timerCallback() override;
|
|
|
|
// --- time axis -----------------------------------------------
|
|
// time axis :
|
|
// 0~splitSec : plotW x splitRatio width expanded
|
|
// splitSec~max: width
|
|
// ER(0~200ms) 2
|
|
float timeToX(float timeSec, float plotX, float plotW,
|
|
float maxTimeSec) const noexcept;
|
|
|
|
FDNReverbAudioProcessor* processor{ nullptr };
|
|
|
|
float cachedRT60Mid{ 1.0f };
|
|
int cachedERTapCount{ 0 };
|
|
bool cachedERBypassed{ false };
|
|
|
|
static constexpr int MAX_DISPLAY_TAPS = 12;
|
|
std::array<float, MAX_DISPLAY_TAPS> cachedERDelayMs;
|
|
std::array<float, MAX_DISPLAY_TAPS> cachedERGains;
|
|
|
|
// --- time axis setting ---
|
|
// splitSec below time splitRatio width expanded
|
|
static constexpr float splitSec = 0.20f; // 0~200ms expanded
|
|
static constexpr float splitRatio = 0.30f; // full width 30% ER zone
|
|
|
|
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(DecayCurveViz)
|
|
}; |