Hey,
I have an application consisting of a window with a button. This button opens up a filechooser window. When a file is chosen, it gets stored in a te::ExternalPlugin variable. This all works fine, however when i run getAudioPluginInstance(), nullptr is returned.
Why is this? Am i doing something wrong when setting up pluginDescription?
loadedPlugin->getName()
and
pluginDescription.pluginFormatName
both work correctly.
this is the relevant code:
juce::PluginDescription pluginDescription;
pluginDescription.fileOrIdentifier = selectedFile.getFullPathName();
pluginDescription.name = selectedFile.getFileNameWithoutExtension();
juce::String fileExtension = selectedFile.getFileExtension();
juce::String cleanedExtension = fileExtension.substring(1);
pluginDescription.pluginFormatName = cleanedExtension;
auto pluginTree = tracktion_engine::ExternalPlugin::create(engine, pluginDescription);
if(pluginTree.isValid())
{
tracktion_engine::PluginCreationInfo info{
*edit, pluginTree, true
};
loadedPlugin = std::make_unique<tracktion_engine::ExternalPlugin>(info);
}
if (loadedPlugin)
{
juce::Logger::writeToLog("Plugin loaded successfully: " + loadedPlugin->getName());
juce::Logger::writeToLog("Plugin Format: " + pluginDescription.pluginFormatName);
juce::AudioPluginInstance* audioProcessor = loadedPlugin->getAudioPluginInstance();
//this is where the problem is
if (audioProcessor != nullptr)
{
if (auto* editor = audioProcessor->createEditorIfNeeded())
{
pluginEditor.reset(editor);
addAndMakeVisible(pluginEditor.get());
resized();
}
else
{
juce::Logger::writeToLog("Failed to create plugin GUI.");
}
}
else
{
juce::Logger::writeToLog("Failed to get audioProcessor: ");
}
}
this is all of the source code
Main.cpp (2.3 KB)
MainComponent.cpp (6.1 KB)
MainComponent.h (1.1 KB)