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

The MagicPlotSources act as an interface, so the GUI can visualise an arbitrary plot of data. More...

+ Inheritance diagram for MagicPlotSource:

Public Member Functions

 MagicPlotSource ()=default
 
virtual ~MagicPlotSource ()=default
 
virtual void pushSamples (const juce::AudioBuffer< float > &buffer)=0
 This is the callback whenever new sample data arrives. More...
 
virtual void createPlotPaths (juce::Path &path, juce::Path &filledPath, juce::Rectangle< float > bounds, MagicPlotComponent &component)=0
 This is the callback that creates the plot for drawing. More...
 
virtual void prepareToPlay (double sampleRate, int samplesPerBlockExpected)=0
 This method is called by the MagicProcessorState to allow the plot computation to be set up. More...
 
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

The MagicPlotSources act as an interface, so the GUI can visualise an arbitrary plot of data.

To create a specific new plot, create a subclass and implement drawPlot.

Constructor & Destructor Documentation

◆ MagicPlotSource()

MagicPlotSource ( )
default

◆ ~MagicPlotSource()

virtual ~MagicPlotSource ( )
virtualdefault

Member Function Documentation

◆ pushSamples()

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

This is the callback whenever new sample data arrives.

It is the subclasses responsibility to put that into a FIFO and return as quickly as possible.

Implemented in MagicOscilloscope, MagicFilterPlot, and MagicAnalyser.

◆ createPlotPaths()

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

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

Implemented in MagicOscilloscope, MagicFilterPlot, and MagicAnalyser.

◆ prepareToPlay()

virtual void prepareToPlay ( double  sampleRate,
int  samplesPerBlockExpected 
)
pure virtual

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

Implemented in MagicOscilloscope, MagicFilterPlot, and MagicAnalyser.

◆ isActive()

virtual bool isActive ( ) const
virtual

You can add an active state to your plot to allow to paint in different colours.

◆ setActive()

virtual void setActive ( bool  shouldBeActive)
virtual

◆ getLastDataUpdate()

juce::int64 getLastDataUpdate ( ) const

Use this information to invalidate your plot drawing.

◆ resetLastDataFlag()

void resetLastDataFlag ( )

Call this to invalidate the lastData flag.

Referenced by MagicOscilloscope::pushSamples(), and MagicFilterPlot::setIIRCoefficients().

◆ getBackgroundJob()

virtual juce::TimeSliceClient* getBackgroundJob ( )
virtual

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 in MagicAnalyser.


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