JUCE
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines
Public Types | Public Member Functions
KnownPluginList Class Reference

Manages a list of plugin types. More...

Inherits ChangeBroadcaster.

List of all members.

Public Types

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

Public Member Functions

 KnownPluginList ()
 Creates an empty list.
 ~KnownPluginList ()
 Destructor.
void clear ()
 Clears the list.
int getNumTypes () const noexcept
 Returns the number of types currently in the list.
PluginDescriptiongetType (int index) const noexcept
 Returns one of the types.
PluginDescriptiongetTypeForFile (const String &fileOrIdentifier) const
 Looks for a type in the list which comes from this file.
PluginDescriptiongetTypeForIdentifierString (const String &identifierString) const
 Looks for a type in the list which matches a plugin type ID.
bool addType (const PluginDescription &type)
 Adds a type manually from its description.
void removeType (int index)
 Removes a type.
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.
bool isListingUpToDate (const String &possiblePluginFileOrIdentifier) const
 Returns true if the specified file is already known about and if it hasn't been modified since our entry was created.
void scanAndAddDragAndDroppedFiles (const StringArray &filenames, OwnedArray< PluginDescription > &typesFound)
 Scans and adds a bunch of files that might have been dragged-and-dropped.
void addToMenu (PopupMenu &menu, const SortMethod sortMethod) const
 Adds all the plugin types to a popup menu so that the user can select one.
int getIndexChosenByMenu (int menuResultCode) const
 Converts a menu item index that has been chosen into its index in this list.
void sort (const SortMethod method)
 Sorts the list.
XmlElementcreateXml () const
 Creates some XML that can be used to store the state of this list.
void recreateFromXml (const XmlElement &xml)
 Recreates the state of this list from its stored XML format.

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

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

Enumerator:
defaultOrder 
sortAlphabetically 
sortByCategory 
sortByManufacturer 
sortByFileSystemLocation 

Constructor & Destructor Documentation

Creates an empty list.

Destructor.


Member Function Documentation

Clears the list.

Returns the number of types currently in the list.

See also:
getType

Returns one of the types.

See also:
getNumTypes
PluginDescription* KnownPluginList::getTypeForFile ( const String fileOrIdentifier) const

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

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

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

Adds a type manually from its description.

void KnownPluginList::removeType ( int  index)

Removes a type.

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.

bool KnownPluginList::isListingUpToDate ( const String possiblePluginFileOrIdentifier) const

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

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.

void KnownPluginList::addToMenu ( PopupMenu menu,
const SortMethod  sortMethod 
) 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.

int 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
void KnownPluginList::sort ( const SortMethod  method)

Sorts the list.

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

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


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