Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for AudioUnit and LADSPA plugin formats #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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.

if (instance == nullptr) {
// 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants