mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-14 00:14:18 +00:00
Exposing some plugin scan path property values.
This commit is contained in:
parent
e6ef1cf3f0
commit
fb57b879aa
2 changed files with 21 additions and 2 deletions
|
|
@ -243,6 +243,18 @@ void PluginListComponent::filesDropped (const StringArray& files, int, int)
|
|||
list.scanAndAddDragAndDroppedFiles (formatManager, files, typesFound);
|
||||
}
|
||||
|
||||
FileSearchPath PluginListComponent::getLastSearchPath (PropertiesFile& properties, AudioPluginFormat& format)
|
||||
{
|
||||
return 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
|
||||
{
|
||||
|
|
@ -262,7 +274,7 @@ public:
|
|||
if (path.getNumPaths() > 0) // if the path is empty, then paths aren't used for this format.
|
||||
{
|
||||
if (propertiesToUse != nullptr)
|
||||
path = propertiesToUse->getValue ("lastPluginScanPath_" + formatToScan.getName(), path.toString());
|
||||
path = getLastSearchPath (*propertiesToUse, formatToScan);
|
||||
|
||||
pathList.setSize (500, 300);
|
||||
pathList.setPath (path);
|
||||
|
|
@ -311,7 +323,7 @@ private:
|
|||
|
||||
if (propertiesToUse != nullptr)
|
||||
{
|
||||
propertiesToUse->setValue ("lastPluginScanPath_" + formatToScan.getName(), pathList.getPath().toString());
|
||||
setLastSearchPath (*propertiesToUse, formatToScan, pathList.getPath());
|
||||
propertiesToUse->saveIfNeeded();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -66,6 +66,13 @@ public:
|
|||
*/
|
||||
void setNumberOfThreadsForScanning (int numThreads);
|
||||
|
||||
/** Returns the last search path stored in a given properties file for the specified format. */
|
||||
static FileSearchPath getLastSearchPath (PropertiesFile& properties, AudioPluginFormat& format);
|
||||
|
||||
/** Stores a search path in a properties file for the given format. */
|
||||
static void setLastSearchPath (PropertiesFile& properties, AudioPluginFormat& format,
|
||||
const FileSearchPath& newPath);
|
||||
|
||||
//==============================================================================
|
||||
/** @internal */
|
||||
void resized();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue