WYSWYG editor for JUCE GUIs including Visualisers
Loading...
Searching...
No Matches
MagicPlotSource Class Referenceabstract

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

#include <foleys_MagicPlotSource.h>

+ 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.
 
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.
 
virtual void prepareToPlay (double sampleRate, int samplesPerBlockExpected)=0
 This method is called by the MagicProcessorState to allow the plot computation to be set up.
 
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.
 
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.
 

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 MagicAnalyser, MagicFilterPlot, and MagicOscilloscope.

◆ 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 MagicAnalyser, MagicFilterPlot, and MagicOscilloscope.

◆ 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 MagicAnalyser, MagicFilterPlot, and MagicOscilloscope.

◆ 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 ( )

◆ 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.

Referenced by MagicGUIState::addBackgroundProcessing().


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