Photosine 0.5
Loading...
Searching...
No Matches

#include <PluginPool.h>

Classes

struct  Reservation

Public Member Functions

 PluginPool ()
 ~PluginPool ()
void initialize (int numThreads, int numChannels, juce::ValueTree valueTreeToLoad)
bool isInitialized ()
Reservation getNextReservation ()
void releaseReservation (Reservation arrayToRelease)

Private Member Functions

 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PluginPool)

Private Attributes

juce::OwnedArray< juce::OwnedArray< juce::OwnedArray< juce::AudioPluginInstance > > > internalPool
std::mutex internalPoolMutex
juce::Array< int > freeIndexes
std::mutex freeIndexesMutex
std::condition_variable freeIndexesCv
int maxThreads
int channels
bool pluginsFree = true
juce::ValueTree pluginListTree
bool pluginPoolPrepared = false

Detailed Description

Manages a pool of plugin instances in order to reduce the performance cost of creating a new instance per process. Instances are accessed by getting a PluginPool::Reservation via getNextReservation(). When a reservation is done being used, it should be released via releaseReservation().

internalPool structure:

  • Main Array
    • Plugin Chosen by List (Child Array)
      • Red Instance
      • Green Instance
      • Blue Instance
    • Another Plugin Chosen by List (Child Array)
      • Red Instance
      • Green Instance
      • Blue Instance

Constructor & Destructor Documentation

◆ PluginPool()

ImageProcessing::PluginPool::PluginPool ( )

◆ ~PluginPool()

ImageProcessing::PluginPool::~PluginPool ( )

Member Function Documentation

◆ getNextReservation()

ImageProcessing::PluginPool::Reservation ImageProcessing::PluginPool::getNextReservation ( )

Creates and returns a new reservation.

◆ initialize()

void ImageProcessing::PluginPool::initialize ( int numThreads,
int numChannels,
juce::ValueTree valueTreeToLoad )

Creates plugin instances for a plugin list value tree.

Parameters
numThreadsThe total number of Reservations that will be allowed at one time. Or the amount of multiples of valueTreeToLoad
numChannelsThe total number of instances that should be made per plugin per list.
valueTreeToLoadA value tree representing a plugin list.

◆ isInitialized()

bool ImageProcessing::PluginPool::isInitialized ( )

Returns true if initialize() has been called already.

◆ JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR()

ImageProcessing::PluginPool::JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR ( PluginPool )
private

◆ releaseReservation()

void ImageProcessing::PluginPool::releaseReservation ( Reservation arrayToRelease)

Releases a reservation which was previously acquired via getNextReservation().

Member Data Documentation

◆ channels

int ImageProcessing::PluginPool::channels
private

◆ freeIndexes

juce::Array<int> ImageProcessing::PluginPool::freeIndexes
private

◆ freeIndexesCv

std::condition_variable ImageProcessing::PluginPool::freeIndexesCv
private

◆ freeIndexesMutex

std::mutex ImageProcessing::PluginPool::freeIndexesMutex
private

◆ internalPool

juce::OwnedArray<juce::OwnedArray<juce::OwnedArray<juce::AudioPluginInstance> > > ImageProcessing::PluginPool::internalPool
private

◆ internalPoolMutex

std::mutex ImageProcessing::PluginPool::internalPoolMutex
private

◆ maxThreads

int ImageProcessing::PluginPool::maxThreads
private

◆ pluginListTree

juce::ValueTree ImageProcessing::PluginPool::pluginListTree
private

◆ pluginPoolPrepared

bool ImageProcessing::PluginPool::pluginPoolPrepared = false
private

◆ pluginsFree

bool ImageProcessing::PluginPool::pluginsFree = true
private

The documentation for this class was generated from the following files:
  • /Users/cliftonmarien/Documents/Photosine/Photosine/Source/ImageProcessing/PluginPool.h
  • /Users/cliftonmarien/Documents/Photosine/Photosine/Source/ImageProcessing/PluginPool.cpp