MCPcopy Create free account
hub / github.com/apohl79/audiogridder / loadPlugin

Method loadPlugin

Server/Source/Processor.cpp:303–323  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

301}
302
303std::shared_ptr<AudioPluginInstance> Processor::loadPlugin(const PluginDescription& plugdesc, double sampleRate,
304 int blockSize, String& err) {
305 setLogTagStatic("processor");
306 traceScope();
307 String err2;
308 AudioPluginFormatManager plugmgr;
309 plugmgr.addDefaultFormats();
310 std::shared_ptr<AudioPluginInstance> inst;
311 runOnMsgThreadSync([&] {
312 traceScope();
313 inst = std::shared_ptr<AudioPluginInstance>(
314 plugmgr.createPluginInstance(plugdesc, sampleRate, blockSize, err2).release(),
315 [](AudioPluginInstance* p) { MessageManager::callAsync([p] { delete p; }); });
316 });
317 if (nullptr == inst) {
318 err = "failed loading plugin ";
319 err << plugdesc.fileOrIdentifier << ": " << err2;
320 logln(err);
321 }
322 return inst;
323}
324
325std::shared_ptr<AudioPluginInstance> Processor::loadPlugin(const String& id, double sampleRate, int blockSize,
326 String& err, String* idNormalized) {

Callers

nothing calls this directly

Calls 1

runOnMsgThreadSyncFunction · 0.85

Tested by

no test coverage detected