fix macOS build (following Projucer changes made in Windows, which removed /Applications/JUCE/modules from its headers). move JUCE headers under source control, so that Windows and macOS can both build against same version of JUCE. remove AUv3 target (I think it's an iOS thing, so it will never work with this macOS fluidsynth dylib).
This commit is contained in:
575
modules/juce_audio_processors/scanning/juce_KnownPluginList.cpp
Normal file
575
modules/juce_audio_processors/scanning/juce_KnownPluginList.cpp
Normal file
@ -0,0 +1,575 @@
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2017 - ROLI Ltd.
|
||||
|
||||
JUCE is an open source library subject to commercial or open-source
|
||||
licensing.
|
||||
|
||||
By using JUCE, you agree to the terms of both the JUCE 5 End-User License
|
||||
Agreement and JUCE 5 Privacy Policy (both updated and effective as of the
|
||||
27th April 2017).
|
||||
|
||||
End User License Agreement: www.juce.com/juce-5-licence
|
||||
Privacy Policy: www.juce.com/juce-5-privacy-policy
|
||||
|
||||
Or: You may also use this code under the terms of the GPL v3 (see
|
||||
www.gnu.org/licenses).
|
||||
|
||||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
|
||||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
|
||||
DISCLAIMED.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
namespace juce
|
||||
{
|
||||
|
||||
KnownPluginList::KnownPluginList() {}
|
||||
KnownPluginList::~KnownPluginList() {}
|
||||
|
||||
void KnownPluginList::clear()
|
||||
{
|
||||
ScopedLock lock (typesArrayLock);
|
||||
|
||||
if (! types.isEmpty())
|
||||
{
|
||||
types.clear();
|
||||
sendChangeMessage();
|
||||
}
|
||||
}
|
||||
|
||||
PluginDescription* KnownPluginList::getTypeForFile (const String& fileOrIdentifier) const
|
||||
{
|
||||
ScopedLock lock (typesArrayLock);
|
||||
|
||||
for (auto* desc : types)
|
||||
if (desc->fileOrIdentifier == fileOrIdentifier)
|
||||
return desc;
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
PluginDescription* KnownPluginList::getTypeForIdentifierString (const String& identifierString) const
|
||||
{
|
||||
ScopedLock lock (typesArrayLock);
|
||||
|
||||
for (auto* desc : types)
|
||||
if (desc->matchesIdentifierString (identifierString))
|
||||
return desc;
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool KnownPluginList::addType (const PluginDescription& type)
|
||||
{
|
||||
{
|
||||
ScopedLock lock (typesArrayLock);
|
||||
|
||||
for (auto* desc : types)
|
||||
{
|
||||
if (desc->isDuplicateOf (type))
|
||||
{
|
||||
// strange - found a duplicate plugin with different info..
|
||||
jassert (desc->name == type.name);
|
||||
jassert (desc->isInstrument == type.isInstrument);
|
||||
|
||||
*desc = type;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
types.insert (0, new PluginDescription (type));
|
||||
}
|
||||
|
||||
sendChangeMessage();
|
||||
return true;
|
||||
}
|
||||
|
||||
void KnownPluginList::removeType (const int index)
|
||||
{
|
||||
{
|
||||
ScopedLock lock (typesArrayLock);
|
||||
types.remove (index);
|
||||
}
|
||||
|
||||
sendChangeMessage();
|
||||
}
|
||||
|
||||
bool KnownPluginList::isListingUpToDate (const String& fileOrIdentifier,
|
||||
AudioPluginFormat& formatToUse) const
|
||||
{
|
||||
if (getTypeForFile (fileOrIdentifier) == nullptr)
|
||||
return false;
|
||||
|
||||
ScopedLock lock (typesArrayLock);
|
||||
|
||||
for (auto* d : types)
|
||||
if (d->fileOrIdentifier == fileOrIdentifier && formatToUse.pluginNeedsRescanning (*d))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void KnownPluginList::setCustomScanner (CustomScanner* newScanner)
|
||||
{
|
||||
scanner.reset (newScanner);
|
||||
}
|
||||
|
||||
bool KnownPluginList::scanAndAddFile (const String& fileOrIdentifier,
|
||||
const bool dontRescanIfAlreadyInList,
|
||||
OwnedArray<PluginDescription>& typesFound,
|
||||
AudioPluginFormat& format)
|
||||
{
|
||||
const ScopedLock sl (scanLock);
|
||||
|
||||
if (dontRescanIfAlreadyInList
|
||||
&& getTypeForFile (fileOrIdentifier) != nullptr)
|
||||
{
|
||||
bool needsRescanning = false;
|
||||
|
||||
ScopedLock lock (typesArrayLock);
|
||||
|
||||
for (auto* d : types)
|
||||
{
|
||||
if (d->fileOrIdentifier == fileOrIdentifier && d->pluginFormatName == format.getName())
|
||||
{
|
||||
if (format.pluginNeedsRescanning (*d))
|
||||
needsRescanning = true;
|
||||
else
|
||||
typesFound.add (new PluginDescription (*d));
|
||||
}
|
||||
}
|
||||
|
||||
if (! needsRescanning)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (blacklist.contains (fileOrIdentifier))
|
||||
return false;
|
||||
|
||||
OwnedArray<PluginDescription> found;
|
||||
|
||||
{
|
||||
const ScopedUnlock sl2 (scanLock);
|
||||
|
||||
if (scanner != nullptr)
|
||||
{
|
||||
if (! scanner->findPluginTypesFor (format, found, fileOrIdentifier))
|
||||
addToBlacklist (fileOrIdentifier);
|
||||
}
|
||||
else
|
||||
{
|
||||
format.findAllTypesForFile (found, fileOrIdentifier);
|
||||
}
|
||||
}
|
||||
|
||||
for (auto* desc : found)
|
||||
{
|
||||
jassert (desc != nullptr);
|
||||
addType (*desc);
|
||||
typesFound.add (new PluginDescription (*desc));
|
||||
}
|
||||
|
||||
return ! found.isEmpty();
|
||||
}
|
||||
|
||||
void KnownPluginList::scanAndAddDragAndDroppedFiles (AudioPluginFormatManager& formatManager,
|
||||
const StringArray& files,
|
||||
OwnedArray<PluginDescription>& typesFound)
|
||||
{
|
||||
for (const auto& filenameOrID : files)
|
||||
{
|
||||
bool found = false;
|
||||
|
||||
for (int j = 0; j < formatManager.getNumFormats(); ++j)
|
||||
{
|
||||
auto* format = formatManager.getFormat (j);
|
||||
|
||||
if (format->fileMightContainThisPluginType (filenameOrID)
|
||||
&& scanAndAddFile (filenameOrID, true, typesFound, *format))
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (! found)
|
||||
{
|
||||
const File f (filenameOrID);
|
||||
|
||||
if (f.isDirectory())
|
||||
{
|
||||
StringArray s;
|
||||
|
||||
for (auto& subFile : f.findChildFiles (File::findFilesAndDirectories, false))
|
||||
s.add (subFile.getFullPathName());
|
||||
|
||||
scanAndAddDragAndDroppedFiles (formatManager, s, typesFound);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
scanFinished();
|
||||
}
|
||||
|
||||
void KnownPluginList::scanFinished()
|
||||
{
|
||||
if (scanner != nullptr)
|
||||
scanner->scanFinished();
|
||||
}
|
||||
|
||||
const StringArray& KnownPluginList::getBlacklistedFiles() const
|
||||
{
|
||||
return blacklist;
|
||||
}
|
||||
|
||||
void KnownPluginList::addToBlacklist (const String& pluginID)
|
||||
{
|
||||
if (! blacklist.contains (pluginID))
|
||||
{
|
||||
blacklist.add (pluginID);
|
||||
sendChangeMessage();
|
||||
}
|
||||
}
|
||||
|
||||
void KnownPluginList::removeFromBlacklist (const String& pluginID)
|
||||
{
|
||||
const int index = blacklist.indexOf (pluginID);
|
||||
|
||||
if (index >= 0)
|
||||
{
|
||||
blacklist.remove (index);
|
||||
sendChangeMessage();
|
||||
}
|
||||
}
|
||||
|
||||
void KnownPluginList::clearBlacklistedFiles()
|
||||
{
|
||||
if (blacklist.size() > 0)
|
||||
{
|
||||
blacklist.clear();
|
||||
sendChangeMessage();
|
||||
}
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
struct PluginSorter
|
||||
{
|
||||
PluginSorter (KnownPluginList::SortMethod sortMethod, bool forwards) noexcept
|
||||
: method (sortMethod), direction (forwards ? 1 : -1) {}
|
||||
|
||||
bool operator() (const PluginDescription* first, const PluginDescription* second) const
|
||||
{
|
||||
int diff = 0;
|
||||
|
||||
switch (method)
|
||||
{
|
||||
case KnownPluginList::sortByCategory: diff = first->category.compareNatural (second->category, false); break;
|
||||
case KnownPluginList::sortByManufacturer: diff = first->manufacturerName.compareNatural (second->manufacturerName, false); break;
|
||||
case KnownPluginList::sortByFormat: diff = first->pluginFormatName.compare (second->pluginFormatName); break;
|
||||
case KnownPluginList::sortByFileSystemLocation: diff = lastPathPart (first->fileOrIdentifier).compare (lastPathPart (second->fileOrIdentifier)); break;
|
||||
case KnownPluginList::sortByInfoUpdateTime: diff = compare (first->lastInfoUpdateTime, second->lastInfoUpdateTime); break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
if (diff == 0)
|
||||
diff = first->name.compareNatural (second->name, false);
|
||||
|
||||
return diff * direction < 0;
|
||||
}
|
||||
|
||||
private:
|
||||
static String lastPathPart (const String& path)
|
||||
{
|
||||
return path.replaceCharacter ('\\', '/').upToLastOccurrenceOf ("/", false, false);
|
||||
}
|
||||
|
||||
static int compare (Time a, Time b) noexcept
|
||||
{
|
||||
if (a < b) return -1;
|
||||
if (b < a) return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
KnownPluginList::SortMethod method;
|
||||
int direction;
|
||||
};
|
||||
|
||||
void KnownPluginList::sort (const SortMethod method, bool forwards)
|
||||
{
|
||||
if (method != defaultOrder)
|
||||
{
|
||||
Array<PluginDescription*> oldOrder, newOrder;
|
||||
|
||||
{
|
||||
ScopedLock lock (typesArrayLock);
|
||||
|
||||
oldOrder.addArray (types);
|
||||
std::stable_sort (types.begin(), types.end(), PluginSorter (method, forwards));
|
||||
newOrder.addArray (types);
|
||||
}
|
||||
|
||||
if (oldOrder != newOrder)
|
||||
sendChangeMessage();
|
||||
}
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
XmlElement* KnownPluginList::createXml() const
|
||||
{
|
||||
auto e = new XmlElement ("KNOWNPLUGINS");
|
||||
|
||||
{
|
||||
ScopedLock lock (typesArrayLock);
|
||||
|
||||
for (int i = types.size(); --i >= 0;)
|
||||
e->prependChildElement (types.getUnchecked(i)->createXml());
|
||||
}
|
||||
|
||||
for (auto& b : blacklist)
|
||||
e->createNewChildElement ("BLACKLISTED")->setAttribute ("id", b);
|
||||
|
||||
return e;
|
||||
}
|
||||
|
||||
void KnownPluginList::recreateFromXml (const XmlElement& xml)
|
||||
{
|
||||
clear();
|
||||
clearBlacklistedFiles();
|
||||
|
||||
if (xml.hasTagName ("KNOWNPLUGINS"))
|
||||
{
|
||||
forEachXmlChildElement (xml, e)
|
||||
{
|
||||
PluginDescription info;
|
||||
|
||||
if (e->hasTagName ("BLACKLISTED"))
|
||||
blacklist.add (e->getStringAttribute ("id"));
|
||||
else if (info.loadFromXml (*e))
|
||||
addType (info);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
struct PluginTreeUtils
|
||||
{
|
||||
enum { menuIdBase = 0x324503f4 };
|
||||
|
||||
static void buildTreeByFolder (KnownPluginList::PluginTree& tree, const Array<PluginDescription*>& allPlugins)
|
||||
{
|
||||
for (auto* pd : allPlugins)
|
||||
{
|
||||
auto path = pd->fileOrIdentifier.replaceCharacter ('\\', '/')
|
||||
.upToLastOccurrenceOf ("/", false, false);
|
||||
|
||||
if (path.substring (1, 2) == ":")
|
||||
path = path.substring (2);
|
||||
|
||||
addPlugin (tree, pd, path);
|
||||
}
|
||||
|
||||
optimiseFolders (tree, false);
|
||||
}
|
||||
|
||||
static void optimiseFolders (KnownPluginList::PluginTree& tree, bool concatenateName)
|
||||
{
|
||||
for (int i = tree.subFolders.size(); --i >= 0;)
|
||||
{
|
||||
auto& sub = *tree.subFolders.getUnchecked(i);
|
||||
optimiseFolders (sub, concatenateName || (tree.subFolders.size() > 1));
|
||||
|
||||
if (sub.plugins.isEmpty())
|
||||
{
|
||||
for (auto* s : sub.subFolders)
|
||||
{
|
||||
if (concatenateName)
|
||||
s->folder = sub.folder + "/" + s->folder;
|
||||
|
||||
tree.subFolders.add (s);
|
||||
}
|
||||
|
||||
sub.subFolders.clear (false);
|
||||
tree.subFolders.remove (i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void buildTreeByCategory (KnownPluginList::PluginTree& tree,
|
||||
const Array<PluginDescription*>& sorted,
|
||||
const KnownPluginList::SortMethod sortMethod)
|
||||
{
|
||||
String lastType;
|
||||
std::unique_ptr<KnownPluginList::PluginTree> current (new KnownPluginList::PluginTree());
|
||||
|
||||
for (auto* pd : sorted)
|
||||
{
|
||||
auto thisType = (sortMethod == KnownPluginList::sortByCategory ? pd->category
|
||||
: pd->manufacturerName);
|
||||
|
||||
if (! thisType.containsNonWhitespaceChars())
|
||||
thisType = "Other";
|
||||
|
||||
if (! thisType.equalsIgnoreCase (lastType))
|
||||
{
|
||||
if (current->plugins.size() + current->subFolders.size() > 0)
|
||||
{
|
||||
current->folder = lastType;
|
||||
tree.subFolders.add (current.release());
|
||||
current.reset (new KnownPluginList::PluginTree());
|
||||
}
|
||||
|
||||
lastType = thisType;
|
||||
}
|
||||
|
||||
current->plugins.add (pd);
|
||||
}
|
||||
|
||||
if (current->plugins.size() + current->subFolders.size() > 0)
|
||||
{
|
||||
current->folder = lastType;
|
||||
tree.subFolders.add (current.release());
|
||||
}
|
||||
}
|
||||
|
||||
static void addPlugin (KnownPluginList::PluginTree& tree, PluginDescription* const pd, String path)
|
||||
{
|
||||
if (path.isEmpty())
|
||||
{
|
||||
tree.plugins.add (pd);
|
||||
}
|
||||
else
|
||||
{
|
||||
#if JUCE_MAC
|
||||
if (path.containsChar (':'))
|
||||
path = path.fromFirstOccurrenceOf (":", false, false); // avoid the special AU formatting nonsense on Mac..
|
||||
#endif
|
||||
|
||||
auto firstSubFolder = path.upToFirstOccurrenceOf ("/", false, false);
|
||||
auto remainingPath = path.fromFirstOccurrenceOf ("/", false, false);
|
||||
|
||||
for (int i = tree.subFolders.size(); --i >= 0;)
|
||||
{
|
||||
KnownPluginList::PluginTree& subFolder = *tree.subFolders.getUnchecked(i);
|
||||
|
||||
if (subFolder.folder.equalsIgnoreCase (firstSubFolder))
|
||||
{
|
||||
addPlugin (subFolder, pd, remainingPath);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
auto newFolder = new KnownPluginList::PluginTree();
|
||||
newFolder->folder = firstSubFolder;
|
||||
tree.subFolders.add (newFolder);
|
||||
addPlugin (*newFolder, pd, remainingPath);
|
||||
}
|
||||
}
|
||||
|
||||
static bool containsDuplicateNames (const Array<const PluginDescription*>& plugins, const String& name)
|
||||
{
|
||||
int matches = 0;
|
||||
|
||||
for (int i = 0; i < plugins.size(); ++i)
|
||||
if (plugins.getUnchecked(i)->name == name)
|
||||
if (++matches > 1)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool addToMenu (const KnownPluginList::PluginTree& tree, PopupMenu& m,
|
||||
const OwnedArray<PluginDescription>& allPlugins,
|
||||
const String& currentlyTickedPluginID)
|
||||
{
|
||||
bool isTicked = false;
|
||||
|
||||
for (auto* sub : tree.subFolders)
|
||||
{
|
||||
PopupMenu subMenu;
|
||||
const bool isItemTicked = addToMenu (*sub, subMenu, allPlugins, currentlyTickedPluginID);
|
||||
isTicked = isTicked || isItemTicked;
|
||||
|
||||
m.addSubMenu (sub->folder, subMenu, true, nullptr, isItemTicked, 0);
|
||||
}
|
||||
|
||||
for (auto* plugin : tree.plugins)
|
||||
{
|
||||
auto name = plugin->name;
|
||||
|
||||
if (containsDuplicateNames (tree.plugins, name))
|
||||
name << " (" << plugin->pluginFormatName << ')';
|
||||
|
||||
const bool isItemTicked = plugin->matchesIdentifierString (currentlyTickedPluginID);
|
||||
isTicked = isTicked || isItemTicked;
|
||||
|
||||
m.addItem (allPlugins.indexOf (plugin) + menuIdBase, name, true, isItemTicked);
|
||||
}
|
||||
|
||||
return isTicked;
|
||||
}
|
||||
};
|
||||
|
||||
KnownPluginList::PluginTree* KnownPluginList::createTree (const SortMethod sortMethod) const
|
||||
{
|
||||
Array<PluginDescription*> sorted;
|
||||
|
||||
{
|
||||
ScopedLock lock (typesArrayLock);
|
||||
sorted.addArray (types);
|
||||
}
|
||||
|
||||
std::stable_sort (sorted.begin(), sorted.end(), PluginSorter (sortMethod, true));
|
||||
|
||||
auto* tree = new PluginTree();
|
||||
|
||||
if (sortMethod == sortByCategory || sortMethod == sortByManufacturer || sortMethod == sortByFormat)
|
||||
{
|
||||
PluginTreeUtils::buildTreeByCategory (*tree, sorted, sortMethod);
|
||||
}
|
||||
else if (sortMethod == sortByFileSystemLocation)
|
||||
{
|
||||
PluginTreeUtils::buildTreeByFolder (*tree, sorted);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (auto* p : sorted)
|
||||
tree->plugins.add (p);
|
||||
}
|
||||
|
||||
return tree;
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void KnownPluginList::addToMenu (PopupMenu& menu, const SortMethod sortMethod,
|
||||
const String& currentlyTickedPluginID) const
|
||||
{
|
||||
std::unique_ptr<PluginTree> tree (createTree (sortMethod));
|
||||
PluginTreeUtils::addToMenu (*tree, menu, types, currentlyTickedPluginID);
|
||||
}
|
||||
|
||||
int KnownPluginList::getIndexChosenByMenu (const int menuResultCode) const
|
||||
{
|
||||
const int i = menuResultCode - PluginTreeUtils::menuIdBase;
|
||||
return isPositiveAndBelow (i, types.size()) ? i : -1;
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
KnownPluginList::CustomScanner::CustomScanner() {}
|
||||
KnownPluginList::CustomScanner::~CustomScanner() {}
|
||||
|
||||
void KnownPluginList::CustomScanner::scanFinished() {}
|
||||
|
||||
bool KnownPluginList::CustomScanner::shouldExit() const noexcept
|
||||
{
|
||||
if (auto* job = ThreadPoolJob::getCurrentThreadPoolJob())
|
||||
return job->shouldExit();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace juce
|
229
modules/juce_audio_processors/scanning/juce_KnownPluginList.h
Normal file
229
modules/juce_audio_processors/scanning/juce_KnownPluginList.h
Normal file
@ -0,0 +1,229 @@
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2017 - ROLI Ltd.
|
||||
|
||||
JUCE is an open source library subject to commercial or open-source
|
||||
licensing.
|
||||
|
||||
By using JUCE, you agree to the terms of both the JUCE 5 End-User License
|
||||
Agreement and JUCE 5 Privacy Policy (both updated and effective as of the
|
||||
27th April 2017).
|
||||
|
||||
End User License Agreement: www.juce.com/juce-5-licence
|
||||
Privacy Policy: www.juce.com/juce-5-privacy-policy
|
||||
|
||||
Or: You may also use this code under the terms of the GPL v3 (see
|
||||
www.gnu.org/licenses).
|
||||
|
||||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
|
||||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
|
||||
DISCLAIMED.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
namespace juce
|
||||
{
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
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 PluginListComponent
|
||||
|
||||
@tags{Audio}
|
||||
*/
|
||||
class JUCE_API KnownPluginList : public ChangeBroadcaster
|
||||
{
|
||||
public:
|
||||
//==============================================================================
|
||||
/** Creates an empty list. */
|
||||
KnownPluginList();
|
||||
|
||||
/** Destructor. */
|
||||
~KnownPluginList();
|
||||
|
||||
//==============================================================================
|
||||
/** Clears the list. */
|
||||
void clear();
|
||||
|
||||
/** Returns the number of types currently in the list.
|
||||
@see getType
|
||||
*/
|
||||
int getNumTypes() const noexcept { return types.size(); }
|
||||
|
||||
/** Returns one of the types.
|
||||
@see getNumTypes
|
||||
*/
|
||||
PluginDescription* getType (int index) const noexcept { return types [index]; }
|
||||
|
||||
/** Type iteration. */
|
||||
PluginDescription** begin() const noexcept { return types.begin(); }
|
||||
|
||||
/** Type iteration. */
|
||||
PluginDescription** end() const noexcept { return types.end(); }
|
||||
|
||||
/** Looks for a type in the list which comes from this file. */
|
||||
PluginDescription* getTypeForFile (const String& fileOrIdentifier) const;
|
||||
|
||||
/** Looks for a type in the list which matches a plugin type ID.
|
||||
|
||||
The identifierString parameter must have been created by
|
||||
PluginDescription::createIdentifierString().
|
||||
*/
|
||||
PluginDescription* getTypeForIdentifierString (const String& identifierString) const;
|
||||
|
||||
/** Adds a type manually from its description. */
|
||||
bool addType (const PluginDescription& type);
|
||||
|
||||
/** Removes a type. */
|
||||
void removeType (int index);
|
||||
|
||||
/** 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 scanAndAddFile (const String& possiblePluginFileOrIdentifier,
|
||||
bool dontRescanIfAlreadyInList,
|
||||
OwnedArray<PluginDescription>& typesFound,
|
||||
AudioPluginFormat& formatToUse);
|
||||
|
||||
/** Tells a custom scanner that a scan has finished, and it can release any resources. */
|
||||
void scanFinished();
|
||||
|
||||
/** Returns true if the specified file is already known about and if it
|
||||
hasn't been modified since our entry was created.
|
||||
*/
|
||||
bool isListingUpToDate (const String& possiblePluginFileOrIdentifier,
|
||||
AudioPluginFormat& formatToUse) const;
|
||||
|
||||
/** 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 scanAndAddDragAndDroppedFiles (AudioPluginFormatManager& formatManager,
|
||||
const StringArray& filenames,
|
||||
OwnedArray<PluginDescription>& typesFound);
|
||||
|
||||
//==============================================================================
|
||||
/** Returns the list of blacklisted files. */
|
||||
const StringArray& getBlacklistedFiles() const;
|
||||
|
||||
/** Adds a plugin ID to the black-list. */
|
||||
void addToBlacklist (const String& pluginID);
|
||||
|
||||
/** Removes a plugin ID from the black-list. */
|
||||
void removeFromBlacklist (const String& pluginID);
|
||||
|
||||
/** Clears all the blacklisted files. */
|
||||
void clearBlacklistedFiles();
|
||||
|
||||
//==============================================================================
|
||||
/** Sort methods used to change the order of the plugins in the list.
|
||||
*/
|
||||
enum SortMethod
|
||||
{
|
||||
defaultOrder = 0,
|
||||
sortAlphabetically,
|
||||
sortByCategory,
|
||||
sortByManufacturer,
|
||||
sortByFormat,
|
||||
sortByFileSystemLocation,
|
||||
sortByInfoUpdateTime
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
/** 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.
|
||||
*/
|
||||
void addToMenu (PopupMenu& menu, SortMethod sortMethod,
|
||||
const String& currentlyTickedPluginID = String()) 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 addToMenu
|
||||
*/
|
||||
int getIndexChosenByMenu (int menuResultCode) const;
|
||||
|
||||
//==============================================================================
|
||||
/** Sorts the list. */
|
||||
void sort (SortMethod method, bool forwards);
|
||||
|
||||
//==============================================================================
|
||||
/** Creates some XML that can be used to store the state of this list. */
|
||||
XmlElement* createXml() const;
|
||||
|
||||
/** Recreates the state of this list from its stored XML format. */
|
||||
void recreateFromXml (const XmlElement& xml);
|
||||
|
||||
//==============================================================================
|
||||
/** A structure that recursively holds a tree of plugins.
|
||||
@see KnownPluginList::createTree()
|
||||
*/
|
||||
struct PluginTree
|
||||
{
|
||||
String folder; /**< The name of this folder in the tree */
|
||||
OwnedArray<PluginTree> subFolders;
|
||||
Array<const PluginDescription*> plugins;
|
||||
};
|
||||
|
||||
/** Creates a PluginTree object containing all the known plugins. */
|
||||
PluginTree* createTree (const SortMethod sortMethod) const;
|
||||
|
||||
//==============================================================================
|
||||
/** Class to define a custom plugin scanner */
|
||||
class CustomScanner
|
||||
{
|
||||
public:
|
||||
CustomScanner();
|
||||
virtual ~CustomScanner();
|
||||
|
||||
/** Attempts to load the given file and find a list of plugins in it.
|
||||
@returns true if the plugin loaded, false if it crashed
|
||||
*/
|
||||
virtual bool findPluginTypesFor (AudioPluginFormat& format,
|
||||
OwnedArray<PluginDescription>& result,
|
||||
const String& fileOrIdentifier) = 0;
|
||||
|
||||
/** Called when a scan has finished, to allow clean-up of resources. */
|
||||
virtual void scanFinished();
|
||||
|
||||
/** Returns true if the current scan should be abandoned.
|
||||
Any blocking methods should check this value repeatedly and return if
|
||||
if becomes true.
|
||||
*/
|
||||
bool shouldExit() const noexcept;
|
||||
};
|
||||
|
||||
/** Supplies a custom scanner to be used in future scans.
|
||||
The KnownPluginList will take ownership of the object passed in.
|
||||
*/
|
||||
void setCustomScanner (CustomScanner*);
|
||||
|
||||
private:
|
||||
//==============================================================================
|
||||
OwnedArray<PluginDescription> types;
|
||||
StringArray blacklist;
|
||||
std::unique_ptr<CustomScanner> scanner;
|
||||
CriticalSection scanLock, typesArrayLock;
|
||||
|
||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (KnownPluginList)
|
||||
};
|
||||
|
||||
} // namespace juce
|
@ -0,0 +1,140 @@
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2017 - ROLI Ltd.
|
||||
|
||||
JUCE is an open source library subject to commercial or open-source
|
||||
licensing.
|
||||
|
||||
By using JUCE, you agree to the terms of both the JUCE 5 End-User License
|
||||
Agreement and JUCE 5 Privacy Policy (both updated and effective as of the
|
||||
27th April 2017).
|
||||
|
||||
End User License Agreement: www.juce.com/juce-5-licence
|
||||
Privacy Policy: www.juce.com/juce-5-privacy-policy
|
||||
|
||||
Or: You may also use this code under the terms of the GPL v3 (see
|
||||
www.gnu.org/licenses).
|
||||
|
||||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
|
||||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
|
||||
DISCLAIMED.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
namespace juce
|
||||
{
|
||||
|
||||
static StringArray readDeadMansPedalFile (const File& file)
|
||||
{
|
||||
StringArray lines;
|
||||
file.readLines (lines);
|
||||
lines.removeEmptyStrings();
|
||||
return lines;
|
||||
}
|
||||
|
||||
PluginDirectoryScanner::PluginDirectoryScanner (KnownPluginList& listToAddTo,
|
||||
AudioPluginFormat& formatToLookFor,
|
||||
FileSearchPath directoriesToSearch,
|
||||
const bool recursive,
|
||||
const File& deadMansPedal,
|
||||
bool allowPluginsWhichRequireAsynchronousInstantiation)
|
||||
: list (listToAddTo),
|
||||
format (formatToLookFor),
|
||||
deadMansPedalFile (deadMansPedal),
|
||||
allowAsync (allowPluginsWhichRequireAsynchronousInstantiation)
|
||||
{
|
||||
directoriesToSearch.removeRedundantPaths();
|
||||
setFilesOrIdentifiersToScan (format.searchPathsForPlugins (directoriesToSearch, recursive, allowAsync));
|
||||
}
|
||||
|
||||
PluginDirectoryScanner::~PluginDirectoryScanner()
|
||||
{
|
||||
list.scanFinished();
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void PluginDirectoryScanner::setFilesOrIdentifiersToScan (const StringArray& filesOrIdentifiers)
|
||||
{
|
||||
filesOrIdentifiersToScan = filesOrIdentifiers;
|
||||
|
||||
// If any plugins have crashed recently when being loaded, move them to the
|
||||
// end of the list to give the others a chance to load correctly..
|
||||
for (auto& crashed : readDeadMansPedalFile (deadMansPedalFile))
|
||||
for (int j = filesOrIdentifiersToScan.size(); --j >= 0;)
|
||||
if (crashed == filesOrIdentifiersToScan[j])
|
||||
filesOrIdentifiersToScan.move (j, -1);
|
||||
|
||||
applyBlacklistingsFromDeadMansPedal (list, deadMansPedalFile);
|
||||
nextIndex.set (filesOrIdentifiersToScan.size());
|
||||
}
|
||||
|
||||
String PluginDirectoryScanner::getNextPluginFileThatWillBeScanned() const
|
||||
{
|
||||
return format.getNameOfPluginFromIdentifier (filesOrIdentifiersToScan [nextIndex.get() - 1]);
|
||||
}
|
||||
|
||||
void PluginDirectoryScanner::updateProgress()
|
||||
{
|
||||
progress = (1.0f - nextIndex.get() / (float) filesOrIdentifiersToScan.size());
|
||||
}
|
||||
|
||||
bool PluginDirectoryScanner::scanNextFile (bool dontRescanIfAlreadyInList,
|
||||
String& nameOfPluginBeingScanned)
|
||||
{
|
||||
const int index = --nextIndex;
|
||||
|
||||
if (index >= 0)
|
||||
{
|
||||
auto file = filesOrIdentifiersToScan [index];
|
||||
|
||||
if (file.isNotEmpty() && ! (dontRescanIfAlreadyInList && list.isListingUpToDate (file, format)))
|
||||
{
|
||||
nameOfPluginBeingScanned = format.getNameOfPluginFromIdentifier (file);
|
||||
|
||||
OwnedArray<PluginDescription> typesFound;
|
||||
|
||||
// Add this plugin to the end of the dead-man's pedal list in case it crashes...
|
||||
auto crashedPlugins = readDeadMansPedalFile (deadMansPedalFile);
|
||||
crashedPlugins.removeString (file);
|
||||
crashedPlugins.add (file);
|
||||
setDeadMansPedalFile (crashedPlugins);
|
||||
|
||||
list.scanAndAddFile (file, dontRescanIfAlreadyInList, typesFound, format);
|
||||
|
||||
// Managed to load without crashing, so remove it from the dead-man's-pedal..
|
||||
crashedPlugins.removeString (file);
|
||||
setDeadMansPedalFile (crashedPlugins);
|
||||
|
||||
if (typesFound.size() == 0 && ! list.getBlacklistedFiles().contains (file))
|
||||
failedFiles.add (file);
|
||||
}
|
||||
}
|
||||
|
||||
updateProgress();
|
||||
return index > 0;
|
||||
}
|
||||
|
||||
bool PluginDirectoryScanner::skipNextFile()
|
||||
{
|
||||
updateProgress();
|
||||
return --nextIndex > 0;
|
||||
}
|
||||
|
||||
void PluginDirectoryScanner::setDeadMansPedalFile (const StringArray& newContents)
|
||||
{
|
||||
if (deadMansPedalFile.getFullPathName().isNotEmpty())
|
||||
deadMansPedalFile.replaceWithText (newContents.joinIntoString ("\n"), true, true);
|
||||
}
|
||||
|
||||
void PluginDirectoryScanner::applyBlacklistingsFromDeadMansPedal (KnownPluginList& list, const File& file)
|
||||
{
|
||||
// If any plugins have crashed recently when being loaded, move them to the
|
||||
// end of the list to give the others a chance to load correctly..
|
||||
for (auto& crashedPlugin : readDeadMansPedalFile (file))
|
||||
list.addToBlacklist (crashedPlugin);
|
||||
}
|
||||
|
||||
} // namespace juce
|
@ -0,0 +1,139 @@
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2017 - ROLI Ltd.
|
||||
|
||||
JUCE is an open source library subject to commercial or open-source
|
||||
licensing.
|
||||
|
||||
By using JUCE, you agree to the terms of both the JUCE 5 End-User License
|
||||
Agreement and JUCE 5 Privacy Policy (both updated and effective as of the
|
||||
27th April 2017).
|
||||
|
||||
End User License Agreement: www.juce.com/juce-5-licence
|
||||
Privacy Policy: www.juce.com/juce-5-privacy-policy
|
||||
|
||||
Or: You may also use this code under the terms of the GPL v3 (see
|
||||
www.gnu.org/licenses).
|
||||
|
||||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
|
||||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
|
||||
DISCLAIMED.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
namespace juce
|
||||
{
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
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.
|
||||
|
||||
@tags{Audio}
|
||||
*/
|
||||
class JUCE_API PluginDirectoryScanner
|
||||
{
|
||||
public:
|
||||
//==============================================================================
|
||||
/**
|
||||
Creates a scanner.
|
||||
|
||||
@param listToAddResultsTo this will get the new types added to it.
|
||||
@param formatToLookFor this is the type of format that you want to look for
|
||||
@param directoriesToSearch the path to search
|
||||
@param searchRecursively true to search recursively
|
||||
@param deadMansPedalFile if this isn't File(), 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.
|
||||
@param allowPluginsWhichRequireAsynchronousInstantiation
|
||||
If this is false then the scanner will exclude plug-ins
|
||||
asynchronous creation - such as AUv3 plug-ins.
|
||||
*/
|
||||
PluginDirectoryScanner (KnownPluginList& listToAddResultsTo,
|
||||
AudioPluginFormat& formatToLookFor,
|
||||
FileSearchPath directoriesToSearch,
|
||||
bool searchRecursively,
|
||||
const File& deadMansPedalFile,
|
||||
bool allowPluginsWhichRequireAsynchronousInstantiation = false);
|
||||
|
||||
/** Destructor. */
|
||||
~PluginDirectoryScanner();
|
||||
|
||||
//==============================================================================
|
||||
/** Sets a specific list of filesOrIdentifiersToScan to scan.
|
||||
N.B. This list must match the format passed to the constructor.
|
||||
@see AudioPluginFormat::searchPathsForPlugins
|
||||
*/
|
||||
void setFilesOrIdentifiersToScan (const StringArray& filesOrIdentifiersToScan);
|
||||
|
||||
/** 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.
|
||||
The nameOfPluginBeingScanned will be updated to the name of the plugin being
|
||||
scanned before the scan starts.
|
||||
|
||||
Returns false when there are no more files to try.
|
||||
*/
|
||||
bool scanNextFile (bool dontRescanIfAlreadyInList,
|
||||
String& nameOfPluginBeingScanned);
|
||||
|
||||
/** Skips over the next file without scanning it.
|
||||
Returns false when there are no more files to try.
|
||||
*/
|
||||
bool skipNextFile();
|
||||
|
||||
/** 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.
|
||||
*/
|
||||
String getNextPluginFileThatWillBeScanned() const;
|
||||
|
||||
/** Returns the estimated progress, between 0 and 1. */
|
||||
float getProgress() const { return progress; }
|
||||
|
||||
/** 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.
|
||||
*/
|
||||
const StringArray& getFailedFiles() const noexcept { return failedFiles; }
|
||||
|
||||
/** Reads the given dead-mans-pedal file and applies its contents to the list. */
|
||||
static void applyBlacklistingsFromDeadMansPedal (KnownPluginList& listToApplyTo,
|
||||
const File& deadMansPedalFile);
|
||||
|
||||
private:
|
||||
//==============================================================================
|
||||
KnownPluginList& list;
|
||||
AudioPluginFormat& format;
|
||||
StringArray filesOrIdentifiersToScan;
|
||||
File deadMansPedalFile;
|
||||
StringArray failedFiles;
|
||||
Atomic<int> nextIndex;
|
||||
float progress = 0;
|
||||
const bool allowAsync;
|
||||
|
||||
void updateProgress();
|
||||
void setDeadMansPedalFile (const StringArray& newContents);
|
||||
|
||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PluginDirectoryScanner)
|
||||
};
|
||||
|
||||
} // namespace juce
|
@ -0,0 +1,602 @@
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2017 - ROLI Ltd.
|
||||
|
||||
JUCE is an open source library subject to commercial or open-source
|
||||
licensing.
|
||||
|
||||
By using JUCE, you agree to the terms of both the JUCE 5 End-User License
|
||||
Agreement and JUCE 5 Privacy Policy (both updated and effective as of the
|
||||
27th April 2017).
|
||||
|
||||
End User License Agreement: www.juce.com/juce-5-licence
|
||||
Privacy Policy: www.juce.com/juce-5-privacy-policy
|
||||
|
||||
Or: You may also use this code under the terms of the GPL v3 (see
|
||||
www.gnu.org/licenses).
|
||||
|
||||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
|
||||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
|
||||
DISCLAIMED.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
namespace juce
|
||||
{
|
||||
|
||||
class PluginListComponent::TableModel : public TableListBoxModel
|
||||
{
|
||||
public:
|
||||
TableModel (PluginListComponent& c, KnownPluginList& l) : owner (c), list (l) {}
|
||||
|
||||
int getNumRows() override
|
||||
{
|
||||
return list.getNumTypes() + list.getBlacklistedFiles().size();
|
||||
}
|
||||
|
||||
void paintRowBackground (Graphics& g, int /*rowNumber*/, int /*width*/, int /*height*/, bool rowIsSelected) override
|
||||
{
|
||||
const auto defaultColour = owner.findColour (ListBox::backgroundColourId);
|
||||
const auto c = rowIsSelected ? defaultColour.interpolatedWith (owner.findColour (ListBox::textColourId), 0.5f)
|
||||
: defaultColour;
|
||||
|
||||
g.fillAll (c);
|
||||
}
|
||||
|
||||
enum
|
||||
{
|
||||
nameCol = 1,
|
||||
typeCol = 2,
|
||||
categoryCol = 3,
|
||||
manufacturerCol = 4,
|
||||
descCol = 5
|
||||
};
|
||||
|
||||
void paintCell (Graphics& g, int row, int columnId, int width, int height, bool /*rowIsSelected*/) override
|
||||
{
|
||||
String text;
|
||||
bool isBlacklisted = row >= list.getNumTypes();
|
||||
|
||||
if (isBlacklisted)
|
||||
{
|
||||
if (columnId == nameCol)
|
||||
text = list.getBlacklistedFiles() [row - list.getNumTypes()];
|
||||
else if (columnId == descCol)
|
||||
text = TRANS("Deactivated after failing to initialise correctly");
|
||||
}
|
||||
else if (const PluginDescription* const desc = list.getType (row))
|
||||
{
|
||||
switch (columnId)
|
||||
{
|
||||
case nameCol: text = desc->name; break;
|
||||
case typeCol: text = desc->pluginFormatName; break;
|
||||
case categoryCol: text = desc->category.isNotEmpty() ? desc->category : "-"; break;
|
||||
case manufacturerCol: text = desc->manufacturerName; break;
|
||||
case descCol: text = getPluginDescription (*desc); break;
|
||||
|
||||
default: jassertfalse; break;
|
||||
}
|
||||
}
|
||||
|
||||
if (text.isNotEmpty())
|
||||
{
|
||||
const auto defaultTextColour = owner.findColour (ListBox::textColourId);
|
||||
g.setColour (isBlacklisted ? Colours::red
|
||||
: columnId == nameCol ? defaultTextColour
|
||||
: defaultTextColour.interpolatedWith (Colours::transparentBlack, 0.3f));
|
||||
g.setFont (Font (height * 0.7f, Font::bold));
|
||||
g.drawFittedText (text, 4, 0, width - 6, height, Justification::centredLeft, 1, 0.9f);
|
||||
}
|
||||
}
|
||||
|
||||
void deleteKeyPressed (int) override
|
||||
{
|
||||
owner.removeSelectedPlugins();
|
||||
}
|
||||
|
||||
void sortOrderChanged (int newSortColumnId, bool isForwards) override
|
||||
{
|
||||
switch (newSortColumnId)
|
||||
{
|
||||
case nameCol: list.sort (KnownPluginList::sortAlphabetically, isForwards); break;
|
||||
case typeCol: list.sort (KnownPluginList::sortByFormat, isForwards); break;
|
||||
case categoryCol: list.sort (KnownPluginList::sortByCategory, isForwards); break;
|
||||
case manufacturerCol: list.sort (KnownPluginList::sortByManufacturer, isForwards); break;
|
||||
case descCol: break;
|
||||
|
||||
default: jassertfalse; break;
|
||||
}
|
||||
}
|
||||
|
||||
static String getPluginDescription (const PluginDescription& desc)
|
||||
{
|
||||
StringArray items;
|
||||
|
||||
if (desc.descriptiveName != desc.name)
|
||||
items.add (desc.descriptiveName);
|
||||
|
||||
items.add (desc.version);
|
||||
|
||||
items.removeEmptyStrings();
|
||||
return items.joinIntoString (" - ");
|
||||
}
|
||||
|
||||
PluginListComponent& owner;
|
||||
KnownPluginList& list;
|
||||
|
||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (TableModel)
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
PluginListComponent::PluginListComponent (AudioPluginFormatManager& manager, KnownPluginList& listToEdit,
|
||||
const File& deadMansPedal, PropertiesFile* const props,
|
||||
bool allowPluginsWhichRequireAsynchronousInstantiation)
|
||||
: formatManager (manager),
|
||||
list (listToEdit),
|
||||
deadMansPedalFile (deadMansPedal),
|
||||
optionsButton ("Options..."),
|
||||
propertiesToUse (props),
|
||||
allowAsync (allowPluginsWhichRequireAsynchronousInstantiation),
|
||||
numThreads (allowAsync ? 1 : 0)
|
||||
{
|
||||
tableModel.reset (new TableModel (*this, listToEdit));
|
||||
|
||||
TableHeaderComponent& header = table.getHeader();
|
||||
|
||||
header.addColumn (TRANS("Name"), TableModel::nameCol, 200, 100, 700, TableHeaderComponent::defaultFlags | TableHeaderComponent::sortedForwards);
|
||||
header.addColumn (TRANS("Format"), TableModel::typeCol, 80, 80, 80, TableHeaderComponent::notResizable);
|
||||
header.addColumn (TRANS("Category"), TableModel::categoryCol, 100, 100, 200);
|
||||
header.addColumn (TRANS("Manufacturer"), TableModel::manufacturerCol, 200, 100, 300);
|
||||
header.addColumn (TRANS("Description"), TableModel::descCol, 300, 100, 500, TableHeaderComponent::notSortable);
|
||||
|
||||
table.setHeaderHeight (22);
|
||||
table.setRowHeight (20);
|
||||
table.setModel (tableModel.get());
|
||||
table.setMultipleSelectionEnabled (true);
|
||||
addAndMakeVisible (table);
|
||||
|
||||
addAndMakeVisible (optionsButton);
|
||||
optionsButton.onClick = [this] { showOptionsMenu(); };
|
||||
optionsButton.setTriggeredOnMouseDown (true);
|
||||
|
||||
setSize (400, 600);
|
||||
list.addChangeListener (this);
|
||||
updateList();
|
||||
table.getHeader().reSortTable();
|
||||
|
||||
PluginDirectoryScanner::applyBlacklistingsFromDeadMansPedal (list, deadMansPedalFile);
|
||||
deadMansPedalFile.deleteFile();
|
||||
}
|
||||
|
||||
PluginListComponent::~PluginListComponent()
|
||||
{
|
||||
list.removeChangeListener (this);
|
||||
}
|
||||
|
||||
void PluginListComponent::setOptionsButtonText (const String& newText)
|
||||
{
|
||||
optionsButton.setButtonText (newText);
|
||||
resized();
|
||||
}
|
||||
|
||||
void PluginListComponent::setScanDialogText (const String& title, const String& content)
|
||||
{
|
||||
dialogTitle = title;
|
||||
dialogText = content;
|
||||
}
|
||||
|
||||
void PluginListComponent::setNumberOfThreadsForScanning (int num)
|
||||
{
|
||||
numThreads = num;
|
||||
}
|
||||
|
||||
void PluginListComponent::resized()
|
||||
{
|
||||
Rectangle<int> r (getLocalBounds().reduced (2));
|
||||
|
||||
optionsButton.setBounds (r.removeFromBottom (24));
|
||||
optionsButton.changeWidthToFitText (24);
|
||||
|
||||
r.removeFromBottom (3);
|
||||
table.setBounds (r);
|
||||
}
|
||||
|
||||
void PluginListComponent::changeListenerCallback (ChangeBroadcaster*)
|
||||
{
|
||||
table.getHeader().reSortTable();
|
||||
updateList();
|
||||
}
|
||||
|
||||
void PluginListComponent::updateList()
|
||||
{
|
||||
table.updateContent();
|
||||
table.repaint();
|
||||
}
|
||||
|
||||
void PluginListComponent::removeSelectedPlugins()
|
||||
{
|
||||
const SparseSet<int> selected (table.getSelectedRows());
|
||||
|
||||
for (int i = table.getNumRows(); --i >= 0;)
|
||||
if (selected.contains (i))
|
||||
removePluginItem (i);
|
||||
}
|
||||
|
||||
void PluginListComponent::setTableModel (TableListBoxModel* model)
|
||||
{
|
||||
table.setModel (nullptr);
|
||||
tableModel.reset (model);
|
||||
table.setModel (tableModel.get());
|
||||
|
||||
table.getHeader().reSortTable();
|
||||
table.updateContent();
|
||||
table.repaint();
|
||||
}
|
||||
|
||||
bool PluginListComponent::canShowSelectedFolder() const
|
||||
{
|
||||
if (const PluginDescription* const desc = list.getType (table.getSelectedRow()))
|
||||
return File::createFileWithoutCheckingPath (desc->fileOrIdentifier).exists();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void PluginListComponent::showSelectedFolder()
|
||||
{
|
||||
if (canShowSelectedFolder())
|
||||
if (const PluginDescription* const desc = list.getType (table.getSelectedRow()))
|
||||
File (desc->fileOrIdentifier).getParentDirectory().startAsProcess();
|
||||
}
|
||||
|
||||
void PluginListComponent::removeMissingPlugins()
|
||||
{
|
||||
for (int i = list.getNumTypes(); --i >= 0;)
|
||||
if (! formatManager.doesPluginStillExist (*list.getType (i)))
|
||||
list.removeType (i);
|
||||
}
|
||||
|
||||
void PluginListComponent::removePluginItem (int index)
|
||||
{
|
||||
if (index < list.getNumTypes())
|
||||
list.removeType (index);
|
||||
else
|
||||
list.removeFromBlacklist (list.getBlacklistedFiles() [index - list.getNumTypes()]);
|
||||
}
|
||||
|
||||
void PluginListComponent::optionsMenuStaticCallback (int result, PluginListComponent* pluginList)
|
||||
{
|
||||
if (pluginList != nullptr)
|
||||
pluginList->optionsMenuCallback (result);
|
||||
}
|
||||
|
||||
void PluginListComponent::optionsMenuCallback (int result)
|
||||
{
|
||||
switch (result)
|
||||
{
|
||||
case 0: break;
|
||||
case 1: list.clear(); break;
|
||||
case 2: removeSelectedPlugins(); break;
|
||||
case 3: showSelectedFolder(); break;
|
||||
case 4: removeMissingPlugins(); break;
|
||||
|
||||
default:
|
||||
if (AudioPluginFormat* format = formatManager.getFormat (result - 10))
|
||||
scanFor (*format);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void PluginListComponent::showOptionsMenu()
|
||||
{
|
||||
PopupMenu menu;
|
||||
menu.addItem (1, TRANS("Clear list"));
|
||||
menu.addItem (2, TRANS("Remove selected plug-in from list"), table.getNumSelectedRows() > 0);
|
||||
menu.addItem (3, TRANS("Show folder containing selected plug-in"), canShowSelectedFolder());
|
||||
menu.addItem (4, TRANS("Remove any plug-ins whose files no longer exist"));
|
||||
menu.addSeparator();
|
||||
|
||||
for (int i = 0; i < formatManager.getNumFormats(); ++i)
|
||||
{
|
||||
auto* format = formatManager.getFormat (i);
|
||||
|
||||
if (format->canScanForPlugins())
|
||||
menu.addItem (10 + i, "Scan for new or updated " + format->getName() + " plug-ins");
|
||||
}
|
||||
|
||||
menu.showMenuAsync (PopupMenu::Options().withTargetComponent (&optionsButton),
|
||||
ModalCallbackFunction::forComponent (optionsMenuStaticCallback, this));
|
||||
}
|
||||
|
||||
bool PluginListComponent::isInterestedInFileDrag (const StringArray& /*files*/)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void PluginListComponent::filesDropped (const StringArray& files, int, int)
|
||||
{
|
||||
OwnedArray<PluginDescription> typesFound;
|
||||
list.scanAndAddDragAndDroppedFiles (formatManager, files, typesFound);
|
||||
}
|
||||
|
||||
FileSearchPath PluginListComponent::getLastSearchPath (PropertiesFile& properties, AudioPluginFormat& format)
|
||||
{
|
||||
return FileSearchPath (properties.getValue ("lastPluginScanPath_" + format.getName(),
|
||||
format.getDefaultLocationsToSearch().toString()));
|
||||
}
|
||||
|
||||
void PluginListComponent::setLastSearchPath (PropertiesFile& properties, AudioPluginFormat& format,
|
||||
const FileSearchPath& newPath)
|
||||
{
|
||||
properties.setValue ("lastPluginScanPath_" + format.getName(), newPath.toString());
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
class PluginListComponent::Scanner : private Timer
|
||||
{
|
||||
public:
|
||||
Scanner (PluginListComponent& plc, AudioPluginFormat& format, const StringArray& filesOrIdentifiers,
|
||||
PropertiesFile* properties, bool allowPluginsWhichRequireAsynchronousInstantiation, int threads,
|
||||
const String& title, const String& text)
|
||||
: owner (plc), formatToScan (format), filesOrIdentifiersToScan (filesOrIdentifiers), propertiesToUse (properties),
|
||||
pathChooserWindow (TRANS("Select folders to scan..."), String(), AlertWindow::NoIcon),
|
||||
progressWindow (title, text, AlertWindow::NoIcon),
|
||||
progress (0.0), numThreads (threads), allowAsync (allowPluginsWhichRequireAsynchronousInstantiation),
|
||||
finished (false)
|
||||
{
|
||||
FileSearchPath path (formatToScan.getDefaultLocationsToSearch());
|
||||
|
||||
// You need to use at least one thread when scanning plug-ins asynchronously
|
||||
jassert (! allowAsync || (numThreads > 0));
|
||||
|
||||
// If the filesOrIdentifiersToScan argumnent isn't empty, we should only scan these
|
||||
// If the path is empty, then paths aren't used for this format.
|
||||
if (filesOrIdentifiersToScan.isEmpty() && path.getNumPaths() > 0)
|
||||
{
|
||||
#if ! JUCE_IOS
|
||||
if (propertiesToUse != nullptr)
|
||||
path = getLastSearchPath (*propertiesToUse, formatToScan);
|
||||
#endif
|
||||
|
||||
pathList.setSize (500, 300);
|
||||
pathList.setPath (path);
|
||||
|
||||
pathChooserWindow.addCustomComponent (&pathList);
|
||||
pathChooserWindow.addButton (TRANS("Scan"), 1, KeyPress (KeyPress::returnKey));
|
||||
pathChooserWindow.addButton (TRANS("Cancel"), 0, KeyPress (KeyPress::escapeKey));
|
||||
|
||||
pathChooserWindow.enterModalState (true,
|
||||
ModalCallbackFunction::forComponent (startScanCallback,
|
||||
&pathChooserWindow, this),
|
||||
false);
|
||||
}
|
||||
else
|
||||
{
|
||||
startScan();
|
||||
}
|
||||
}
|
||||
|
||||
~Scanner()
|
||||
{
|
||||
if (pool != nullptr)
|
||||
{
|
||||
pool->removeAllJobs (true, 60000);
|
||||
pool.reset();
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
PluginListComponent& owner;
|
||||
AudioPluginFormat& formatToScan;
|
||||
StringArray filesOrIdentifiersToScan;
|
||||
PropertiesFile* propertiesToUse;
|
||||
std::unique_ptr<PluginDirectoryScanner> scanner;
|
||||
AlertWindow pathChooserWindow, progressWindow;
|
||||
FileSearchPathListComponent pathList;
|
||||
String pluginBeingScanned;
|
||||
double progress;
|
||||
int numThreads;
|
||||
bool allowAsync, finished;
|
||||
std::unique_ptr<ThreadPool> pool;
|
||||
|
||||
static void startScanCallback (int result, AlertWindow* alert, Scanner* scanner)
|
||||
{
|
||||
if (alert != nullptr && scanner != nullptr)
|
||||
{
|
||||
if (result != 0)
|
||||
scanner->warnUserAboutStupidPaths();
|
||||
else
|
||||
scanner->finishedScan();
|
||||
}
|
||||
}
|
||||
|
||||
// Try to dissuade people from to scanning their entire C: drive, or other system folders.
|
||||
void warnUserAboutStupidPaths()
|
||||
{
|
||||
for (int i = 0; i < pathList.getPath().getNumPaths(); ++i)
|
||||
{
|
||||
const File f (pathList.getPath()[i]);
|
||||
|
||||
if (isStupidPath (f))
|
||||
{
|
||||
AlertWindow::showOkCancelBox (AlertWindow::WarningIcon,
|
||||
TRANS("Plugin Scanning"),
|
||||
TRANS("If you choose to scan folders that contain non-plugin files, "
|
||||
"then scanning may take a long time, and can cause crashes when "
|
||||
"attempting to load unsuitable files.")
|
||||
+ newLine
|
||||
+ TRANS ("Are you sure you want to scan the folder \"XYZ\"?")
|
||||
.replace ("XYZ", f.getFullPathName()),
|
||||
TRANS ("Scan"),
|
||||
String(),
|
||||
nullptr,
|
||||
ModalCallbackFunction::create (warnAboutStupidPathsCallback, this));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
startScan();
|
||||
}
|
||||
|
||||
static bool isStupidPath (const File& f)
|
||||
{
|
||||
Array<File> roots;
|
||||
File::findFileSystemRoots (roots);
|
||||
|
||||
if (roots.contains (f))
|
||||
return true;
|
||||
|
||||
File::SpecialLocationType pathsThatWouldBeStupidToScan[]
|
||||
= { File::globalApplicationsDirectory,
|
||||
File::userHomeDirectory,
|
||||
File::userDocumentsDirectory,
|
||||
File::userDesktopDirectory,
|
||||
File::tempDirectory,
|
||||
File::userMusicDirectory,
|
||||
File::userMoviesDirectory,
|
||||
File::userPicturesDirectory };
|
||||
|
||||
for (int i = 0; i < numElementsInArray (pathsThatWouldBeStupidToScan); ++i)
|
||||
{
|
||||
const File sillyFolder (File::getSpecialLocation (pathsThatWouldBeStupidToScan[i]));
|
||||
|
||||
if (f == sillyFolder || sillyFolder.isAChildOf (f))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static void warnAboutStupidPathsCallback (int result, Scanner* scanner)
|
||||
{
|
||||
if (result != 0)
|
||||
scanner->startScan();
|
||||
else
|
||||
scanner->finishedScan();
|
||||
}
|
||||
|
||||
void startScan()
|
||||
{
|
||||
pathChooserWindow.setVisible (false);
|
||||
|
||||
scanner.reset (new PluginDirectoryScanner (owner.list, formatToScan, pathList.getPath(),
|
||||
true, owner.deadMansPedalFile, allowAsync));
|
||||
|
||||
if (! filesOrIdentifiersToScan.isEmpty())
|
||||
{
|
||||
scanner->setFilesOrIdentifiersToScan (filesOrIdentifiersToScan);
|
||||
}
|
||||
else if (propertiesToUse != nullptr)
|
||||
{
|
||||
setLastSearchPath (*propertiesToUse, formatToScan, pathList.getPath());
|
||||
propertiesToUse->saveIfNeeded();
|
||||
}
|
||||
|
||||
progressWindow.addButton (TRANS("Cancel"), 0, KeyPress (KeyPress::escapeKey));
|
||||
progressWindow.addProgressBarComponent (progress);
|
||||
progressWindow.enterModalState();
|
||||
|
||||
if (numThreads > 0)
|
||||
{
|
||||
pool.reset (new ThreadPool (numThreads));
|
||||
|
||||
for (int i = numThreads; --i >= 0;)
|
||||
pool->addJob (new ScanJob (*this), true);
|
||||
}
|
||||
|
||||
startTimer (20);
|
||||
}
|
||||
|
||||
void finishedScan()
|
||||
{
|
||||
owner.scanFinished (scanner != nullptr ? scanner->getFailedFiles()
|
||||
: StringArray());
|
||||
}
|
||||
|
||||
void timerCallback() override
|
||||
{
|
||||
if (pool == nullptr)
|
||||
{
|
||||
if (doNextScan())
|
||||
startTimer (20);
|
||||
}
|
||||
|
||||
if (! progressWindow.isCurrentlyModal())
|
||||
finished = true;
|
||||
|
||||
if (finished)
|
||||
finishedScan();
|
||||
else
|
||||
progressWindow.setMessage (TRANS("Testing") + ":\n\n" + pluginBeingScanned);
|
||||
}
|
||||
|
||||
bool doNextScan()
|
||||
{
|
||||
if (scanner->scanNextFile (true, pluginBeingScanned))
|
||||
{
|
||||
progress = scanner->getProgress();
|
||||
return true;
|
||||
}
|
||||
|
||||
finished = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
struct ScanJob : public ThreadPoolJob
|
||||
{
|
||||
ScanJob (Scanner& s) : ThreadPoolJob ("pluginscan"), scanner (s) {}
|
||||
|
||||
JobStatus runJob()
|
||||
{
|
||||
while (scanner.doNextScan() && ! shouldExit())
|
||||
{}
|
||||
|
||||
return jobHasFinished;
|
||||
}
|
||||
|
||||
Scanner& scanner;
|
||||
|
||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ScanJob)
|
||||
};
|
||||
|
||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Scanner)
|
||||
};
|
||||
|
||||
void PluginListComponent::scanFor (AudioPluginFormat& format)
|
||||
{
|
||||
scanFor (format, StringArray());
|
||||
}
|
||||
|
||||
void PluginListComponent::scanFor (AudioPluginFormat& format, const StringArray& filesOrIdentifiersToScan)
|
||||
{
|
||||
currentScanner.reset (new Scanner (*this, format, filesOrIdentifiersToScan, propertiesToUse, allowAsync, numThreads,
|
||||
dialogTitle.isNotEmpty() ? dialogTitle : TRANS("Scanning for plug-ins..."),
|
||||
dialogText.isNotEmpty() ? dialogText : TRANS("Searching for all possible plug-in files...")));
|
||||
}
|
||||
|
||||
bool PluginListComponent::isScanning() const noexcept
|
||||
{
|
||||
return currentScanner != nullptr;
|
||||
}
|
||||
|
||||
void PluginListComponent::scanFinished (const StringArray& failedFiles)
|
||||
{
|
||||
StringArray shortNames;
|
||||
|
||||
for (auto& f : failedFiles)
|
||||
shortNames.add (File::createFileWithoutCheckingPath (f).getFileName());
|
||||
|
||||
currentScanner.reset(); // mustn't delete this before using the failed files array
|
||||
|
||||
if (shortNames.size() > 0)
|
||||
AlertWindow::showMessageBoxAsync (AlertWindow::InfoIcon,
|
||||
TRANS("Scan complete"),
|
||||
TRANS("Note that the following files appeared to be plugin files, but failed to load correctly")
|
||||
+ ":\n\n"
|
||||
+ shortNames.joinIntoString (", "));
|
||||
}
|
||||
|
||||
} // namespace juce
|
@ -0,0 +1,138 @@
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
This file is part of the JUCE library.
|
||||
Copyright (c) 2017 - ROLI Ltd.
|
||||
|
||||
JUCE is an open source library subject to commercial or open-source
|
||||
licensing.
|
||||
|
||||
By using JUCE, you agree to the terms of both the JUCE 5 End-User License
|
||||
Agreement and JUCE 5 Privacy Policy (both updated and effective as of the
|
||||
27th April 2017).
|
||||
|
||||
End User License Agreement: www.juce.com/juce-5-licence
|
||||
Privacy Policy: www.juce.com/juce-5-privacy-policy
|
||||
|
||||
Or: You may also use this code under the terms of the GPL v3 (see
|
||||
www.gnu.org/licenses).
|
||||
|
||||
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
|
||||
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
|
||||
DISCLAIMED.
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
namespace juce
|
||||
{
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
A component displaying a list of plugins, with options to scan for them,
|
||||
add, remove and sort them.
|
||||
|
||||
@tags{Audio}
|
||||
*/
|
||||
class JUCE_API PluginListComponent : public Component,
|
||||
public FileDragAndDropTarget,
|
||||
private ChangeListener
|
||||
{
|
||||
public:
|
||||
//==============================================================================
|
||||
/**
|
||||
Creates the list component.
|
||||
|
||||
For info about the deadMansPedalFile, see the PluginDirectoryScanner constructor.
|
||||
The properties file, if supplied, is used to store the user's last search paths.
|
||||
*/
|
||||
PluginListComponent (AudioPluginFormatManager& formatManager,
|
||||
KnownPluginList& listToRepresent,
|
||||
const File& deadMansPedalFile,
|
||||
PropertiesFile* propertiesToUse,
|
||||
bool allowPluginsWhichRequireAsynchronousInstantiation = false);
|
||||
|
||||
/** Destructor. */
|
||||
~PluginListComponent();
|
||||
|
||||
/** Changes the text in the panel's options button. */
|
||||
void setOptionsButtonText (const String& newText);
|
||||
|
||||
/** Changes the text in the progress dialog box that is shown when scanning. */
|
||||
void setScanDialogText (const String& textForProgressWindowTitle,
|
||||
const String& textForProgressWindowDescription);
|
||||
|
||||
/** Sets how many threads to simultaneously scan for plugins.
|
||||
If this is 0, then all scanning happens on the message thread (this is the default when
|
||||
allowPluginsWhichRequireAsynchronousInstantiation is false). If
|
||||
allowPluginsWhichRequireAsynchronousInstantiation is true then numThreads must not
|
||||
be zero (it is one by default). */
|
||||
void setNumberOfThreadsForScanning (int numThreads);
|
||||
|
||||
/** Returns the last search path stored in a given properties file for the specified format. */
|
||||
static FileSearchPath getLastSearchPath (PropertiesFile&, AudioPluginFormat&);
|
||||
|
||||
/** Stores a search path in a properties file for the given format. */
|
||||
static void setLastSearchPath (PropertiesFile&, AudioPluginFormat&, const FileSearchPath&);
|
||||
|
||||
/** Triggers an asynchronous scan for the given format. */
|
||||
void scanFor (AudioPluginFormat&);
|
||||
|
||||
/** Triggers an asynchronous scan for the given format and scans only the given files or identifiers.
|
||||
@see AudioPluginFormat::searchPathsForPlugins
|
||||
*/
|
||||
void scanFor (AudioPluginFormat&, const StringArray& filesOrIdentifiersToScan);
|
||||
|
||||
/** Returns true if there's currently a scan in progress. */
|
||||
bool isScanning() const noexcept;
|
||||
|
||||
/** Removes the plugins currently selected in the table. */
|
||||
void removeSelectedPlugins();
|
||||
|
||||
/** Sets a custom table model to be used.
|
||||
This will take ownership of the model and delete it when no longer needed.
|
||||
*/
|
||||
void setTableModel (TableListBoxModel* model);
|
||||
|
||||
/** Returns the table used to display the plugin list. */
|
||||
TableListBox& getTableListBox() noexcept { return table; }
|
||||
|
||||
private:
|
||||
//==============================================================================
|
||||
AudioPluginFormatManager& formatManager;
|
||||
KnownPluginList& list;
|
||||
File deadMansPedalFile;
|
||||
TableListBox table;
|
||||
TextButton optionsButton;
|
||||
PropertiesFile* propertiesToUse;
|
||||
String dialogTitle, dialogText;
|
||||
bool allowAsync;
|
||||
int numThreads;
|
||||
|
||||
class TableModel;
|
||||
std::unique_ptr<TableListBoxModel> tableModel;
|
||||
|
||||
class Scanner;
|
||||
friend class Scanner;
|
||||
friend struct ContainerDeletePolicy<Scanner>;
|
||||
std::unique_ptr<Scanner> currentScanner;
|
||||
|
||||
void scanFinished (const StringArray&);
|
||||
static void optionsMenuStaticCallback (int, PluginListComponent*);
|
||||
void optionsMenuCallback (int);
|
||||
void updateList();
|
||||
void showSelectedFolder();
|
||||
bool canShowSelectedFolder() const;
|
||||
void removeMissingPlugins();
|
||||
void removePluginItem (int index);
|
||||
void showOptionsMenu();
|
||||
|
||||
void resized() override;
|
||||
bool isInterestedInFileDrag (const StringArray&) override;
|
||||
void filesDropped (const StringArray&, int, int) override;
|
||||
void changeListenerCallback (ChangeBroadcaster*) override;
|
||||
|
||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PluginListComponent)
|
||||
};
|
||||
|
||||
} // namespace juce
|
Reference in New Issue
Block a user