- Notifications
You must be signed in to change notification settings - Fork 8
Add support for AudioUnit and LADSPA plugin formats #12
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| | @@ -100,13 +100,50 @@ class PluginHostApplication : public JUCEApplication { | |
| | ||
| deviceManager.initialise(256, 256, savedAudioState, true); | ||
| | ||
| AudioPluginInstance *instance; | ||
| OwnedArray<juce::PluginDescription> foundPlugins; | ||
| VST3PluginFormat format; | ||
| format.findAllTypesForFile(foundPlugins, pluginPath); | ||
| | ||
| description = foundPlugins[0]; | ||
| AudioPluginInstance *instance = format.createInstanceFromDescription( | ||
| #if (JUCE_PLUGINHOST_VST3 && (JUCE_MAC || JUCE_WINDOWS)) | ||
| if (pluginPath.endsWith(".vst3")) { | ||
| Contributor Author There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I found this method | ||
| | ||
| VST3PluginFormat formatVST; | ||
| | ||
| formatVST.findAllTypesForFile(foundPlugins, pluginPath); | ||
| description = foundPlugins[0]; | ||
| instance = formatVST.createInstanceFromDescription( | ||
| *description, setup.sampleRate, setup.bufferSize); | ||
| } | ||
| #endif | ||
| | ||
| #if (JUCE_PLUGINHOST_AU && (JUCE_MAC || JUCE_IOS)) | ||
| if (pluginPath.endsWith(".component")) { | ||
| | ||
| AudioUnitPluginFormat formatAU; | ||
| | ||
| formatAU.findAllTypesForFile(foundPlugins, pluginPath); | ||
| description = foundPlugins[0]; | ||
| instance = formatAU.createInstanceFromDescription( | ||
| *description, setup.sampleRate, setup.bufferSize); | ||
| } | ||
| #endif | ||
| | ||
| #if (JUCE_PLUGINHOST_LADSPA && JUCE_LINUX) | ||
| if (pluginPath.endsWith(".so")) { | ||
| | ||
| LADSPAPluginFormat formatLADSPA; | ||
| | ||
| formatLADSPA.findAllTypesForFile(foundPlugins, pluginPath); | ||
| description = foundPlugins[0]; | ||
| instance = formatLADSPA.createInstanceFromDescription( | ||
| *description, setup.sampleRate, setup.bufferSize); | ||
| } | ||
| #endif | ||
| | ||
| // Plugin not found | ||
| if (instance == nullptr) { | ||
| // TODO: this->shutdown(); | ||
| return; | ||
| } | ||
| | ||
| Owner There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 where getPluginFormat is something like: Would you mind giving that shot? Thanks again! | ||
| // i/o graph nodes | ||
| inputProcessor = new AudioProcessorGraph::AudioGraphIOProcessor( | ||
| | ||
There was a problem hiding this comment.
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.