#ifndef PluginScannerSubprocess_hpp #define PluginScannerSubprocess_hpp #include class PluginScannerSubprocess final : public juce::ChildProcessWorker, private juce::AsyncUpdater { public: PluginScannerSubprocess(); bool initialiseFromCommandLine (const juce::String& commandLine, const juce::String& commandLineUniqueID, int timeoutMs = 0); void handleMessageFromCoordinator (const juce::MemoryBlock& mb) override; void handleConnectionLost() override; void handleAsyncUpdate() override; private: juce::OwnedArray doScan (const juce::MemoryBlock& block); void sendResults (const juce::OwnedArray& results); std::mutex mutex; std::queue pendingBlocks; // After construction, this will only be accessed by doScan so there's no need // to worry about synchronisation. juce::AudioPluginFormatManager formatManager; }; #endif /* PluginScannerSubprocess_hpp */