JUCE: KnownPluginList Class Reference

JUCE

Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
KnownPluginList Class Reference
juce_audio_processors » scanning

Manages a list of plugin types. More...

`#include <juce_KnownPluginList.h>`

Inheritance diagram for KnownPluginList:

## Classes
class | CustomScanner
| Class to define a custom plugin scanner. More...
struct | PluginTree
| A structure that recursively holds a tree of plugins. More...

## Public Types
enum | SortMethod { defaultOrder = 0 , sortAlphabetically , sortByCategory , sortByManufacturer , sortByFormat , sortByFileSystemLocation , sortByInfoUpdateTime }
| Sort methods used to change the order of the plugins in the list. More...

## Public Member Functions
| KnownPluginList ()
| Creates an empty list. More...
| ~KnownPluginList () override
| Destructor. More...
void | clear ()
| Clears the list. More...
bool | addType (const PluginDescription &type)
| Adds a type manually from its description. More...
void | removeType (const PluginDescription &type)
| Removes a type. More...
int | getNumTypes () const noexcept
| Returns the number of types currently in the list. More...
Array< PluginDescription > | getTypes () const
| Returns a copy of the current list. More...
Array< PluginDescription > | getTypesForFormat (AudioPluginFormat &) const
| Returns the subset of plugin types for a given format. More...
std::unique_ptr< PluginDescription > | getTypeForFile (const String &fileOrIdentifier) const
| Looks for a type in the list which comes from this file. More...
std::unique_ptr< PluginDescription > | getTypeForIdentifierString (const String &identifierString) const
| Looks for a type in the list which matches a plugin type ID. More...
bool | scanAndAddFile (const String &possiblePluginFileOrIdentifier, bool dontRescanIfAlreadyInList, OwnedArray< PluginDescription > &typesFound, AudioPluginFormat &formatToUse)
| Looks for all types that can be loaded from a given file, and adds them to the list. More...
void | scanFinished ()
| Tells a custom scanner that a scan has finished, and it can release any resources. More...
bool | isListingUpToDate (const String &possiblePluginFileOrIdentifier, AudioPluginFormat &formatToUse) const
| Returns true if the specified file is already known about and if it hasn't been modified since our entry was created. More...
void | scanAndAddDragAndDroppedFiles (AudioPluginFormatManager &formatManager, const StringArray &filenames, OwnedArray< PluginDescription > &typesFound)
| Scans and adds a bunch of files that might have been dragged-and-dropped. More...
const StringArray & | getBlacklistedFiles () const
| Returns the list of blacklisted files. More...
void | addToBlacklist (const String &pluginID)
| Adds a plugin ID to the black-list. More...
void | removeFromBlacklist (const String &pluginID)
| Removes a plugin ID from the black-list. More...
void | clearBlacklistedFiles ()
| Clears all the blacklisted files. More...
void | sort (SortMethod method, bool forwards)
| Sorts the list. More...
std::unique_ptr< XmlElement > | createXml () const
| Creates some XML that can be used to store the state of this list. More...
void | recreateFromXml (const XmlElement &xml)
| Recreates the state of this list from its stored XML format. More...
void | setCustomScanner (std::unique_ptr< CustomScanner > newScanner)
| Supplies a custom scanner to be used in future scans. More...
Public Member Functions inherited from ChangeBroadcaster
| ChangeBroadcaster () noexcept
| Creates an ChangeBroadcaster. More...
virtual | ~ChangeBroadcaster ()
| Destructor. More...
void | addChangeListener (ChangeListener *listener)
| Registers a listener to receive change callbacks from this broadcaster. More...
void | removeChangeListener (ChangeListener *listener)
| Unregisters a listener from the list. More...
void | removeAllChangeListeners ()
| Removes all listeners from the list. More...
void | sendChangeMessage ()
| Causes an asynchronous change message to be sent to all the registered listeners. More...
void | sendSynchronousChangeMessage ()
| Sends a synchronous change message to all the registered listeners. More...
void | dispatchPendingMessages ()
| If a change message has been sent but not yet dispatched, this will call sendSynchronousChangeMessage() to make the callback immediately. More...

## Static Public Member Functions
static void | addToMenu (PopupMenu &menu, const Array< PluginDescription > &types, SortMethod sortMethod, const String &currentlyTickedPluginID={})
| Adds the plug-in types to a popup menu so that the user can select one. More...
static int | getIndexChosenByMenu (const Array< PluginDescription > &types, int menuResultCode)
| Converts a menu item index that has been chosen into its index in the list. More...
static std::unique_ptr< PluginTree > | createTree (const Array< PluginDescription > &types, SortMethod sortMethod)
| Creates a PluginTree object representing the list of plug-ins. More...

## Detailed Description

Manages a list of plugin types.

This can be easily edited, saved and loaded, and used to create instances of the plugin types in it.

See also
  PluginListComponent

## Member Enumeration Documentation

## ◆ SortMethod

enum KnownPluginList::SortMethod

Sort methods used to change the order of the plugins in the list.

Enumerator
defaultOrder |
sortAlphabetically |
sortByCategory |
sortByManufacturer |
sortByFormat |
sortByFileSystemLocation |
sortByInfoUpdateTime |

## Constructor & Destructor Documentation

## ◆ KnownPluginList()

KnownPluginList::KnownPluginList | ( |  | ) |

Creates an empty list.

## ◆ ~KnownPluginList()

KnownPluginList::~KnownPluginList | ( |  | ) |
| override

Destructor.

## Member Function Documentation

## ◆ clear()

void KnownPluginList::clear | ( |  | ) |

Clears the list.

## ◆ addType()

bool KnownPluginList::addType | ( | const PluginDescription & | type | ) |

Adds a type manually from its description.

## ◆ removeType()

void KnownPluginList::removeType | ( | const PluginDescription & | type | ) |

Removes a type.

## ◆ getNumTypes()

int KnownPluginList::getNumTypes | ( |  | ) | const
| noexcept

Returns the number of types currently in the list.

## ◆ getTypes()

Array< PluginDescription > KnownPluginList::getTypes | ( |  | ) | const

Returns a copy of the current list.

## ◆ getTypesForFormat()

Array< PluginDescription > KnownPluginList::getTypesForFormat | ( | AudioPluginFormat & |  | ) | const

Returns the subset of plugin types for a given format.

## ◆ getTypeForFile()

std::unique_ptr< PluginDescription > KnownPluginList::getTypeForFile | ( | const String & | fileOrIdentifier | ) | const

Looks for a type in the list which comes from this file.

## ◆ getTypeForIdentifierString()

std::unique_ptr< PluginDescription > KnownPluginList::getTypeForIdentifierString | ( | const String & | identifierString | ) | const

Looks for a type in the list which matches a plugin type ID.

The identifierString parameter must have been created by PluginDescription::createIdentifierString().

## ◆ scanAndAddFile()

bool KnownPluginList::scanAndAddFile | ( | const String & | possiblePluginFileOrIdentifier,
|  | bool | dontRescanIfAlreadyInList,
|  | OwnedArray< PluginDescription > & | typesFound,
|  | AudioPluginFormat & | formatToUse
| ) |  |

Looks for all types that can be loaded from a given file, and adds them to the list.

If dontRescanIfAlreadyInList is true, then the file will only be loaded and re-tested if it's not already in the list, or if the file's modification time has changed since the list was created. If dontRescanIfAlreadyInList is false, the file will always be reloaded and tested.

Returns true if any new types were added, and all the types found in this file (even if it was already known and hasn't been re-scanned) get returned in the array.

## ◆ scanFinished()

void KnownPluginList::scanFinished | ( |  | ) |

Tells a custom scanner that a scan has finished, and it can release any resources.

## ◆ isListingUpToDate()

bool KnownPluginList::isListingUpToDate | ( | const String & | possiblePluginFileOrIdentifier,
|  | AudioPluginFormat & | formatToUse
| ) |  | const

Returns true if the specified file is already known about and if it hasn't been modified since our entry was created.

## ◆ scanAndAddDragAndDroppedFiles()

void KnownPluginList::scanAndAddDragAndDroppedFiles | ( | AudioPluginFormatManager & | formatManager,
|  | const StringArray & | filenames,
|  | OwnedArray< PluginDescription > & | typesFound
| ) |  |

Scans and adds a bunch of files that might have been dragged-and-dropped.

If any types are found in the files, their descriptions are returned in the array.

## ◆ getBlacklistedFiles()

const StringArray & KnownPluginList::getBlacklistedFiles | ( |  | ) | const

Returns the list of blacklisted files.

## ◆ addToBlacklist()

void KnownPluginList::addToBlacklist | ( | const String & | pluginID | ) |

Adds a plugin ID to the black-list.

## ◆ removeFromBlacklist()

void KnownPluginList::removeFromBlacklist | ( | const String & | pluginID | ) |

Removes a plugin ID from the black-list.

## ◆ clearBlacklistedFiles()

void KnownPluginList::clearBlacklistedFiles | ( |  | ) |

Clears all the blacklisted files.

## ◆ addToMenu()

static void KnownPluginList::addToMenu | ( | PopupMenu & | menu,
|  | const Array< PluginDescription > & | types,
|  | SortMethod | sortMethod,
|  | const String & | currentlyTickedPluginID = `{}`
| ) |  |
| static

Adds the plug-in types to a popup menu so that the user can select one.

Depending on the sort method, it may add sub-menus for categories, manufacturers, etc.

Use getIndexChosenByMenu() to find out the type that was chosen.

## ◆ getIndexChosenByMenu()

static int KnownPluginList::getIndexChosenByMenu | ( | const Array< PluginDescription > & | types,
|  | int | menuResultCode
| ) |  |
| static

Converts a menu item index that has been chosen into its index in the list.

Returns -1 if it's not an ID that was used.

See also
  addToMenu

## ◆ sort()

void KnownPluginList::sort | ( | SortMethod | method,
|  | bool | forwards
| ) |  |

Sorts the list.

## ◆ createXml()

std::unique_ptr< XmlElement > KnownPluginList::createXml | ( |  | ) | const

Creates some XML that can be used to store the state of this list.

## ◆ recreateFromXml()

void KnownPluginList::recreateFromXml | ( | const XmlElement & | xml | ) |

Recreates the state of this list from its stored XML format.

## ◆ createTree()

static std::unique_ptr< PluginTree > KnownPluginList::createTree | ( | const Array< PluginDescription > & | types,
|  | SortMethod | sortMethod
| ) |  |
| static

Creates a PluginTree object representing the list of plug-ins.

## ◆ setCustomScanner()

void KnownPluginList::setCustomScanner | ( | std::unique_ptr< CustomScanner > | newScanner | ) |

Supplies a custom scanner to be used in future scans.

The KnownPluginList will take ownership of the object passed in.

References gl::index, and gl::types.

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

- juce_KnownPluginList.h