PluginDirectoryScanner Class Reference

Scans a directory for plugins, and adds them to a KnownPluginList. More...

List of all members.

Public Member Functions

 PluginDirectoryScanner (KnownPluginList &listToAddResultsTo, AudioPluginFormat &formatToLookFor, FileSearchPath directoriesToSearch, bool searchRecursively, const File &deadMansPedalFile)
 Creates a scanner.
 ~PluginDirectoryScanner ()
 Destructor.
bool scanNextFile (bool dontRescanIfAlreadyInList)
 Tries the next likely-looking file.
const String getNextPluginFileThatWillBeScanned () const throw ()
 Returns the description of the plugin that will be scanned during the next call to scanNextFile().
float getProgress () const
 Returns the estimated progress, between 0 and 1.
const StringArraygetFailedFiles () const throw ()
 This returns a list of all the filenames of things that looked like being a plugin file, but which failed to open for some reason.

Detailed Description

Scans a directory for plugins, and adds them to a KnownPluginList.

To use one of these, create it and call scanNextFile() repeatedly, until it returns false.


Constructor & Destructor Documentation

PluginDirectoryScanner::PluginDirectoryScanner ( KnownPluginList listToAddResultsTo,
AudioPluginFormat formatToLookFor,
FileSearchPath  directoriesToSearch,
bool  searchRecursively,
const File deadMansPedalFile 
)

Creates a scanner.

Parameters:
listToAddResultsTo this will get the new types added to it.
formatToLookFor this is the type of format that you want to look for
directoriesToSearch the path to search
searchRecursively true to search recursively
deadMansPedalFile if this isn't File::nonexistent, then it will be used as a file to store the names of any plugins that crash during initialisation. If there are any plugins listed in it, then these will always be scanned after all other possible files have been tried - in this way, even if there's a few dodgy plugins in your path, then a couple of rescans will still manage to find all the proper plugins. It's probably best to choose a file in the user's application data directory (alongside your app's settings file) for this. The file format it uses is just a list of filenames of the modules that failed.
PluginDirectoryScanner::~PluginDirectoryScanner (  ) 

Destructor.


Member Function Documentation

bool PluginDirectoryScanner::scanNextFile ( bool  dontRescanIfAlreadyInList  ) 

Tries the next likely-looking file.

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 false when there are no more files to try.

const String PluginDirectoryScanner::getNextPluginFileThatWillBeScanned (  )  const throw ()

Returns the description of the plugin that will be scanned during the next call to scanNextFile().

This is handy if you want to show the user which file is currently getting scanned.

float PluginDirectoryScanner::getProgress (  )  const

Returns the estimated progress, between 0 and 1.

const StringArray& PluginDirectoryScanner::getFailedFiles (  )  const throw ()

This returns a list of all the filenames of things that looked like being a plugin file, but which failed to open for some reason.


The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Generated on Mon Apr 26 11:42:15 2010 for JUCE by  doxygen 1.6.3