1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

LV2: Add initial hosting support

This commit is contained in:
reuk 2021-10-20 20:19:22 +01:00
parent 1d04669410
commit 1182024fc4
No known key found for this signature in database
GPG key ID: 9ADCD339CFC98A11
280 changed files with 18125 additions and 295 deletions

View file

@ -2233,6 +2233,11 @@ bool Project::isVST3PluginHost()
return getEnabledModules().isModuleEnabled ("juce_audio_processors") && isConfigFlagEnabled ("JUCE_PLUGINHOST_VST3", false);
}
bool Project::isLV2PluginHost()
{
return getEnabledModules().isModuleEnabled ("juce_audio_processors") && isConfigFlagEnabled ("JUCE_PLUGINHOST_LV2", false);
}
//==============================================================================
StringArray Project::getAllAUMainTypeStrings() noexcept
{

View file

@ -318,6 +318,7 @@ public:
bool isAUPluginHost();
bool isVSTPluginHost();
bool isVST3PluginHost();
bool isLV2PluginHost();
//==============================================================================
bool shouldBuildTargetType (build_tools::ProjectType::Target::Type targetType) const noexcept;

View file

@ -1788,7 +1788,10 @@ protected:
static bool shouldAddBigobjFlag (const build_tools::RelativePath& path)
{
return path.getFileNameWithoutExtension().equalsIgnoreCase ("include_juce_gui_basics");
const auto name = path.getFileNameWithoutExtension();
return name.equalsIgnoreCase ("include_juce_gui_basics")
|| name.equalsIgnoreCase ("include_juce_audio_processors");
}
StringArray getModuleLibs() const

View file

@ -340,7 +340,7 @@ void ProjectExporter::createIconProperties (PropertyListBuilder& props)
//==============================================================================
void ProjectExporter::addSettingsForProjectType (const build_tools::ProjectType& type)
{
addVSTPathsIfPluginOrHost();
addExtraIncludePathsIfPluginOrHost();
if (type.isAudioPlugin())
addCommonAudioPluginSettings();
@ -348,16 +348,48 @@ void ProjectExporter::addSettingsForProjectType (const build_tools::ProjectType&
addPlatformSpecificSettingsForProjectType (type);
}
void ProjectExporter::addVSTPathsIfPluginOrHost()
void ProjectExporter::addExtraIncludePathsIfPluginOrHost()
{
if (((shouldBuildTargetType (build_tools::ProjectType::Target::VSTPlugIn) && project.shouldBuildVST()) || project.isVSTPluginHost())
|| ((shouldBuildTargetType (build_tools::ProjectType::Target::VST3PlugIn) && project.shouldBuildVST3()) || project.isVST3PluginHost()))
using Target = build_tools::ProjectType::Target;
if (((shouldBuildTargetType (Target::VSTPlugIn) && project.shouldBuildVST()) || project.isVSTPluginHost())
|| ((shouldBuildTargetType (Target::VST3PlugIn) && project.shouldBuildVST3()) || project.isVST3PluginHost()))
{
addLegacyVSTFolderToPathIfSpecified();
if (! project.isConfigFlagEnabled ("JUCE_CUSTOM_VST3_SDK"))
addToExtraSearchPaths (getInternalVST3SDKPath(), 0);
}
const auto lv2BasePath = getModuleFolderRelativeToProject ("juce_audio_processors").getChildFile ("format_types")
.getChildFile ("LV2_SDK");
if (project.isLV2PluginHost())
{
const std::vector<const char*> paths[] { { "" },
{ "lv2" },
{ "serd" },
{ "sord" },
{ "sord", "src" },
{ "sratom" },
{ "lilv" },
{ "lilv", "src" } };
for (const auto& components : paths)
{
const auto appendComponent = [] (const build_tools::RelativePath& f, const char* component)
{
return f.getChildFile (component);
};
const auto includePath = std::accumulate (components.begin(),
components.end(),
lv2BasePath,
appendComponent);
addToExtraSearchPaths (includePath, 0);
}
}
}
void ProjectExporter::addCommonAudioPluginSettings()

View file

@ -462,7 +462,7 @@ private:
void createDependencyPathProperties (PropertyListBuilder&);
void createIconProperties (PropertyListBuilder&);
void addVSTPathsIfPluginOrHost();
void addExtraIncludePathsIfPluginOrHost();
void addCommonAudioPluginSettings();
void addLegacyVSTFolderToPathIfSpecified();
build_tools::RelativePath getInternalVST3SDKPath();