Skip to content

Commit

Permalink
AudioPluginHost: Remove magic number
Browse files Browse the repository at this point in the history
  • Loading branch information
reuk committed Feb 9, 2023
1 parent cb14aa9 commit d54f7ab
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions extras/AudioPluginHost/Source/UI/GraphEditorPanel.cpp
Expand Up @@ -33,8 +33,8 @@
class AUScanner
{
public:
AUScanner (KnownPluginList& list)
: knownPluginList (list), pool (5)
explicit AUScanner (KnownPluginList& list)
: knownPluginList (list)
{
knownPluginList.clearBlacklistedFiles();
paths = formatToScan.getDefaultLocationsToSearch();
Expand All @@ -49,7 +49,8 @@
std::unique_ptr<PluginDirectoryScanner> scanner;
FileSearchPath paths;

ThreadPool pool;
static constexpr auto numJobs = 5;
ThreadPool pool { numJobs };

void startScan()
{
Expand All @@ -59,17 +60,14 @@
scanner.reset (new PluginDirectoryScanner (knownPluginList, formatToScan, paths,
true, deadMansPedalFile, true));

for (int i = 5; --i >= 0;)
for (int i = numJobs; --i >= 0;)
pool.addJob (new ScanJob (*this), true);
}

bool doNextScan()
{
String pluginBeingScanned;
if (scanner->scanNextFile (true, pluginBeingScanned))
return true;

return false;
return scanner->scanNextFile (true, pluginBeingScanned);
}

struct ScanJob : public ThreadPoolJob
Expand Down

0 comments on commit d54f7ab

Please sign in to comment.