Browse Source

Exposing some plugin scan path property values.

tags/2021-05-28
jules 12 years ago
parent
commit
fb57b879aa
2 changed files with 21 additions and 2 deletions
  1. +14
    -2
      modules/juce_audio_processors/scanning/juce_PluginListComponent.cpp
  2. +7
    -0
      modules/juce_audio_processors/scanning/juce_PluginListComponent.h

+ 14
- 2
modules/juce_audio_processors/scanning/juce_PluginListComponent.cpp View File

@@ -243,6 +243,18 @@ void PluginListComponent::filesDropped (const StringArray& files, int, int)
list.scanAndAddDragAndDroppedFiles (formatManager, files, typesFound); 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 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 (path.getNumPaths() > 0) // if the path is empty, then paths aren't used for this format.
{ {
if (propertiesToUse != nullptr) if (propertiesToUse != nullptr)
path = propertiesToUse->getValue ("lastPluginScanPath_" + formatToScan.getName(), path.toString());
path = getLastSearchPath (*propertiesToUse, formatToScan);
pathList.setSize (500, 300); pathList.setSize (500, 300);
pathList.setPath (path); pathList.setPath (path);
@@ -311,7 +323,7 @@ private:
if (propertiesToUse != nullptr) if (propertiesToUse != nullptr)
{ {
propertiesToUse->setValue ("lastPluginScanPath_" + formatToScan.getName(), pathList.getPath().toString());
setLastSearchPath (*propertiesToUse, formatToScan, pathList.getPath());
propertiesToUse->saveIfNeeded(); propertiesToUse->saveIfNeeded();
} }


+ 7
- 0
modules/juce_audio_processors/scanning/juce_PluginListComponent.h View File

@@ -66,6 +66,13 @@ public:
*/ */
void setNumberOfThreadsForScanning (int numThreads); 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 */ /** @internal */
void resized(); void resized();


Loading…
Cancel
Save