JUCE  v5.4.1-191-g0ab5e696f
JUCE API
Looking for a senior C++ dev?
I'm looking for work. Hire me!
juce::KnownPluginList Class Reference

Manages a list of plugin types. More...

#include <juce_KnownPluginList.h>

Inheritance diagram for juce::KnownPluginList:
Collaboration diagram for juce::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 ()
 Destructor. More...
 
void addChangeListener (ChangeListener *listener)
 Registers a listener to receive change callbacks from this broadcaster. More...
 
void addToBlacklist (const String &pluginID)
 Adds a plugin ID to the black-list. More...
 
void addToMenu (PopupMenu &menu, SortMethod sortMethod, const String &currentlyTickedPluginID=String()) const
 Adds all the plugin types to a popup menu so that the user can select one. More...
 
bool addType (const PluginDescription &type)
 Adds a type manually from its description. More...
 
PluginDescription ** begin () const noexcept
 Type iteration. More...
 
void clear ()
 Clears the list. More...
 
void clearBlacklistedFiles ()
 Clears all the blacklisted files. More...
 
PluginTreecreateTree (const SortMethod sortMethod) const
 Creates a PluginTree object containing all the known plugins. More...
 
XmlElementcreateXml () const
 Creates some XML that can be used to store the state of this list. More...
 
void dispatchPendingMessages ()
 If a change message has been sent but not yet dispatched, this will call sendSynchronousChangeMessage() to make the callback immediately. More...
 
PluginDescription ** end () const noexcept
 Type iteration. More...
 
const StringArraygetBlacklistedFiles () const
 Returns the list of blacklisted files. More...
 
int getIndexChosenByMenu (int menuResultCode) const
 Converts a menu item index that has been chosen into its index in this list. More...
 
int getNumTypes () const noexcept
 Returns the number of types currently in the list. More...
 
PluginDescriptiongetType (int index) const noexcept
 Returns one of the types. More...
 
PluginDescriptiongetTypeForFile (const String &fileOrIdentifier) const
 Looks for a type in the list which comes from this file. More...
 
PluginDescriptiongetTypeForIdentifierString (const String &identifierString) const
 Looks for a type in the list which matches a plugin type ID. 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 recreateFromXml (const XmlElement &xml)
 Recreates the state of this list from its stored XML format. More...
 
void removeAllChangeListeners ()
 Removes all listeners from the list. More...
 
void removeChangeListener (ChangeListener *listener)
 Unregisters a listener from the list. More...
 
void removeFromBlacklist (const String &pluginID)
 Removes a plugin ID from the black-list. More...
 
void removeType (int index)
 Removes a type. 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...
 
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...
 
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 setCustomScanner (CustomScanner *)
 Supplies a custom scanner to be used in future scans. More...
 
void sort (SortMethod method, bool forwards)
 Sorts the list. More...
 

Private Attributes

StringArray blacklist
 
CriticalSection scanLock
 
std::unique_ptr< CustomScannerscanner
 
OwnedArray< PluginDescriptiontypes
 
CriticalSection typesArrayLock
 

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

{Audio}

Member Enumeration Documentation

◆ 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()

juce::KnownPluginList::KnownPluginList ( )

Creates an empty list.

◆ ~KnownPluginList()

juce::KnownPluginList::~KnownPluginList ( )

Destructor.

Member Function Documentation

◆ addChangeListener()

void juce::ChangeBroadcaster::addChangeListener ( ChangeListener listener)
inherited

Registers a listener to receive change callbacks from this broadcaster.

Trying to add a listener that's already on the list will have no effect.

◆ addToBlacklist()

void juce::KnownPluginList::addToBlacklist ( const String pluginID)

Adds a plugin ID to the black-list.

◆ addToMenu()

void juce::KnownPluginList::addToMenu ( PopupMenu menu,
SortMethod  sortMethod,
const String currentlyTickedPluginID = String() 
) const

Adds all the plugin 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.

◆ addType()

bool juce::KnownPluginList::addType ( const PluginDescription type)

Adds a type manually from its description.

◆ begin()

PluginDescription** juce::KnownPluginList::begin ( ) const
inlinenoexcept

Type iteration.

◆ clear()

void juce::KnownPluginList::clear ( )

Clears the list.

◆ clearBlacklistedFiles()

void juce::KnownPluginList::clearBlacklistedFiles ( )

Clears all the blacklisted files.

◆ createTree()

PluginTree* juce::KnownPluginList::createTree ( const SortMethod  sortMethod) const

Creates a PluginTree object containing all the known plugins.

◆ createXml()

XmlElement* juce::KnownPluginList::createXml ( ) const

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

◆ dispatchPendingMessages()

void juce::ChangeBroadcaster::dispatchPendingMessages ( )
inherited

If a change message has been sent but not yet dispatched, this will call sendSynchronousChangeMessage() to make the callback immediately.

For thread-safety reasons, you must only call this method on the main message thread.

◆ end()

PluginDescription** juce::KnownPluginList::end ( ) const
inlinenoexcept

Type iteration.

◆ getBlacklistedFiles()

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

Returns the list of blacklisted files.

◆ getIndexChosenByMenu()

int juce::KnownPluginList::getIndexChosenByMenu ( int  menuResultCode) const

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

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

See also
addToMenu

◆ getNumTypes()

int juce::KnownPluginList::getNumTypes ( ) const
inlinenoexcept

Returns the number of types currently in the list.

See also
getType

◆ getType()

PluginDescription* juce::KnownPluginList::getType ( int  index) const
inlinenoexcept

Returns one of the types.

See also
getNumTypes

◆ getTypeForFile()

PluginDescription* juce::KnownPluginList::getTypeForFile ( const String fileOrIdentifier) const

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

◆ getTypeForIdentifierString()

PluginDescription* juce::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().

◆ isListingUpToDate()

bool juce::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.

◆ recreateFromXml()

void juce::KnownPluginList::recreateFromXml ( const XmlElement xml)

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

◆ removeAllChangeListeners()

void juce::ChangeBroadcaster::removeAllChangeListeners ( )
inherited

Removes all listeners from the list.

◆ removeChangeListener()

void juce::ChangeBroadcaster::removeChangeListener ( ChangeListener listener)
inherited

Unregisters a listener from the list.

If the listener isn't on the list, this won't have any effect.

◆ removeFromBlacklist()

void juce::KnownPluginList::removeFromBlacklist ( const String pluginID)

Removes a plugin ID from the black-list.

◆ removeType()

void juce::KnownPluginList::removeType ( int  index)

Removes a type.

◆ scanAndAddDragAndDroppedFiles()

void juce::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.

◆ scanAndAddFile()

bool juce::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 juce::KnownPluginList::scanFinished ( )

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

◆ sendChangeMessage()

void juce::ChangeBroadcaster::sendChangeMessage ( )
inherited

Causes an asynchronous change message to be sent to all the registered listeners.

The message will be delivered asynchronously by the main message thread, so this method will return immediately. To call the listeners synchronously use sendSynchronousChangeMessage().

Referenced by juce::SelectedItemSet< SelectableItemType >::changed().

◆ sendSynchronousChangeMessage()

void juce::ChangeBroadcaster::sendSynchronousChangeMessage ( )
inherited

Sends a synchronous change message to all the registered listeners.

This will immediately call all the listeners that are registered. For thread-safety reasons, you must only call this method on the main message thread.

See also
dispatchPendingMessages

Referenced by juce::SelectedItemSet< SelectableItemType >::changed().

◆ setCustomScanner()

void juce::KnownPluginList::setCustomScanner ( CustomScanner )

Supplies a custom scanner to be used in future scans.

The KnownPluginList will take ownership of the object passed in.

◆ sort()

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

Sorts the list.

Member Data Documentation

◆ blacklist

StringArray juce::KnownPluginList::blacklist
private

◆ scanLock

CriticalSection juce::KnownPluginList::scanLock
private

◆ scanner

std::unique_ptr<CustomScanner> juce::KnownPluginList::scanner
private

◆ types

OwnedArray<PluginDescription> juce::KnownPluginList::types
private

◆ typesArrayLock

CriticalSection juce::KnownPluginList::typesArrayLock
private

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