1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

AudioPluginHost: Speed up out-of-process scanning

This commit is contained in:
reuk 2022-04-21 16:28:46 +01:00
parent 4bfcb78809
commit 40d6a063af
No known key found for this signature in database
GPG key ID: 9ADCD339CFC98A11

View file

@ -28,6 +28,11 @@ class PluginScannerSubprocess : private ChildProcessWorker,
private AsyncUpdater
{
public:
PluginScannerSubprocess()
{
formatManager.addDefaultFormats();
}
using ChildProcessWorker::initialiseFromCommandLine;
private:
@ -77,9 +82,6 @@ private:
bool doScan (const MemoryBlock& block)
{
AudioPluginFormatManager formatManager;
formatManager.addDefaultFormats();
MemoryInputStream stream { block, false };
const auto formatName = stream.readString();
const auto identifier = stream.readString();
@ -123,6 +125,10 @@ private:
std::mutex mutex;
std::queue<MemoryBlock> pendingBlocks;
// After construction, this will only be accessed by doScan so there's no need
// to worry about synchronisation.
AudioPluginFormatManager formatManager;
};
//==============================================================================