WYSWYG editor for JUCE GUIs including Visualisers
Loading...
Searching...
No Matches
MagicAnalyser Class Reference

This will plot the magnitudes of the frequencies in a signal. More...

#include <foleys_MagicAnalyser.h>

+ Inheritance diagram for MagicAnalyser:

Public Member Functions

 MagicAnalyser (int channel=-1)
 Creates a MagicAnalyser, that will calculate a frequency plot (FFT) each time new samples occur.
 
void pushSamples (const juce::AudioBuffer< float > &buffer) override
 Push new samples to the buffer, so a background worker can create a frequency plot of it.
 
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.
 
void prepareToPlay (double sampleRate, int samplesPerBlockExpected) override
 This method is called by the MagicProcessorState to allow the plot computation to be set up.
 
juce::TimeSliceClient * getBackgroundJob () override
 If your plot needs background processing, return here a pointer to your TimeSliceClient, and it will automatically be added to the common background thread.
 
- 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.
 
virtual void setActive (bool shouldBeActive)
 
juce::int64 getLastDataUpdate () const
 Use this information to invalidate your plot drawing.
 
void resetLastDataFlag ()
 Call this to invalidate the lastData flag.
 

Detailed Description

This will plot the magnitudes of the frequencies in a signal.

The processing happens in a worker thread to keep the audio thread free.

Constructor & Destructor Documentation

◆ MagicAnalyser()

MagicAnalyser ( int channel = -1)

Creates a MagicAnalyser, that will calculate a frequency plot (FFT) each time new samples occur.

Parameters
channellets you select the channel to analyse. -1 means summing all together (the default)

Member Function Documentation

◆ pushSamples()

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

Push new samples to the buffer, so a background worker can create a frequency plot of it.

Parameters
bufferthe buffer of new audio

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.

◆ getBackgroundJob()

juce::TimeSliceClient * getBackgroundJob ( )
overridevirtual

If your plot needs background processing, return here a pointer to your TimeSliceClient, and it will automatically be added to the common background thread.

Reimplemented from MagicPlotSource.


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