LMMS
Loading...
Searching...
No Matches
juce::KnownPluginList Class Reference

#include <juce_KnownPluginList.h>

Inheritance diagram for juce::KnownPluginList:
juce::ChangeBroadcaster

Classes

struct  PluginTree
class  CustomScanner

Public Types

enum  SortMethod {
  defaultOrder = 0 , sortAlphabetically , sortByCategory , sortByManufacturer ,
  sortByFormat , sortByFileSystemLocation , sortByInfoUpdateTime
}

Public Member Functions

 KnownPluginList ()
 ~KnownPluginList () override
void clear ()
bool addType (const PluginDescription &type)
void removeType (const PluginDescription &type)
int getNumTypes () const noexcept
Array< PluginDescriptiongetTypes () const
Array< PluginDescriptiongetTypesForFormat (AudioPluginFormat &) const
std::unique_ptr< PluginDescriptiongetTypeForFile (const String &fileOrIdentifier) const
std::unique_ptr< PluginDescriptiongetTypeForIdentifierString (const String &identifierString) const
bool scanAndAddFile (const String &possiblePluginFileOrIdentifier, bool dontRescanIfAlreadyInList, OwnedArray< PluginDescription > &typesFound, AudioPluginFormat &formatToUse)
void scanFinished ()
bool isListingUpToDate (const String &possiblePluginFileOrIdentifier, AudioPluginFormat &formatToUse) const
void scanAndAddDragAndDroppedFiles (AudioPluginFormatManager &formatManager, const StringArray &filenames, OwnedArray< PluginDescription > &typesFound)
const StringArraygetBlacklistedFiles () const
void addToBlacklist (const String &pluginID)
void removeFromBlacklist (const String &pluginID)
void clearBlacklistedFiles ()
void sort (SortMethod method, bool forwards)
std::unique_ptr< XmlElementcreateXml () const
void recreateFromXml (const XmlElement &xml)
void setCustomScanner (std::unique_ptr< CustomScanner > newScanner)
PluginDescriptiongetType (int index) noexcept
const PluginDescriptiongetType (int index) const noexcept
PluginDescription ** begin () noexcept
PluginDescription *constbegin () const noexcept
PluginDescription ** end () noexcept
PluginDescription *constend () const noexcept
void addToMenu (PopupMenu &menu, SortMethod sortMethod, const String &currentlyTickedPluginID={}) const
int getIndexChosenByMenu (int menuResultCode) const
std::unique_ptr< PluginTreecreateTree (const SortMethod sortMethod) const
Public Member Functions inherited from juce::ChangeBroadcaster
 ChangeBroadcaster () noexcept
virtual ~ChangeBroadcaster ()
void addChangeListener (ChangeListener *listener)
void removeChangeListener (ChangeListener *listener)
void removeAllChangeListeners ()
void sendChangeMessage ()
void sendSynchronousChangeMessage ()
void dispatchPendingMessages ()

Static Public Member Functions

static void addToMenu (PopupMenu &menu, const Array< PluginDescription > &types, SortMethod sortMethod, const String &currentlyTickedPluginID={})
static int getIndexChosenByMenu (const Array< PluginDescription > &types, int menuResultCode)
static std::unique_ptr< PluginTreecreateTree (const Array< PluginDescription > &types, SortMethod sortMethod)

Private Attributes

Array< PluginDescriptiontypes
StringArray blacklist
std::unique_ptr< CustomScannerscanner
CriticalSection scanLock
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

@tags{Audio}

Member Enumeration Documentation

◆ SortMethod

enum juce::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()

juce::KnownPluginList::KnownPluginList ( )

Creates an empty list.

◆ ~KnownPluginList()

juce::KnownPluginList::~KnownPluginList ( )
override

Destructor.

Member Function Documentation

◆ addToBlacklist()

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

Adds a plugin ID to the black-list.

◆ addToMenu() [1/2]

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

◆ addToMenu() [2/2]

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

◆ addType()

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

Adds a type manually from its description.

◆ begin() [1/2]

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

◆ begin() [2/2]

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

◆ clear()

void juce::KnownPluginList::clear ( )

Clears the list.

◆ clearBlacklistedFiles()

void juce::KnownPluginList::clearBlacklistedFiles ( )

Clears all the blacklisted files.

◆ createTree() [1/2]

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

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

◆ createTree() [2/2]

std::unique_ptr< KnownPluginList::PluginTree > juce::KnownPluginList::createTree ( const SortMethod sortMethod) const

◆ createXml()

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

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

◆ end() [1/2]

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

◆ end() [2/2]

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

◆ getBlacklistedFiles()

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

Returns the list of blacklisted files.

◆ getIndexChosenByMenu() [1/2]

int juce::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

◆ getIndexChosenByMenu() [2/2]

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

◆ getNumTypes()

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

Returns the number of types currently in the list.

◆ getType() [1/2]

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

◆ getType() [2/2]

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

◆ getTypeForFile()

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

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

◆ getTypeForIdentifierString()

std::unique_ptr< 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().

◆ getTypes()

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

Returns a copy of the current list.

◆ getTypesForFormat()

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

Returns the subset of plugin types for a given format.

◆ 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.

◆ removeFromBlacklist()

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

Removes a plugin ID from the black-list.

◆ removeType()

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

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.

◆ setCustomScanner()

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

◆ 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

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

◆ typesArrayLock

CriticalSection juce::KnownPluginList::typesArrayLock
private

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