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:
parent
4bfcb78809
commit
40d6a063af
1 changed files with 9 additions and 3 deletions
|
|
@ -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;
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue