29static StringArray readDeadMansPedalFile (
const File& file)
32 file.readLines (lines);
64 for (
auto&
crashed : readDeadMansPedalFile (deadMansPedalFile))
65 for (
int j = filesOrIdentifiersToScan.
size(); --
j >= 0;)
66 if (
crashed == filesOrIdentifiersToScan[
j])
67 filesOrIdentifiersToScan.
move (
j, -1);
70 nextIndex.
set (filesOrIdentifiersToScan.
size());
78void PluginDirectoryScanner::updateProgress()
80 progress = (1.0f - (
float) nextIndex.
get() / (
float) filesOrIdentifiersToScan.
size());
86 const int index = --nextIndex;
90 auto file = filesOrIdentifiersToScan [index];
111 failedFiles.
add (file);
122 return --nextIndex > 0;
Represents a set of folders that make up a search path.
Represents a local file or directory.
bool replaceWithText(const String &textToWrite, bool asUnicode=false, bool writeUnicodeHeaderBytes=false, const char *lineEndings="\r\n") const
Replaces this file's contents with a given text string.
const String & getFullPathName() const noexcept
Returns the complete, absolute path of this file.
Manages a list of plugin types.
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 en...
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.
const StringArray & getBlacklistedFiles() const
Returns the list of blacklisted files.
void scanFinished()
Tells a custom scanner that a scan has finished, and it can release any resources.
An array designed for holding objects.
static void applyBlacklistingsFromDeadMansPedal(KnownPluginList &listToApplyTo, const File &deadMansPedalFile)
Reads the given dead-mans-pedal file and applies its contents to the list.
PluginDirectoryScanner(KnownPluginList &listToAddResultsTo, AudioPluginFormat &formatToLookFor, FileSearchPath directoriesToSearch, bool searchRecursively, const File &deadMansPedalFile, bool allowPluginsWhichRequireAsynchronousInstantiation=false)
Creates a scanner.
bool skipNextFile()
Skips over the next file without scanning it.
~PluginDirectoryScanner()
Destructor.
String getNextPluginFileThatWillBeScanned() const
Returns the description of the plugin that will be scanned during the next call to scanNextFile().
bool scanNextFile(bool dontRescanIfAlreadyInList, String &nameOfPluginBeingScanned)
Tries the next likely-looking file.
void setFilesOrIdentifiersToScan(const StringArray &filesOrIdentifiersToScan)
Sets a specific list of filesOrIdentifiersToScan to scan.
A special array for holding a list of strings.
void removeEmptyStrings(bool removeWhitespaceStrings=true)
Removes empty strings from the array.
bool contains(StringRef stringToLookFor, bool ignoreCase=false) const
Searches for a string in the array.
void move(int currentIndex, int newIndex) noexcept
Moves one of the strings to a different position.
int size() const noexcept
Returns the number of strings in the array.
void add(String stringToAdd)
Appends a string at the end of the array.
bool isNotEmpty() const noexcept
Returns true if the string contains at least one character.
Type unalignedPointerCast(void *ptr) noexcept
Casts a pointer to another type via void*, which suppresses the cast-align warning which sometimes ar...
Type get() const noexcept
Atomically reads and returns the current value.
void set(Type newValue) noexcept
Atomically sets the current value.