Video display and composing engine for JUCE
Loading...
Searching...
No Matches
OutlineBuffer Class Reference

This class implements a circular buffer to store min and max values of anaudio signal. More...

#include <OutlineBuffer.h>

Public Member Functions

 OutlineBuffer ()
 
void setSize (const int numChannels, const int numBlocks)
 
void setSamplesPerBlock (const int numSamples)
 
void pushBlock (const juce::AudioBuffer< float > &buffer, const int numSamples)
 Push a block of audio samples into the outline buffer.
 
void getChannelOutline (juce::Path &path, const juce::Rectangle< float > bounds, const int channel, const int numSamples) const
 Returns the outline of a specific channel inside the bounds.
 
void getChannelOutline (juce::Path &path, const juce::Rectangle< float > bounds, const int numSamples) const
 This returns the outlines of each channel, splitting the bounds into equal sized rows.
 

Detailed Description

This class implements a circular buffer to store min and max values of anaudio signal.

The block size can be specified. At any time the UI can request an outline of the last n blocks as Path to fill or stroke

Constructor & Destructor Documentation

◆ OutlineBuffer()

Member Function Documentation

◆ setSize()

void setSize ( const int  numChannels,
const int  numBlocks 
)
Parameters
numChannelsis the number of channels the buffer will store
numBlocksis the number of values the buffer will store. Allow a little safety buffer, so you don't write into the part, where it is currently read

◆ setSamplesPerBlock()

void setSamplesPerBlock ( const int  numSamples)
Parameters
numSamplessets the size of each analysed block

◆ pushBlock()

void pushBlock ( const juce::AudioBuffer< float > &  buffer,
const int  numSamples 
)

Push a block of audio samples into the outline buffer.

◆ getChannelOutline() [1/2]

void getChannelOutline ( juce::Path &  path,
const juce::Rectangle< float >  bounds,
const int  channel,
const int  numSamples 
) const

Returns the outline of a specific channel inside the bounds.

Parameters
pathis a Path to be populated
boundsthe rectangle to paint within. The result is not clipped, if samples are exceeding 1.0, it may paint outside
channelthe index of the channel to paint
numSamplesis the number of sample blocks
Returns
a path with a single channel outline (min to max)

Referenced by OutlineBuffer::getChannelOutline().

◆ getChannelOutline() [2/2]

void getChannelOutline ( juce::Path &  path,
const juce::Rectangle< float >  bounds,
const int  numSamples 
) const

This returns the outlines of each channel, splitting the bounds into equal sized rows.

Parameters
pathis a Path to be populated
boundsthe rectangle to paint within. The result is not clipped, if samples are exceeding 1.0, it may paint outside
numSamplesis the number of sample blocks
Returns
a path with a single channel outline (min to max)

References OutlineBuffer::getChannelOutline().


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