|
Photosine 0.5
|
#include <PluginManager.h>
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< PluginManagerInstance > | getPluginInstanceForID (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< PluginManager > | getInstance () |
| 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< PluginManager > | instance |
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().
| PluginInterface::PluginManager::PluginManager | ( | ) |
Initialize with the project ValueTree
|
private |
Recursively populates a juce::PopupMenu with the contents of a juce::ValueTree containing juce::PluginDescription info.
| menuToChange | the menu to add children to. |
| parentTree | tree to add to menuToChange. |
| void PluginInterface::PluginManager::addPlugin | ( | juce::PluginDescription | newPluginDescription | ) |
Adds a plugin to the currently selected track, entirely via ValueTree. Instance will get created via timer.
| newPluginDescription | Plugin type to add. |
|
private |
Removes unneeded PluginManagerInstance items, creates missing ones if needed.
|
inlinestatic |
Called at shutdown. PluginManager requires open() to be called in order to be used after calling close()
| void PluginInterface::PluginManager::createInstanceForPluginTree | ( | juce::ValueTree | pluginValueTree | ) |
Create instance for single plugin given its value tree
| pluginValueTree | the juce::ValueTree representing a single plugin, NOT a plugin menu. |
| void PluginInterface::PluginManager::createInstancesForValueTreeIfNeeded | ( | juce::ValueTree | pluginMenuTree | ) |
Create instances for all plugins in a track, given the pluginMenuTree
| pluginMenuTree | the juce::ValueTree that contains the track's plugins. |
|
private |
Determines the first index of a juce::PluginDescription in pluginsList.
| type | juce::PluginDescription to find. |
|
inlinestatic |
Return current instance of PluginManager. This will not return a valid pointer if open() has not been called.
| 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.
| pluginID | Unique identifier of plugin instance to find. |
|
private |
Finds the index within pluginInstances given a plugin's unique ID.
| pluginID | the plugin's unique identifier. |
|
private |
Returns a string array of plugin manufacturer names from juce::KnownPluginsList
|
private |
|
inlinestatic |
Creates new PluginManager instance. Must be called only once at startup. Must be called in order to use PluginManager.
| void PluginInterface::PluginManager::removePlugin | ( | juce::ValueTree | pluginValueTree, |
| bool | partOfLargerAction = false ) |
Remove plugin ValueTree from its parent and discard.
| pluginValueTree | The juce::ValueTree of the plugin to be removed. |
| partOfLargerAction | If true, creates an UndoManager transaction. |
| void PluginInterface::PluginManager::replacePlugin | ( | juce::PluginDescription | newPluginDescription, |
| juce::ValueTree | oldPluginTree ) |
Replaces a plugin given its ValueTree
| newPluginDescription | Plugin type to add. |
| oldPluginTree | juce::ValueTree to replace. |
| juce::PluginDescription PluginInterface::PluginManager::showPluginLoadingMenu | ( | ) |
Show plugin loading menu for adding a new plugin
|
private |
Shows a model menu and returns a juce::PluginDescription matching the user's selection.
| showRemovePlugin | if true, shows a remove plugin menu option. |
| pluginValueTree | the juce::ValueTree representing the plugin to remove if 'remove' is chosen by the menu. |
| juce::PluginDescription PluginInterface::PluginManager::showPluginLoadingMenu | ( | juce::ValueTree | pluginValueTree | ) |
Show plugin loading menu from existing plugin's context menu
| pluginValueTree | A juce::ValueTree representing a single plugin. |
|
override |
Juce::Timer callback used to refresh plugin instances. Calls checkForZombiePluginInstances()
|
override |
Juce ValueTree listener function
|
override |
Juce ValueTree listener function
|
override |
Juce ValueTree listener function
|
override |
Juce ValueTree listener function
|
inlinestaticprivate |
Static instance of PluginManager, accessed via getInstance()
|
private |
Array that stores plugin instances used for editor UI.
|
private |
Local representation of global known plugin list.
|
private |
Local object holding the project value tree so it's in scope for the Listener subclass.