foleys_gui_magic
WYSWYG editor for JUCE GUIs including Visualisers
Public Member Functions | List of all members
MagicFilterPlot Class Reference

This will plot the frequency responce for a juce IIR filter. More...

+ Inheritance diagram for MagicFilterPlot:

Public Member Functions

 MagicFilterPlot ()
 
void setIIRCoefficients (juce::dsp::IIR::Coefficients< float >::Ptr coefficients, float maxDB)
 Set new coefficients to calculate the frequency response from. More...
 
void setIIRCoefficients (float gain, std::vector< juce::dsp::IIR::Coefficients< float >::Ptr > coefficients, float maxDB)
 Set new coefficients to calculate the frequency response from. More...
 
void pushSamples (const juce::AudioBuffer< float > &buffer) override
 Does nothing in this class. More...
 
void createPlotPaths (juce::Path &path, juce::Path &filledPath, juce::Rectangle< float > bounds, MagicPlotComponent &component) override
 This is the callback that creates the plot for drawing. More...
 
void prepareToPlay (double sampleRate, int samplesPerBlockExpected) override
 This method is called by the MagicProcessorState to allow the plot computation to be set up. More...
 
- Public Member Functions inherited from MagicPlotSource
 MagicPlotSource ()=default
 
virtual ~MagicPlotSource ()=default
 
virtual bool isActive () const
 You can add an active state to your plot to allow to paint in different colours. More...
 
virtual void setActive (bool shouldBeActive)
 
juce::int64 getLastDataUpdate () const
 Use this information to invalidate your plot drawing. More...
 
void resetLastDataFlag ()
 Call this to invalidate the lastData flag. More...
 
virtual juce::TimeSliceClient * getBackgroundJob ()
 If your plot needs background processing, return here a pointer to your TimeSliceClient, and it will automatically be added to the common background thread. More...
 

Detailed Description

This will plot the frequency responce for a juce IIR filter.

To use it, add it to the MagicPluginState. It will automatically update each time you set new coefficients using setIIRCoefficients.

Constructor & Destructor Documentation

◆ MagicFilterPlot()

Member Function Documentation

◆ setIIRCoefficients() [1/2]

void setIIRCoefficients ( juce::dsp::IIR::Coefficients< float >::Ptr  coefficients,
float  maxDB 
)

Set new coefficients to calculate the frequency response from.

Parameters
coefficientsthe coefficients to calculate the frequency response for
sampleRateis the sampleRate the processing is happening with
maxDBis the maximum level in dB, that the curve will display

References MagicPlotSource::resetLastDataFlag().

◆ setIIRCoefficients() [2/2]

void setIIRCoefficients ( float  gain,
std::vector< juce::dsp::IIR::Coefficients< float >::Ptr >  coefficients,
float  maxDB 
)

Set new coefficients to calculate the frequency response from.

Parameters
gainthe overall added gain
coefficientsa vector of coefficients to sum up (multiply) to calculate the frequency response for
sampleRateis the sampleRate the processing is happening with
maxDBis the maximum level in dB, that the curve will display

References MagicPlotSource::resetLastDataFlag().

◆ pushSamples()

void pushSamples ( const juce::AudioBuffer< float > &  buffer)
overridevirtual

Does nothing in this class.

Implements MagicPlotSource.

◆ createPlotPaths()

void createPlotPaths ( juce::Path &  path,
juce::Path &  filledPath,
juce::Rectangle< float >  bounds,
MagicPlotComponent component 
)
overridevirtual

This is the callback that creates the plot for drawing.

Parameters
pathis the path instance that is constructed by the MagicPlotSource
filledPathis the path instance that is constructed by the MagicPlotSource to be filled
boundsthe bounds of the plot
componentgrants access to the plot component, e.g. to find the colours from it

Implements MagicPlotSource.

◆ prepareToPlay()

void prepareToPlay ( double  sampleRate,
int  samplesPerBlockExpected 
)
overridevirtual

This method is called by the MagicProcessorState to allow the plot computation to be set up.

Implements MagicPlotSource.


The documentation for this class was generated from the following files: