Download Source/Helper/HelperPluginHost.h from RAM2118/pluginbridge: direct link, hf CLI and curl.
- Browser
- Download file 2.01 kB
-
https://huggingface.co/RAM2118/pluginbridge/resolve/ddb115bf829f00a019effbe2c307028edd9a0d27/Source/Helper/HelperPluginHost.h
- Command line
-
hf download hf://RAM2118/pluginbridge@ddb115bf829f00a019effbe2c307028edd9a0d27/Source/Helper/HelperPluginHost.h
-
curl -L -o HelperPluginHost.h https://huggingface.co/RAM2118/pluginbridge/resolve/ddb115bf829f00a019effbe2c307028edd9a0d27/Source/Helper/HelperPluginHost.h
2.01 kB
| // Simplified HelperPluginHost — ONLY tests if a plugin can load. | |
| // No audio processing, no GUI, no IPC. Just load and report. | |
| class HelperPluginHost | |
| { | |
| public: | |
| HelperPluginHost() | |
| { | |
| formatManager.addFormat(new juce::VST3PluginFormat()); | |
| formatManager.addFormat(new juce::AudioUnitPluginFormat()); | |
| } | |
| // Try to load a plugin. Returns true if successful. | |
| // If the plugin crashes (abort(), NSAlert, etc.), this process dies | |
| // and the parent sees exit code != 0. | |
| bool testLoad(const juce::String& path) | |
| { | |
| juce::File pluginFile(path); | |
| if (!pluginFile.exists()) | |
| return false; | |
| juce::OwnedArray<juce::PluginDescription> typesFound; | |
| for (int i = 0; i < formatManager.getNumFormats(); ++i) | |
| { | |
| auto* format = formatManager.getFormat(i); | |
| bool isVST3 = pluginFile.getFileExtension() == ".vst3"; | |
| bool isAU = pluginFile.getFileExtension() == ".component"; | |
| if (isVST3 && format->getName() != "VST3") continue; | |
| if (isAU && format->getName() != "AudioUnit") continue; | |
| format->findAllTypesForFile(typesFound, pluginFile.getFullPathName()); | |
| if (typesFound.size() > 0) | |
| break; | |
| } | |
| if (typesFound.isEmpty()) | |
| return false; | |
| juce::String errorMessage; | |
| auto instance = formatManager.createPluginInstance( | |
| *typesFound[0], 44100.0, 512, errorMessage); | |
| if (instance == nullptr) | |
| { | |
| DBG("HelperPluginHost: Load failed: " + errorMessage); | |
| return false; | |
| } | |
| // Successfully loaded — release and report safe | |
| instance->releaseResources(); | |
| instance.reset(); | |
| return true; | |
| } | |
| private: | |
| juce::AudioPluginFormatManager formatManager; | |
| }; | |