Skip to content

Conversation

@eliot-akira
Copy link
Contributor

I confirmed that it works for AudioUnit effects. Haven't tested AudioUnit instruments, nor LADSPA plugins on Linux.

As mentioned in issue #9, I'm not so familiar with C++ so the code could probably be written more efficiently. Any advice would be appreciated. 😉


description = foundPlugins[0];
AudioPluginInstance *instance = format.createInstanceFromDescription(
#if (JUCE_PLUGINHOST_VST3 && (JUCE_MAC || JUCE_WINDOWS))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to use these constants to detect if each plugin format class is defined. I don't know if there's a cleaner way to do it.

description = foundPlugins[0];
AudioPluginInstance *instance = format.createInstanceFromDescription(
#if (JUCE_PLUGINHOST_VST3 && (JUCE_MAC || JUCE_WINDOWS))
if (pluginPath.endsWith(".vst3")) {
Copy link
Contributor Author

@eliot-akira eliot-akira Apr 1, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found this method .endsWith() in JUCE::String class.

// TODO: this->shutdown();
return;
}

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the right approach I think, thanks a lot.

We should be able to clean this up a bit by pulling all of the macros and path checking into a private function that just returns an AudioUnitPluginFormat instance (the base class of LADSPAPluginFormat, AudioUnitPluginFormat and VST3PluginFormat)

something like

AudioUnitPluginFormat format = getPluginFormat(pluginPath) formatAU.findAllTypesForFile(foundPlugins, pluginPath); description = foundPlugins[0]; instance = formatAU.createInstanceFromDescription(*description, setup.sampleRate, setup.bufferSize); 

where getPluginFormat is something like:

AudioPluginFormat getPluginFormat(const String &commandLine) { #if (JUCE_PLUGINHOST_LADSPA && JUCE_LINUX) if (pluginPath.endsWith(".so")) { return LADSPAPluginFormat();} #endif ... } 

Would you mind giving that shot?

Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants