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

#include <PluginManager.h>

Inheritance diagram for PluginInterface::PluginManager:

Public Member Functions

 PluginManager ()
void createInstancesForValueTreeIfNeeded (juce::ValueTree pluginMenuTree)
void createInstanceForPluginTree (juce::ValueTree pluginValueTree)
juce::PluginDescription showPluginLoadingMenu ()
juce::PluginDescription showPluginLoadingMenu (juce::ValueTree pluginValueTree)
void removePlugin (juce::ValueTree pluginValueTree, bool partOfLargerAction=false)
void addPlugin (juce::PluginDescription newPluginDescription)
void replacePlugin (juce::PluginDescription newPluginDescription, juce::ValueTree oldPluginTree)
std::shared_ptr< PluginManagerInstancegetPluginInstanceForID (juce::String pluginID)
void timerCallback () override
Overrides juce::ValueTree::Listener
void valueTreePropertyChanged (juce::ValueTree &treeWhosePropertyHasChanged, const juce::Identifier &property) override
void valueTreeChildAdded (juce::ValueTree &parentTree, juce::ValueTree &childWhichHasBeenAdded) override
void valueTreeChildRemoved (juce::ValueTree &parentTree, juce::ValueTree &childWhichHasBeenRemoved, int indexFromWhichChildWasRemoved) override
void valueTreeChildOrderChanged (juce::ValueTree &parentTreeWhoseChildrenHaveMoved, int oldIndex, int newIndex) override

Static Public Member Functions

static std::shared_ptr< PluginManagergetInstance ()
static void open ()
static void close ()

Private Member Functions

void checkForZombiePluginInstances ()
juce::StringArray getPluginManufacturers ()
juce::PluginDescription showPluginLoadingMenu (bool showRemovePlugin, juce::ValueTree pluginValueTree)
int getPluginInstanceIndexForID (juce::String pluginID)
void addChildrenToPopupMenuRecursive (juce::PopupMenu *menuToChange, juce::ValueTree parentTree)
int findIndexForType (juce::PluginDescription type)
 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PluginManager)

Private Attributes

juce::Array< std::shared_ptr< PluginManagerInstance > > pluginInstances
juce::ValueTree projectValueTree
juce::Array< juce::PluginDescription > pluginsList

Static Private Attributes

static std::shared_ptr< PluginManagerinstance

Detailed Description

PluginManager is the class tasked with creating, destroying, and selecting plugin instances used for the user interface. It also contains functions for adding/removing plugins from the project ValueTree. Instances are stored inside the container class PluginManagerInstance, which is itself stored in a juce::Array.

PluginManager is stored as a static instance within itself. This class should never be instantiated manually. To use, open() needs to be called at startup, and close() needs to be called at shutdown. ALL interaction with this class must happen after open() and before close().

Constructor & Destructor Documentation

◆ PluginManager()

PluginInterface::PluginManager::PluginManager ( )

Initialize with the project ValueTree

Member Function Documentation

◆ addChildrenToPopupMenuRecursive()

void PluginInterface::PluginManager::addChildrenToPopupMenuRecursive ( juce::PopupMenu * menuToChange,
juce::ValueTree parentTree )
private

Recursively populates a juce::PopupMenu with the contents of a juce::ValueTree containing juce::PluginDescription info.

Parameters
menuToChangethe menu to add children to.
parentTreetree to add to menuToChange.

◆ addPlugin()

void PluginInterface::PluginManager::addPlugin ( juce::PluginDescription newPluginDescription)

Adds a plugin to the currently selected track, entirely via ValueTree. Instance will get created via timer.

Parameters
newPluginDescriptionPlugin type to add.

◆ checkForZombiePluginInstances()

void PluginInterface::PluginManager::checkForZombiePluginInstances ( )
private

Removes unneeded PluginManagerInstance items, creates missing ones if needed.

◆ close()

void PluginInterface::PluginManager::close ( )
inlinestatic

Called at shutdown. PluginManager requires open() to be called in order to be used after calling close()

◆ createInstanceForPluginTree()

void PluginInterface::PluginManager::createInstanceForPluginTree ( juce::ValueTree pluginValueTree)

Create instance for single plugin given its value tree

Parameters
pluginValueTreethe juce::ValueTree representing a single plugin, NOT a plugin menu.

◆ createInstancesForValueTreeIfNeeded()

void PluginInterface::PluginManager::createInstancesForValueTreeIfNeeded ( juce::ValueTree pluginMenuTree)

Create instances for all plugins in a track, given the pluginMenuTree

Parameters
pluginMenuTreethe juce::ValueTree that contains the track's plugins.

◆ findIndexForType()

int PluginInterface::PluginManager::findIndexForType ( juce::PluginDescription type)
private

Determines the first index of a juce::PluginDescription in pluginsList.

Parameters
typejuce::PluginDescription to find.

◆ getInstance()

std::shared_ptr< PluginManager > PluginInterface::PluginManager::getInstance ( )
inlinestatic

Return current instance of PluginManager. This will not return a valid pointer if open() has not been called.

◆ getPluginInstanceForID()

std::shared_ptr< PluginInterface::PluginManagerInstance > PluginInterface::PluginManager::getPluginInstanceForID ( juce::String pluginID)

Returns the PluginManagerInstance given a plugin's unique identifier. Returns nullptr if no instance exists.

Parameters
pluginIDUnique identifier of plugin instance to find.

◆ getPluginInstanceIndexForID()

int PluginInterface::PluginManager::getPluginInstanceIndexForID ( juce::String pluginID)
private

Finds the index within pluginInstances given a plugin's unique ID.

Parameters
pluginIDthe plugin's unique identifier.

◆ getPluginManufacturers()

juce::StringArray PluginInterface::PluginManager::getPluginManufacturers ( )
private

Returns a string array of plugin manufacturer names from juce::KnownPluginsList

◆ JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR()

PluginInterface::PluginManager::JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR ( PluginManager )
private

◆ open()

void PluginInterface::PluginManager::open ( )
inlinestatic

Creates new PluginManager instance. Must be called only once at startup. Must be called in order to use PluginManager.

◆ removePlugin()

void PluginInterface::PluginManager::removePlugin ( juce::ValueTree pluginValueTree,
bool partOfLargerAction = false )

Remove plugin ValueTree from its parent and discard.

Parameters
pluginValueTreeThe juce::ValueTree of the plugin to be removed.
partOfLargerActionIf true, creates an UndoManager transaction.

◆ replacePlugin()

void PluginInterface::PluginManager::replacePlugin ( juce::PluginDescription newPluginDescription,
juce::ValueTree oldPluginTree )

Replaces a plugin given its ValueTree

Parameters
newPluginDescriptionPlugin type to add.
oldPluginTreejuce::ValueTree to replace.

◆ showPluginLoadingMenu() [1/3]

juce::PluginDescription PluginInterface::PluginManager::showPluginLoadingMenu ( )

Show plugin loading menu for adding a new plugin

◆ showPluginLoadingMenu() [2/3]

juce::PluginDescription PluginInterface::PluginManager::showPluginLoadingMenu ( bool showRemovePlugin,
juce::ValueTree pluginValueTree )
private

Shows a model menu and returns a juce::PluginDescription matching the user's selection.

Parameters
showRemovePluginif true, shows a remove plugin menu option.
pluginValueTreethe juce::ValueTree representing the plugin to remove if 'remove' is chosen by the menu.

◆ showPluginLoadingMenu() [3/3]

juce::PluginDescription PluginInterface::PluginManager::showPluginLoadingMenu ( juce::ValueTree pluginValueTree)

Show plugin loading menu from existing plugin's context menu

Parameters
pluginValueTreeA juce::ValueTree representing a single plugin.

◆ timerCallback()

void PluginInterface::PluginManager::timerCallback ( )
override

Juce::Timer callback used to refresh plugin instances. Calls checkForZombiePluginInstances()

◆ valueTreeChildAdded()

void PluginInterface::PluginManager::valueTreeChildAdded ( juce::ValueTree & parentTree,
juce::ValueTree & childWhichHasBeenAdded )
override

Juce ValueTree listener function

◆ valueTreeChildOrderChanged()

void PluginInterface::PluginManager::valueTreeChildOrderChanged ( juce::ValueTree & parentTreeWhoseChildrenHaveMoved,
int oldIndex,
int newIndex )
override

Juce ValueTree listener function

◆ valueTreeChildRemoved()

void PluginInterface::PluginManager::valueTreeChildRemoved ( juce::ValueTree & parentTree,
juce::ValueTree & childWhichHasBeenRemoved,
int indexFromWhichChildWasRemoved )
override

Juce ValueTree listener function

◆ valueTreePropertyChanged()

void PluginInterface::PluginManager::valueTreePropertyChanged ( juce::ValueTree & treeWhosePropertyHasChanged,
const juce::Identifier & property )
override

Juce ValueTree listener function

Member Data Documentation

◆ instance

std::shared_ptr<PluginManager> PluginInterface::PluginManager::instance
inlinestaticprivate

Static instance of PluginManager, accessed via getInstance()

◆ pluginInstances

juce::Array<std::shared_ptr<PluginManagerInstance> > PluginInterface::PluginManager::pluginInstances
private

Array that stores plugin instances used for editor UI.

◆ pluginsList

juce::Array<juce::PluginDescription> PluginInterface::PluginManager::pluginsList
private

Local representation of global known plugin list.

◆ projectValueTree

juce::ValueTree PluginInterface::PluginManager::projectValueTree
private

Local object holding the project value tree so it's in scope for the Listener subclass.


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