31 lines
790 B
C++
31 lines
790 B
C++
#pragma once
|
|
|
|
#include <JuceHeader.h>
|
|
#include "../Resources.h"
|
|
#include "../Params.h"
|
|
|
|
namespace serum
|
|
{
|
|
|
|
// ===========================================================================
|
|
// Filter frequency-response view (magnitude vs log frequency).
|
|
// ===========================================================================
|
|
class FilterDisplay : public juce::Component
|
|
{
|
|
public:
|
|
void setParams (int type, float cutoff, float res, float drive, int slope);
|
|
void setEnabled (bool e) { enabled = e; }
|
|
|
|
void paint (juce::Graphics& g) override;
|
|
|
|
static float magnitude (float freqHz, float cutoffHz, float res, int type);
|
|
|
|
private:
|
|
int type = 0;
|
|
float cutoff = 0.5f, res = 0.0f, drive = 0.0f;
|
|
int slope = 2;
|
|
bool enabled = true;
|
|
};
|
|
|
|
} // namespace serum
|