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

Projucer: Add ARA support

This commit is contained in:
attila 2022-03-01 17:51:05 +01:00
parent 6c2881ce30
commit 31b2a86559
31 changed files with 1021 additions and 68 deletions

View file

@ -46,7 +46,8 @@ namespace NewProjectTemplates
main,
header,
headerAndCpp,
processorAndEditor
processorAndEditor,
araPluginFiles
};
using FilenameAndContent = std::pair<String, String>;
@ -87,6 +88,7 @@ namespace NewProjectTemplates
if (opt == FileCreationOptions::header) return "header";
if (opt == FileCreationOptions::headerAndCpp) return "headercpp";
if (opt == FileCreationOptions::processorAndEditor) return "processoreditor";
if (opt == FileCreationOptions::araPluginFiles) return "arapluginfiles";
jassertfalse;
return {};
@ -99,6 +101,7 @@ namespace NewProjectTemplates
if (opt == "header") return FileCreationOptions::header;
if (opt == "headercpp") return FileCreationOptions::headerAndCpp;
if (opt == "processoreditor") return FileCreationOptions::processorAndEditor;
if (opt == "arapluginfiles") return FileCreationOptions::araPluginFiles;
jassertfalse;
return {};
@ -111,6 +114,7 @@ namespace NewProjectTemplates
if (opt == FileCreationOptions::header) return "Main.cpp + .h";
if (opt == FileCreationOptions::headerAndCpp) return "Main.cpp + .h/.cpp ";
if (opt == FileCreationOptions::processorAndEditor) return "Processor and Editor";
if (opt == FileCreationOptions::araPluginFiles) return "ARA Plugin Files";
jassertfalse;
return {};
@ -222,6 +226,24 @@ namespace NewProjectTemplates
FileCreationOptions::processorAndEditor
},
{ ProjectCategory::plugin,
"ARA", "Creates an ARA audio plug-in, augmenting the basic audio plug-in with ARA functionality.",
build_tools::ProjectType_ARAAudioPlugin::getTypeName(),
BinaryData::wizard_AudioPlugin_svg,
getModulesRequiredForAudioProcessor(),
{
{ FileCreationOptions::araPluginFiles, { { "PluginProcessor.cpp", "jucer_AudioPluginFilterTemplate_cpp" },
{ "PluginProcessor.h", "jucer_AudioPluginFilterTemplate_h" },
{ "PluginEditor.cpp", "jucer_AudioPluginEditorTemplate_cpp" },
{ "PluginEditor.h", "jucer_AudioPluginEditorTemplate_h" },
{ "PluginARADocumentController.cpp", "jucer_AudioPluginARADocumentControllerTemplate_cpp" },
{ "PluginARADocumentController.h", "jucer_AudioPluginARADocumentControllerTemplate_h" },
{ "PluginARAPlaybackRenderer.cpp", "jucer_AudioPluginARAPlaybackRendererTemplate_cpp" },
{ "PluginARAPlaybackRenderer.h", "jucer_AudioPluginARAPlaybackRendererTemplate_h" }} }
},
FileCreationOptions::araPluginFiles
},
{ ProjectCategory::library,
"Static Library", "Creates a static library.",
build_tools::ProjectType_StaticLibrary::getTypeName(),

View file

@ -114,11 +114,28 @@ static std::map<String, String> getPluginFileTokenReplacements (const String& na
processorClassName = processorClassName.substring (0, 1).toUpperCase() + processorClassName.substring (1);
auto editorClassName = processorClassName + "Editor";
const auto araDocumentControllerCppFile = sourceFolder.getChildFile ("PluginARADocumentController.cpp");
const auto araDocumentControllerHFile = araDocumentControllerCppFile.withFileExtension (".h");
const auto araPlaybackRendererCppFile = sourceFolder.getChildFile ("PluginARAPlaybackRenderer.cpp");
const auto araPlaybackRendererHFile = araPlaybackRendererCppFile.withFileExtension (".h");
const auto araDocumentControllerHInclude = CodeHelpers::createIncludeStatement (araDocumentControllerHFile, araDocumentControllerCppFile);
const auto araPlaybackRendererHInclude = CodeHelpers::createIncludeStatement (araPlaybackRendererHFile, araPlaybackRendererCppFile);
auto araDocumentControllerClassName = build_tools::makeValidIdentifier (name, true, true, false) + "DocumentController";
araDocumentControllerClassName = araDocumentControllerClassName.substring (0, 1).toUpperCase() + araDocumentControllerClassName.substring (1);
auto araPlaybackRendererClassName = build_tools::makeValidIdentifier (name, true, true, false) + "PlaybackRenderer";
araPlaybackRendererClassName = araPlaybackRendererClassName.substring (0, 1).toUpperCase() + araPlaybackRendererClassName.substring (1);
tokenReplacements.insert ({"%%filter_headers%%", processorHInclude + newLine + editorHInclude });
tokenReplacements.insert ({"%%filter_class_name%%", processorClassName });
tokenReplacements.insert ({"%%editor_class_name%%", editorClassName });
tokenReplacements.insert ({"%%editor_cpp_headers%%", processorHInclude + newLine + editorHInclude });
tokenReplacements.insert ({"%%editor_headers%%", getJuceHeaderInclude() + newLine + processorHInclude });
tokenReplacements.insert ({"%%aradocumentcontroller_headers%%", araDocumentControllerHInclude });
tokenReplacements.insert ({"%%aradocumentcontroller_class_name%%", araDocumentControllerClassName });
tokenReplacements.insert ({"%%araplaybackrenderer_headers%%", araPlaybackRendererHInclude });
tokenReplacements.insert ({"%%araplaybackrenderer_class_name%%", araPlaybackRendererClassName });
return tokenReplacements;
}

View file

@ -218,6 +218,8 @@ private:
"If you are building a legacy VST plug-in then this path should point to a VST2 SDK. "
"The VST2 SDK can be obtained from the vstsdk3610_11_06_2018_build_37 (or older) VST3 SDK or JUCE version 5.3.2. "
"You also need a VST2 license from Steinberg to distribute VST2 plug-ins.");
builder.add (new FilePathPropertyComponent (araPathValue, "ARA SDK", true, isThisOS),
"If you are building ARA enabled plug-ins, this should be the path to the ARA SDK folder.");
if (getSelectedOS() != TargetOS::linux)
{
@ -263,6 +265,7 @@ private:
userModulePathValue = settings.getStoredPath (Ids::defaultUserModulePath, os);
vstPathValue = settings.getStoredPath (Ids::vstLegacyPath, os);
aaxPathValue = settings.getStoredPath (Ids::aaxPath, os);
araPathValue = settings.getStoredPath (Ids::araPath, os);
androidSDKPathValue = settings.getStoredPath (Ids::androidSDKPath, os);
clionExePathValue = settings.getStoredPath (Ids::clionExePath, os);
androidStudioExePathValue = settings.getStoredPath (Ids::androidStudioExePath, os);
@ -275,6 +278,7 @@ private:
userModulePathValue .resetToDefault();
vstPathValue .resetToDefault();
aaxPathValue .resetToDefault();
araPathValue .resetToDefault();
androidSDKPathValue .resetToDefault();
clionExePathValue .resetToDefault();
androidStudioExePathValue.resetToDefault();
@ -286,7 +290,7 @@ private:
Value selectedOSValue;
ValueTreePropertyWithDefault jucePathValue, juceModulePathValue, userModulePathValue,
vstPathValue, aaxPathValue, androidSDKPathValue,
vstPathValue, aaxPathValue, araPathValue, androidSDKPathValue,
clionExePathValue, androidStudioExePathValue;
Viewport propertyViewport;

View file

@ -708,7 +708,7 @@ namespace
static bool isValidPathIdentifier (const String& id, const String& os)
{
return id == "vstLegacyPath" || (id == "aaxPath" && os != "linux")
return id == "vstLegacyPath" || (id == "aaxPath" && os != "linux") || id == "araPath"
|| id == "androidSDKPath" || id == "defaultJuceModulePath" || id == "defaultUserModulePath";
}

View file

@ -0,0 +1,42 @@
/*
==============================================================================
This file was auto-generated!
It contains the basic framework code for an ARA document controller implementation.
==============================================================================
*/
%%aradocumentcontroller_headers%%
%%araplaybackrenderer_headers%%
//==============================================================================
ARA::PlugIn::PlaybackRenderer* %%aradocumentcontroller_class_name%%::doCreatePlaybackRenderer() noexcept
{
return new %%araplaybackrenderer_class_name%% (getDocumentController());
}
//==============================================================================
bool %%aradocumentcontroller_class_name%%::doRestoreObjectsFromStream (juce::ARAInputStream& input, const juce::ARARestoreObjectsFilter* filter) noexcept
{
// You should use this method to read any persistent data associated with
// your ARA model graph stored in an archive using the supplied ARAInputStream.
// Be sure to check the ARARestoreObjectsFilter to determine which objects to restore.
return true;
}
bool %%aradocumentcontroller_class_name%%::doStoreObjectsToStream (juce::ARAOutputStream& output, const juce::ARAStoreObjectsFilter* filter) noexcept
{
// You should use this method to write any persistent data associated with
// your ARA model graph into the an archive using the supplied ARAOutputStream.
// Be sure to check the ARAStoreObjectsFilter to determine which objects to store.
return true;
}
//==============================================================================
// This creates the static ARAFactory instances for the plugin.
const ARA::ARAFactory* JUCE_CALLTYPE createARAFactory()
{
return juce::ARADocumentControllerSpecialisation::createARAFactory<%%aradocumentcontroller_class_name%%>();
}

View file

@ -0,0 +1,36 @@
/*
==============================================================================
This file was auto-generated!
It contains the basic framework code for an ARA document controller implementation.
==============================================================================
*/
#pragma once
#include <juce_audio_processors/juce_audio_processors.h>
//==============================================================================
/**
*/
class %%aradocumentcontroller_class_name%% : public juce::ARADocumentControllerSpecialisation
{
public:
//==============================================================================
using ARADocumentControllerSpecialisation::ARADocumentControllerSpecialisation;
protected:
//==============================================================================
// Override document controller customization methods here
ARAPlaybackRenderer* doCreatePlaybackRenderer() noexcept override;
bool doRestoreObjectsFromStream (juce::ARAInputStream& input, const juce::ARARestoreObjectsFilter* filter) noexcept override;
bool doStoreObjectsToStream (juce::ARAOutputStream& output, const juce::ARAStoreObjectsFilter* filter) noexcept override;
private:
//==============================================================================
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (%%aradocumentcontroller_class_name%%)
};

View file

@ -0,0 +1,112 @@
/*
==============================================================================
This file was auto-generated!
It contains the basic framework code for an ARA playback renderer implementation.
==============================================================================
*/
%%araplaybackrenderer_headers%%
//==============================================================================
void %%araplaybackrenderer_class_name%%::prepareToPlay (double sampleRateIn, int maximumSamplesPerBlockIn, int numChannelsIn, juce::AudioProcessor::ProcessingPrecision, AlwaysNonRealtime alwaysNonRealtime)
{
numChannels = numChannelsIn;
sampleRate = sampleRateIn;
maximumSamplesPerBlock = maximumSamplesPerBlockIn;
useBufferedAudioSourceReader = alwaysNonRealtime == AlwaysNonRealtime::no;
}
void %%araplaybackrenderer_class_name%%::releaseResources()
{
}
//==============================================================================
bool %%araplaybackrenderer_class_name%%::processBlock (juce::AudioBuffer<float>& buffer, juce::AudioProcessor::Realtime realtime, const juce::AudioPlayHead::CurrentPositionInfo& positionInfo) noexcept
{
const auto numSamples = buffer.getNumSamples();
jassert (numSamples <= maximumSamplesPerBlock);
jassert (numChannels == buffer.getNumChannels());
jassert (realtime == juce::AudioProcessor::Realtime::no || useBufferedAudioSourceReader);
const auto timeInSamples = positionInfo.timeInSamples;
const auto isPlaying = positionInfo.isPlaying;
bool success = true;
bool didRenderAnyRegion = false;
if (isPlaying)
{
const auto blockRange = juce::Range<juce::int64>::withStartAndLength (timeInSamples, numSamples);
for (const auto& playbackRegion : getPlaybackRegions())
{
// Evaluate region borders in song time, calculate sample range to render in song time.
// Note that this example does not use head- or tailtime, so the includeHeadAndTail
// parameter is set to false here - this might need to be adjusted in actual plug-ins.
const auto playbackSampleRange = playbackRegion->getSampleRange (sampleRate,
juce::ARAPlaybackRegion::IncludeHeadAndTail::no);
auto renderRange = blockRange.getIntersectionWith (playbackSampleRange);
if (renderRange.isEmpty())
continue;
// Evaluate region borders in modification/source time and calculate offset between
// song and source samples, then clip song samples accordingly
// (if an actual plug-in supports time stretching, this must be taken into account here).
juce::Range<juce::int64> modificationSampleRange { playbackRegion->getStartInAudioModificationSamples(),
playbackRegion->getEndInAudioModificationSamples() };
const auto modificationSampleOffset = modificationSampleRange.getStart() - playbackSampleRange.getStart();
renderRange = renderRange.getIntersectionWith (modificationSampleRange.movedToStartAt (playbackSampleRange.getStart()));
if (renderRange.isEmpty())
continue;
// Now calculate the samples in renderRange for this PlaybackRegion based on the ARA model
// graph. If didRenderAnyRegion is true, add the region's output samples in renderRange to
// the buffer. Otherwise the buffer needs to be initialised so the sample value must be
// overwritten.
const int numSamplesToRead = (int) renderRange.getLength();
const int startInBuffer = (int) (renderRange.getStart() - blockRange.getStart());
const auto startInSource = renderRange.getStart() + modificationSampleOffset;
for (int c = 0; c < numChannels; ++c)
{
auto* channelData = buffer.getWritePointer (c);
for (int i = 0; i < numSamplesToRead; ++i)
{
// Calculate region output sample at index startInSource + i ...
float sample = 0.0f;
if (didRenderAnyRegion)
channelData[startInBuffer + i] += sample;
else
channelData[startInBuffer + i] = sample;
}
}
// If rendering first region, clear any excess at start or end of the region.
if (! didRenderAnyRegion)
{
if (startInBuffer != 0)
buffer.clear (0, startInBuffer);
const int endInBuffer = startInBuffer + numSamples;
const int remainingSamples = numSamples - endInBuffer;
if (remainingSamples != 0)
buffer.clear (endInBuffer, remainingSamples);
didRenderAnyRegion = true;
}
}
}
if (! didRenderAnyRegion)
buffer.clear();
return success;
}

View file

@ -0,0 +1,45 @@
/*
==============================================================================
This file was auto-generated!
It contains the basic framework code for an ARA playback renderer implementation.
==============================================================================
*/
#pragma once
#include <juce_audio_processors/juce_audio_processors.h>
//==============================================================================
/**
*/
class %%araplaybackrenderer_class_name%% : public juce::ARAPlaybackRenderer
{
public:
//==============================================================================
using juce::ARAPlaybackRenderer::ARAPlaybackRenderer;
//==============================================================================
void prepareToPlay (double sampleRate,
int maximumSamplesPerBlock,
int numChannels,
juce::AudioProcessor::ProcessingPrecision,
AlwaysNonRealtime alwaysNonRealtime) override;
void releaseResources() override;
//==============================================================================
bool processBlock (juce::AudioBuffer<float> & buffer,
juce::AudioProcessor::Realtime realtime,
const juce::AudioPlayHead::CurrentPositionInfo& positionInfo) noexcept override;
private:
//==============================================================================
double sampleRate = 44100.0;
int maximumSamplesPerBlock = 4096;
int numChannels = 1;
bool useBufferedAudioSourceReader = true;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (%%araplaybackrenderer_class_name%%)
};

View file

@ -14,6 +14,9 @@
/**
*/
class %%filter_class_name%% : public juce::AudioProcessor
#if JucePlugin_Enable_ARA
, public juce::AudioProcessorARAExtension
#endif
{
public:
//==============================================================================

View file

@ -156,6 +156,9 @@ void Project::updateTitleDependencies()
pluginAUExportPrefixValue.setDefault (build_tools::makeValidIdentifier (projectName, false, true, false) + "AU");
pluginAAXIdentifierValue. setDefault (getDefaultAAXIdentifierString());
pluginLV2URIValue. setDefault (getDefaultLV2URI());
pluginARAFactoryIDValue. setDefault (getDefaultARAFactoryIDString());
pluginARAArchiveIDValue. setDefault (getDefaultARADocumentArchiveID());
pluginARACompatibleArchiveIDsValue.setDefault (getDefaultARACompatibleArchiveIDs());
}
String Project::getDocumentTitle()
@ -166,7 +169,10 @@ String Project::getDocumentTitle()
void Project::updateCompanyNameDependencies()
{
bundleIdentifierValue.setDefault (getDefaultBundleIdentifierString());
companyWebsiteValue.setDefault (getDefaultCompanyWebsiteString());
pluginAAXIdentifierValue.setDefault (getDefaultAAXIdentifierString());
pluginARAFactoryIDValue.setDefault (getDefaultARAFactoryIDString());
pluginARAArchiveIDValue.setDefault (getDefaultARADocumentArchiveID());
pluginManufacturerValue.setDefault (getDefaultPluginManufacturerString());
updateLicenseWarning();
@ -273,7 +279,7 @@ void Project::initialiseProjectValues()
companyNameValue.referTo (projectRoot, Ids::companyName, getUndoManager());
companyCopyrightValue.referTo (projectRoot, Ids::companyCopyright, getUndoManager());
companyWebsiteValue.referTo (projectRoot, Ids::companyWebsite, getUndoManager());
companyWebsiteValue.referTo (projectRoot, Ids::companyWebsite, getUndoManager(), getDefaultCompanyWebsiteString());
companyEmailValue.referTo (projectRoot, Ids::companyEmail, getUndoManager());
projectTypeValue.referTo (projectRoot, Ids::projectType, getUndoManager(), build_tools::ProjectType_GUIApp::getTypeName());
@ -329,6 +335,8 @@ void Project::initialiseAudioPluginValues()
pluginCodeValue.referTo (projectRoot, Ids::pluginCode, getUndoManager(), makeValid4CC (getProjectUIDString() + getProjectUIDString()));
pluginChannelConfigsValue.referTo (projectRoot, Ids::pluginChannelConfigs, getUndoManager());
pluginAAXIdentifierValue.referTo (projectRoot, Ids::aaxIdentifier, getUndoManager(), getDefaultAAXIdentifierString());
pluginARAFactoryIDValue.referTo (projectRoot, Ids::araFactoryID, getUndoManager(), getDefaultARAFactoryIDString());
pluginARAArchiveIDValue.referTo (projectRoot, Ids::araDocumentArchiveID, getUndoManager(), getDefaultARADocumentArchiveID());
pluginAUExportPrefixValue.referTo (projectRoot, Ids::pluginAUExportPrefix, getUndoManager(),
build_tools::makeValidIdentifier (getProjectNameString(), false, true, false) + "AU");
@ -338,6 +346,11 @@ void Project::initialiseAudioPluginValues()
pluginVST3CategoryValue.referTo (projectRoot, Ids::pluginVST3Category, getUndoManager(), getDefaultVST3Categories(), ",");
pluginAAXCategoryValue.referTo (projectRoot, Ids::pluginAAXCategory, getUndoManager(), getDefaultAAXCategories(), ",");
pluginEnableARA.referTo (projectRoot, Ids::enableARA, getUndoManager(), shouldEnableARA(), ",");
pluginARAAnalyzableContentValue.referTo (projectRoot, Ids::pluginARAAnalyzableContent, getUndoManager(), getDefaultARAContentTypes(), ",");
pluginARATransformFlagsValue.referTo (projectRoot, Ids::pluginARATransformFlags, getUndoManager(), getDefaultARATransformationFlags(), ",");
pluginARACompatibleArchiveIDsValue.referTo (projectRoot, Ids::araCompatibleArchiveIDs, getUndoManager(), getDefaultARACompatibleArchiveIDs());
pluginVSTNumMidiInputsValue.referTo (projectRoot, Ids::pluginVSTNumMidiInputs, getUndoManager(), 16);
pluginVSTNumMidiOutputsValue.referTo (projectRoot, Ids::pluginVSTNumMidiOutputs, getUndoManager(), 16);
@ -504,6 +517,24 @@ void Project::updatePluginCategories()
pluginVSTCategoryValue.resetToDefault();
}
{
const auto araAnalyzableContent = projectRoot.getProperty (Ids::pluginARAAnalyzableContent, {}).toString();
if (getAllARAContentTypeVars().contains (araAnalyzableContent))
pluginARAAnalyzableContentValue = araAnalyzableContent;
else if (getAllARAContentTypeStrings().contains (araAnalyzableContent))
pluginARAAnalyzableContentValue = Array<var> (getAllARAContentTypeVars()[getAllARAContentTypeStrings().indexOf (araAnalyzableContent)]);
}
{
const auto araTransformationFlags = projectRoot.getProperty (Ids::pluginARATransformFlags, {}).toString();
if (getAllARATransformationFlagVars().contains (araTransformationFlags))
pluginARATransformFlagsValue = araTransformationFlags;
else if (getAllARATransformationFlagStrings().contains (araTransformationFlags))
pluginARATransformFlagsValue = Array<var> (getAllARATransformationFlagVars()[getAllARATransformationFlagStrings().indexOf (araTransformationFlags)]);
}
{
auto auMainType = projectRoot.getProperty (Ids::pluginAUMainType, {}).toString();
@ -1081,6 +1112,9 @@ void Project::valueTreePropertyChanged (ValueTree& tree, const Identifier& prope
pluginVSTCategoryValue.setDefault (getDefaultVSTCategories());
pluginVST3CategoryValue.setDefault (getDefaultVST3Categories());
pluginAAXCategoryValue.setDefault (getDefaultAAXCategories());
pluginEnableARA.setDefault (getDefaultEnableARA());
pluginARAAnalyzableContentValue.setDefault (getDefaultARAContentTypes());
pluginARATransformFlagsValue.setDefault (getDefaultARATransformationFlags());
if (shouldWriteLegacyPluginCharacteristicsSettings)
writeLegacyPluginCharacteristicsSettings();
@ -1427,14 +1461,23 @@ void Project::createPropertyEditors (PropertyListBuilder& props)
void Project::createAudioPluginPropertyEditors (PropertyListBuilder& props)
{
props.add (new MultiChoicePropertyComponent (pluginFormatsValue, "Plugin Formats",
{ "VST3", "AU", "AUv3", "AAX", "Standalone", "LV2", "Unity", "Enable IAA", "VST (Legacy)" },
{ Ids::buildVST3.toString(), Ids::buildAU.toString(), Ids::buildAUv3.toString(),
Ids::buildAAX.toString(), Ids::buildStandalone.toString(),
Ids::buildLV2.toString(), Ids::buildUnity.toString(), Ids::enableIAA.toString(), Ids::buildVST.toString() }),
"Plugin formats to build. If you have selected \"VST (Legacy)\" then you will need to ensure that you have a VST2 SDK "
"in your header search paths. The VST2 SDK can be obtained from the vstsdk3610_11_06_2018_build_37 (or older) VST3 SDK "
"or JUCE version 5.3.2. You also need a VST2 license from Steinberg to distribute VST2 plug-ins.");
{
StringArray pluginFormatChoices { "VST3", "AU", "AUv3", "AAX", "Standalone", "LV2", "Unity", "Enable IAA", "VST (Legacy)" };
Array<var> pluginFormatChoiceValues { Ids::buildVST3.toString(), Ids::buildAU.toString(), Ids::buildAUv3.toString(),
Ids::buildAAX.toString(), Ids::buildStandalone.toString(),
Ids::buildLV2.toString(), Ids::buildUnity.toString(), Ids::enableIAA.toString(), Ids::buildVST.toString() };
if (! getProjectType().isARAAudioPlugin())
{
pluginFormatChoices.add ("Enable ARA");
pluginFormatChoiceValues.add (Ids::enableARA.toString());
}
props.add (new MultiChoicePropertyComponent (pluginFormatsValue, "Plugin Formats", pluginFormatChoices, pluginFormatChoiceValues),
"Plugin formats to build. If you have selected \"VST (Legacy)\" then you will need to ensure that you have a VST2 SDK "
"in your header search paths. The VST2 SDK can be obtained from the vstsdk3610_11_06_2018_build_37 (or older) VST3 SDK "
"or JUCE version 5.3.2. You also need a VST2 license from Steinberg to distribute VST2 plug-ins. If you enable ARA you "
"will have to obtain the ARA SDK by recursively cloning https://github.com/Celemony/ARA_SDK and checking out the tag "
"releases/2.1.0.");
}
props.add (new MultiChoicePropertyComponent (pluginCharacteristicsValue, "Plugin Characteristics",
{ "Plugin is a Synth", "Plugin MIDI Input", "Plugin MIDI Output", "MIDI Effect Plugin", "Plugin Editor Requires Keyboard Focus",
"Disable AAX Bypass", "Disable AAX Multi-Mono" },
@ -1515,6 +1558,25 @@ void Project::createAudioPluginPropertyEditors (PropertyListBuilder& props)
"This acts as a unique identifier for this plugin. "
"If you make any incompatible changes to your plugin (remove parameters, reorder parameters, change preset format etc.) "
"you MUST change this value. LV2 hosts will assume that any plugins with the same URI are interchangeable.");
if (shouldEnableARA())
{
props.add (new MultiChoicePropertyComponent (pluginARAAnalyzableContentValue, "Plugin ARA Analyzeable Content Types", getAllARAContentTypeStrings(), getAllARAContentTypeVars()),
"ARA Analyzeable Content Types.");
props.add (new MultiChoicePropertyComponent (pluginARATransformFlagsValue, "Plugin ARA Transformation Flags", getAllARATransformationFlagStrings(), getAllARATransformationFlagVars()),
"ARA Transformation Flags.");
props.add (new TextPropertyComponent (pluginARAFactoryIDValue, "Plugin ARA Factory ID", 256, false),
"ARA Factory ID.");
props.add (new TextPropertyComponent (pluginARAArchiveIDValue, "Plugin ARA Document Archive ID", 256, false),
"ARA Document Archive ID.");
props.add (new TextPropertyComponent (pluginARACompatibleArchiveIDsValue, "Plugin ARA Compatible Document Archive IDs", 1024, true),
"List of compatible ARA Document Archive IDs - one per line");
}
}
//==============================================================================
@ -2110,11 +2172,31 @@ String Project::getDefaultBundleIdentifierString() const
+ "." + build_tools::makeValidIdentifier (getProjectNameString(), false, true, false);
}
String Project::getDefaultCompanyWebsiteString() const
{
return "www." + build_tools::makeValidIdentifier (getCompanyNameOrDefault (getCompanyNameString()), false, true, false) + ".com";
}
String Project::getDefaultPluginManufacturerString() const
{
return getCompanyNameOrDefault (getCompanyNameString());
}
String Project::getDefaultARAFactoryIDString() const
{
return getDefaultBundleIdentifierString() + ".factory";
}
String Project::getDefaultARADocumentArchiveID() const
{
return getDefaultBundleIdentifierString() + ".aradocumentarchive." + getVersionString();
}
String Project::getDefaultARACompatibleArchiveIDs() const
{
return String();
}
String Project::getAUMainTypeString() const noexcept
{
auto v = pluginAUMainTypeValue.get();
@ -2222,6 +2304,32 @@ String Project::getIAAPluginName() const
return s;
}
int Project::getARAContentTypes() const noexcept
{
int res = 0;
if (auto* arr = pluginARAAnalyzableContentValue.get().getArray())
{
for (auto c : *arr)
res |= (int) c;
}
return res;
}
int Project::getARATransformationFlags() const noexcept
{
int res = 0;
if (auto* arr = pluginARATransformFlagsValue.get().getArray())
{
for (auto c : *arr)
res |= (int) c;
}
return res;
}
//==============================================================================
bool Project::isAUPluginHost()
{
@ -2243,6 +2351,16 @@ bool Project::isLV2PluginHost()
return getEnabledModules().isModuleEnabled ("juce_audio_processors") && isConfigFlagEnabled ("JUCE_PLUGINHOST_LV2", false);
}
bool Project::isARAPluginHost()
{
return (isVST3PluginHost() || isAUPluginHost()) && isConfigFlagEnabled ("JUCE_PLUGINHOST_ARA", false);
}
void Project::disableStandaloneForARAPlugIn()
{
pluginFormatsValue.referTo (projectRoot, Ids::pluginFormats, getUndoManager(), Array<var> (Ids::buildVST3.toString(), Ids::buildAU.toString()), ",");
}
//==============================================================================
StringArray Project::getAllAUMainTypeStrings() noexcept
{
@ -2332,6 +2450,67 @@ Array<var> Project::getDefaultAAXCategories() const noexcept
return getAllAAXCategoryVars()[getAllAAXCategoryStrings().indexOf ("AAX_ePlugInCategory_None")];
}
bool Project::getDefaultEnableARA() const noexcept
{
return false;
}
StringArray Project::getAllARAContentTypeStrings() noexcept
{
static StringArray araContentTypes { "Notes",
"Tempo Entries",
"Bar Signatures",
"Static Tuning",
"Dynamic Tuning Offsets",
"Key Signatures",
"Sheet Chords" };
return araContentTypes;
}
Array<var> Project::getAllARAContentTypeVars() noexcept
{
static Array<var> araContentVars {
/*kARAContentTypeNotes =*/ 1 << 0,
/*kARAContentTypeTempoEntries =*/ 1 << 1,
/*kARAContentTypeBarSignatures =*/ 1 << 2,
/*kARAContentTypeStaticTuning =*/ 1 << 3,
/*kARAContentTypeDynamicTuningOffsets =*/ 1 << 4,
/*kARAContentTypeKeySignatures =*/ 1 << 5,
/*kARAContentTypeSheetChords =*/ 1 << 6,
};
return araContentVars;
}
Array<var> Project::getDefaultARAContentTypes() const noexcept
{
return {};
}
StringArray Project::getAllARATransformationFlagStrings() noexcept
{
static StringArray araTransformationFlags { "Time Stretch",
"Time Stretch (reflecting tempo)",
"Content Based Fades At Tail",
"Content Based Fades At Head" };
return araTransformationFlags;
}
Array<var> Project::getAllARATransformationFlagVars() noexcept
{
static Array<var> araContentVars {
/*kARAPlaybackTransformationTimestretch =*/ 1 << 0,
/*kARAPlaybackTransformationTimestretchReflectingTempo =*/ 1 << 1,
/*kARAPlaybackTransformationContentBasedFadesAtTail =*/ 1 << 2,
/*kARAPlaybackTransformationContentBasedFadesAtHead =*/ 1 << 3
};
return araContentVars;
}
Array<var> Project::getDefaultARATransformationFlags() const noexcept
{
return {};
}
//==============================================================================
EnabledModulesList& Project::getEnabledModules()
{
@ -2587,6 +2766,7 @@ StringPairArray Project::getAudioPluginFlags() const
flags.set ("JucePlugin_Build_Unity", boolToString (shouldBuildUnityPlugin()));
flags.set ("JucePlugin_Build_LV2", boolToString (shouldBuildLV2()));
flags.set ("JucePlugin_Enable_IAA", boolToString (shouldEnableIAA()));
flags.set ("JucePlugin_Enable_ARA", boolToString (shouldEnableARA()));
flags.set ("JucePlugin_Name", toStringLiteral (getPluginNameString()));
flags.set ("JucePlugin_Desc", toStringLiteral (getPluginDescriptionString()));
flags.set ("JucePlugin_Manufacturer", toStringLiteral (getPluginManufacturerString()));
@ -2622,6 +2802,11 @@ StringPairArray Project::getAudioPluginFlags() const
flags.set ("JucePlugin_IAAName", toStringLiteral (getIAAPluginName()));
flags.set ("JucePlugin_VSTNumMidiInputs", getVSTNumMIDIInputsString());
flags.set ("JucePlugin_VSTNumMidiOutputs", getVSTNumMIDIOutputsString());
flags.set ("JucePlugin_ARAContentTypes", String (getARAContentTypes()));
flags.set ("JucePlugin_ARATransformationFlags", String (getARATransformationFlags()));
flags.set ("JucePlugin_ARAFactoryID", toStringLiteral(getARAFactoryIDString()));
flags.set ("JucePlugin_ARADocumentArchiveID", toStringLiteral(getARADocumentArchiveIDString()));
flags.set ("JucePlugin_ARACompatibleArchiveIDs", toStringLiteral(getARACompatibleArchiveIDStrings()));
{
String plugInChannelConfig = getPluginChannelConfigsString();

View file

@ -192,9 +192,13 @@ public:
String getBundleIdentifierString() const { return bundleIdentifierValue.get(); }
String getDefaultBundleIdentifierString() const;
String getDefaultCompanyWebsiteString() const;
String getDefaultAAXIdentifierString() const { return getDefaultBundleIdentifierString(); }
String getDefaultPluginManufacturerString() const;
String getDefaultLV2URI() const { return getCompanyWebsiteString() + "/plugins/" + build_tools::makeValidIdentifier (getProjectNameString(), false, true, false); }
String getDefaultARAFactoryIDString() const;
String getDefaultARADocumentArchiveID() const;
String getDefaultARACompatibleArchiveIDs() const;
String getCompanyNameString() const { return companyNameValue.get(); }
String getCompanyCopyrightString() const { return companyCopyrightValue.get(); }
@ -241,7 +245,11 @@ public:
String getPluginCodeString() const { return pluginCodeValue.get(); }
String getPluginChannelConfigsString() const { return pluginChannelConfigsValue.get(); }
String getAAXIdentifierString() const { return pluginAAXIdentifierValue.get(); }
String getARAFactoryIDString() const { return pluginARAFactoryIDValue.get(); }
String getARADocumentArchiveIDString() const { return pluginARAArchiveIDValue.get(); }
String getARACompatibleArchiveIDStrings() const { return pluginARACompatibleArchiveIDsValue.get(); }
String getPluginAUExportPrefixString() const { return pluginAUExportPrefixValue.get(); }
String getPluginAUMainTypeString() const { return pluginAUMainTypeValue.get(); }
String getVSTNumMIDIInputsString() const { return pluginVSTNumMidiInputsValue.get(); }
String getVSTNumMIDIOutputsString() const { return pluginVSTNumMidiOutputsValue.get(); }
@ -269,6 +277,7 @@ public:
bool shouldBuildUnityPlugin() const { return isAudioPluginProject() && checkMultiChoiceVar (pluginFormatsValue, Ids::buildUnity); }
bool shouldBuildLV2() const { return isAudioPluginProject() && checkMultiChoiceVar (pluginFormatsValue, Ids::buildLV2); }
bool shouldEnableIAA() const { return isAudioPluginProject() && checkMultiChoiceVar (pluginFormatsValue, Ids::enableIAA); }
bool shouldEnableARA() const { return (isAudioPluginProject() && checkMultiChoiceVar (pluginFormatsValue, Ids::enableARA)) || getProjectType().isARAAudioPlugin(); }
bool isPluginSynth() const { return checkMultiChoiceVar (pluginCharacteristicsValue, Ids::pluginIsSynth); }
bool pluginWantsMidiInput() const { return checkMultiChoiceVar (pluginCharacteristicsValue, Ids::pluginWantsMidiIn); }
@ -278,6 +287,8 @@ public:
bool isPluginAAXBypassDisabled() const { return checkMultiChoiceVar (pluginCharacteristicsValue, Ids::pluginAAXDisableBypass); }
bool isPluginAAXMultiMonoDisabled() const { return checkMultiChoiceVar (pluginCharacteristicsValue, Ids::pluginAAXDisableMultiMono); }
void disableStandaloneForARAPlugIn();
static StringArray getAllAUMainTypeStrings() noexcept;
static Array<var> getAllAUMainTypeVars() noexcept;
Array<var> getDefaultAUMainTypes() const noexcept;
@ -292,11 +303,22 @@ public:
static Array<var> getAllAAXCategoryVars() noexcept;
Array<var> getDefaultAAXCategories() const noexcept;
bool getDefaultEnableARA() const noexcept;
static StringArray getAllARAContentTypeStrings() noexcept;
static Array<var> getAllARAContentTypeVars() noexcept;
Array<var> getDefaultARAContentTypes() const noexcept;
static StringArray getAllARATransformationFlagStrings() noexcept;
static Array<var> getAllARATransformationFlagVars() noexcept;
Array<var> getDefaultARATransformationFlags() const noexcept;
String getAUMainTypeString() const noexcept;
bool isAUSandBoxSafe() const noexcept;
String getVSTCategoryString() const noexcept;
String getVST3CategoryString() const noexcept;
int getAAXCategory() const noexcept;
int getARAContentTypes() const noexcept;
int getARATransformationFlags() const noexcept;
String getIAATypeCode() const;
String getIAAPluginName() const;
@ -317,6 +339,7 @@ public:
bool isVSTPluginHost();
bool isVST3PluginHost();
bool isLV2PluginHost();
bool isARAPluginHost();
//==============================================================================
bool shouldBuildTargetType (build_tools::ProjectType::Target::Type targetType) const noexcept;
@ -548,6 +571,7 @@ private:
ValueTreePropertyWithDefault pluginFormatsValue, pluginNameValue, pluginDescriptionValue, pluginManufacturerValue, pluginManufacturerCodeValue,
pluginCodeValue, pluginChannelConfigsValue, pluginCharacteristicsValue, pluginAUExportPrefixValue, pluginAAXIdentifierValue,
pluginAUMainTypeValue, pluginAUSandboxSafeValue, pluginVSTCategoryValue, pluginVST3CategoryValue, pluginAAXCategoryValue,
pluginEnableARA, pluginARAAnalyzableContentValue, pluginARAFactoryIDValue, pluginARAArchiveIDValue, pluginARACompatibleArchiveIDsValue, pluginARATransformFlagsValue,
pluginVSTNumMidiInputsValue, pluginVSTNumMidiOutputsValue, pluginLV2URIValue;
//==============================================================================

View file

@ -131,6 +131,9 @@ public:
aaxPathValueWrapper.init ({ settings, Ids::aaxFolder, nullptr },
getAppSettings().getStoredPath (Ids::aaxPath, TargetOS::windows), TargetOS::windows);
araPathValueWrapper.init ({ settings, Ids::araFolder, nullptr },
getAppSettings().getStoredPath (Ids::araPath, TargetOS::windows), TargetOS::windows);
}
//==============================================================================

View file

@ -773,6 +773,9 @@ public:
aaxPathValueWrapper.init ({ settings, Ids::aaxFolder, nullptr },
getAppSettings().getStoredPath (Ids::aaxPath, TargetOS::osx), TargetOS::osx);
araPathValueWrapper.init ({ settings, Ids::araFolder, nullptr },
getAppSettings().getStoredPath (Ids::araPath, TargetOS::osx), TargetOS::osx);
}
protected:
@ -1897,6 +1900,7 @@ public:
options.isAuSandboxSafe = owner.project.isAUSandBoxSafe();
options.isPluginSynth = owner.project.isPluginSynth();
options.suppressResourceUsage = owner.getSuppressPlistResourceUsage();
options.isPluginARAEffect = owner.project.shouldEnableARA();
options.write (infoPlistFile);
}

View file

@ -273,6 +273,13 @@ void ProjectExporter::createPropertyEditors (PropertyListBuilder& props)
"If you're building an AAX plug-in, this must be the folder containing the AAX SDK. This can be an absolute path, or a path relative to the Projucer project file.");
}
if (project.shouldEnableARA() || project.isARAPluginHost())
{
props.add (new FilePathPropertyComponent (araPathValueWrapper.getWrappedValueTreePropertyWithDefault(), "ARA SDK Folder", true,
getTargetOSForExporter() == TargetOS::getThisOS(), "*", project.getProjectFolder()),
"If you're building an ARA enabled plug-in, this must be the folder containing the ARA SDK. This can be an absolute path, or a path relative to the Projucer project file.");
}
props.add (new TextPropertyComponent (extraPPDefsValue, "Extra Preprocessor Definitions", 32768, true),
"Extra preprocessor definitions. Use the form \"NAME1=value NAME2=value\", using whitespace, commas, "
"or new-lines to separate the items - to include a space or comma in a definition, precede it with a backslash.");
@ -335,6 +342,8 @@ void ProjectExporter::addSettingsForProjectType (const build_tools::ProjectType&
{
addExtraIncludePathsIfPluginOrHost();
addARAPathsIfPluginOrHost();
if (type.isAudioPlugin())
addCommonAudioPluginSettings();
@ -385,6 +394,12 @@ void ProjectExporter::addExtraIncludePathsIfPluginOrHost()
}
}
void ProjectExporter::addARAPathsIfPluginOrHost()
{
if (project.shouldEnableARA() || project.isARAPluginHost())
addARAFoldersToPath();
}
void ProjectExporter::addCommonAudioPluginSettings()
{
if (shouldBuildTargetType (build_tools::ProjectType::Target::AAXPlugIn))
@ -420,6 +435,14 @@ void ProjectExporter::addAAXFoldersToPath()
}
}
void ProjectExporter::addARAFoldersToPath()
{
const auto araFolder = getARAPathString();
if (araFolder.isNotEmpty())
addToExtraSearchPaths (build_tools::RelativePath (araFolder, build_tools::RelativePath::projectFolder));
}
//==============================================================================
StringPairArray ProjectExporter::getAllPreprocessorDefs (const BuildConfiguration& config, const build_tools::ProjectType::Target::Type targetType) const
{
@ -468,6 +491,10 @@ void ProjectExporter::addTargetSpecificPreprocessorDefs (StringPairArray& defs,
for (auto& flag : targetFlags)
defs.set (flag.first, (targetType == flag.second ? "1" : "0"));
}
if (project.shouldEnableARA())
{
defs.set ("JucePlugin_Enable_ARA", "1");
}
}
void ProjectExporter::addDefaultPreprocessorDefs (StringPairArray& defs) const

View file

@ -144,6 +144,7 @@ public:
String getVSTLegacyPathString() const { return vstLegacyPathValueWrapper.getCurrentValue(); }
String getAAXPathString() const { return aaxPathValueWrapper.getCurrentValue(); }
String getARAPathString() const { return araPathValueWrapper.getCurrentValue(); }
// NB: this is the path to the parent "modules" folder that contains the named module, not the
// module folder itself.
@ -405,7 +406,7 @@ protected:
const File projectFolder;
//==============================================================================
ValueTreePropertyWithDefaultWrapper vstLegacyPathValueWrapper, aaxPathValueWrapper;
ValueTreePropertyWithDefaultWrapper vstLegacyPathValueWrapper, aaxPathValueWrapper, araPathValueWrapper;
ValueTreePropertyWithDefault targetLocationValue, extraCompilerFlagsValue, extraLinkerFlagsValue, externalLibrariesValue,
userNotesValue, gnuExtensionsValue, bigIconValue, smallIconValue, extraPPDefsValue;
@ -467,10 +468,12 @@ private:
void createIconProperties (PropertyListBuilder&);
void addExtraIncludePathsIfPluginOrHost();
void addARAPathsIfPluginOrHost();
void addCommonAudioPluginSettings();
void addLegacyVSTFolderToPathIfSpecified();
build_tools::RelativePath getInternalVST3SDKPath();
void addAAXFoldersToPath();
void addARAFoldersToPath();
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ProjectExporter)
};

View file

@ -276,6 +276,10 @@ static bool isGlobalPathValid (const File& relativeTo, const Identifier& key, co
{
fileToCheckFor = "Interfaces/AAX_Exports.cpp";
}
else if (key == Ids::araPath)
{
fileToCheckFor = "ARA_API/ARAInterface.h";
}
else if (key == Ids::androidSDKPath)
{
#if JUCE_WINDOWS
@ -367,6 +371,12 @@ static String getFallbackPathForOS (const Identifier& key, DependencyPathOS os)
else if (os == TargetOS::osx) return "~/SDKs/AAX";
else return {}; // no AAX on this OS!
}
else if (key == Ids::araPath)
{
if (os == TargetOS::windows) return "C:\\SDKs\\ARA_SDK";
else if (os == TargetOS::osx) return "~/SDKs/ARA_SDK";
else return {};
}
else if (key == Ids::androidSDKPath)
{
if (os == TargetOS::windows) return "${user.home}\\AppData\\Local\\Android\\Sdk";

View file

@ -68,6 +68,7 @@ namespace Ids
DECLARE_ID (auFolder);
DECLARE_ID (vstLegacyPath);
DECLARE_ID (aaxPath);
DECLARE_ID (araPath);
DECLARE_ID (flags);
DECLARE_ID (line);
DECLARE_ID (index);
@ -154,7 +155,11 @@ namespace Ids
DECLARE_ID (enableIncrementalLinking);
DECLARE_ID (bundleIdentifier);
DECLARE_ID (aaxIdentifier);
DECLARE_ID (araFactoryID);
DECLARE_ID (araDocumentArchiveID);
DECLARE_ID (araCompatibleArchiveIDs);
DECLARE_ID (aaxFolder);
DECLARE_ID (araFolder);
DECLARE_ID (compile);
DECLARE_ID (noWarnings);
DECLARE_ID (skipPCH);
@ -330,6 +335,7 @@ namespace Ids
DECLARE_ID (buildUnity);
DECLARE_ID (buildLV2);
DECLARE_ID (enableIAA);
DECLARE_ID (enableARA);
DECLARE_ID (pluginName);
DECLARE_ID (pluginDesc);
DECLARE_ID (pluginManufacturer);
@ -352,6 +358,8 @@ namespace Ids
DECLARE_ID (pluginAAXCategory);
DECLARE_ID (pluginAAXDisableBypass);
DECLARE_ID (pluginAAXDisableMultiMono);
DECLARE_ID (pluginARAAnalyzableContent);
DECLARE_ID (pluginARATransformFlags);
DECLARE_ID (pluginVSTNumMidiInputs);
DECLARE_ID (pluginVSTNumMidiOutputs);
DECLARE_ID (suppressPlistResourceUsage);