From fefbbc89b4c3816c5be1ead4c4e5a7c7a218335b Mon Sep 17 00:00:00 2001 From: hogliux Date: Tue, 26 Jun 2018 16:16:12 +0100 Subject: [PATCH] AU: Added an option to the Projucer to enable sandbox safe AUs (required for newer versions of GarageBand) --- extras/Projucer/Source/Project/jucer_Project.cpp | 10 ++++++++++ extras/Projucer/Source/Project/jucer_Project.h | 3 ++- .../Source/ProjectSaving/jucer_ProjectExport_Xcode.h | 3 +++ .../Projucer/Source/Utility/Helpers/jucer_PresetIDs.h | 1 + .../Source/Utility/PIPs/jucer_PIPGenerator.cpp | 1 + 5 files changed, 17 insertions(+), 1 deletion(-) diff --git a/extras/Projucer/Source/Project/jucer_Project.cpp b/extras/Projucer/Source/Project/jucer_Project.cpp index f1e44d72d7..fd49f0d814 100644 --- a/extras/Projucer/Source/Project/jucer_Project.cpp +++ b/extras/Projucer/Source/Project/jucer_Project.cpp @@ -249,6 +249,7 @@ void Project::initialiseAudioPluginValues() CodeHelpers::makeValidIdentifier (getProjectNameString(), false, true, false) + "AU"); pluginAUMainTypeValue.referTo (projectRoot, Ids::pluginAUMainType, getUndoManager(), getDefaultAUMainTypes(), ","); + pluginAUSandboxSafe.referTo (projectRoot, Ids::pluginAUIsSandboxSafe, getUndoManager(), false); pluginVSTCategoryValue.referTo (projectRoot, Ids::pluginVSTCategory, getUndoManager(), getDefaultVSTCategories(), ","); pluginVST3CategoryValue.referTo (projectRoot, Ids::pluginVST3Category, getUndoManager(), getDefaultVST3Categories(), ","); pluginRTASCategoryValue.referTo (projectRoot, Ids::pluginRTASCategory, getUndoManager(), getDefaultRTASCategories(), ","); @@ -1062,6 +1063,10 @@ void Project::createAudioPluginPropertyEditors (PropertyListBuilder& props) props.add (new MultiChoicePropertyComponent (pluginAUMainTypeValue, "Plugin AU Main Type", getAllAUMainTypeStrings(), getAllAUMainTypeVars(), 1), "AU main type."); + props.add (new ChoicePropertyComponent (pluginAUSandboxSafe, "Plugin AU is sandbox safe"), + "Check this box if your plug-in is sandbox safe. A sand-box safe plug-in is loaded in a restricted path and can only access it's own bundle resources and " + "the Music folder. Your plug-in must be able to deal with this. Newer versions of GarageBand require this to be enabled."); + { Array vst3CategoryVars; for (auto s : getAllVST3CategoryStrings()) @@ -1626,6 +1631,11 @@ String Project::getAUMainTypeString() const noexcept return {}; } +bool Project::isAUSandBoxSafe() const noexcept +{ + return pluginAUSandboxSafe.get(); +} + String Project::getVSTCategoryString() const noexcept { auto v = pluginVSTCategoryValue.get(); diff --git a/extras/Projucer/Source/Project/jucer_Project.h b/extras/Projucer/Source/Project/jucer_Project.h index ee91e08bca..be98912f56 100644 --- a/extras/Projucer/Source/Project/jucer_Project.h +++ b/extras/Projucer/Source/Project/jucer_Project.h @@ -192,6 +192,7 @@ public: Array getDefaultRTASCategories() const noexcept; String getAUMainTypeString() const noexcept; + bool isAUSandBoxSafe() const noexcept; String getVSTCategoryString() const noexcept; String getVST3CategoryString() const noexcept; int getAAXCategory() const noexcept; @@ -407,7 +408,7 @@ private: ValueWithDefault pluginFormatsValue, pluginNameValue, pluginDescriptionValue, pluginManufacturerValue, pluginManufacturerCodeValue, pluginCodeValue, pluginChannelConfigsValue, pluginCharacteristicsValue, pluginAUExportPrefixValue, pluginAAXIdentifierValue, - pluginAUMainTypeValue, pluginRTASCategoryValue, pluginVSTCategoryValue, pluginVST3CategoryValue, pluginAAXCategoryValue; + pluginAUMainTypeValue, pluginAUSandboxSafe, pluginRTASCategoryValue, pluginVSTCategoryValue, pluginVST3CategoryValue, pluginAAXCategoryValue; //============================================================================== std::unique_ptr compileEngineSettings; diff --git a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Xcode.h b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Xcode.h index b605f055fb..4d1976c84a 100644 --- a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Xcode.h +++ b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Xcode.h @@ -1565,6 +1565,9 @@ public: addPlistDictionaryKey (dict, "subtype", pluginSubType); addPlistDictionaryKeyInt (dict, "version", owner.project.getVersionAsHexInteger()); + if (owner.project.isAUSandBoxSafe()) + addPlistDictionaryKeyBool (dict, "sandboxSafe", true); + xcodeExtraPListEntries.add (plistKey); xcodeExtraPListEntries.add (plistEntry); } diff --git a/extras/Projucer/Source/Utility/Helpers/jucer_PresetIDs.h b/extras/Projucer/Source/Utility/Helpers/jucer_PresetIDs.h index 8a95c46079..78e396932b 100644 --- a/extras/Projucer/Source/Utility/Helpers/jucer_PresetIDs.h +++ b/extras/Projucer/Source/Utility/Helpers/jucer_PresetIDs.h @@ -320,6 +320,7 @@ namespace Ids DECLARE_ID (pluginVST3Category); DECLARE_ID (pluginAUExportPrefix); DECLARE_ID (pluginAUMainType); + DECLARE_ID (pluginAUIsSandboxSafe); DECLARE_ID (pluginRTASCategory); DECLARE_ID (pluginRTASDisableBypass); DECLARE_ID (pluginRTASDisableMultiMono); diff --git a/extras/Projucer/Source/Utility/PIPs/jucer_PIPGenerator.cpp b/extras/Projucer/Source/Utility/PIPs/jucer_PIPGenerator.cpp index 50e405d1aa..cf2dcb801c 100644 --- a/extras/Projucer/Source/Utility/PIPs/jucer_PIPGenerator.cpp +++ b/extras/Projucer/Source/Utility/PIPs/jucer_PIPGenerator.cpp @@ -460,6 +460,7 @@ Result PIPGenerator::setProjectSettings (ValueTree& jucerTree) { jucerTree.setProperty (Ids::projectType, "audioplug", nullptr); jucerTree.setProperty (Ids::pluginManufacturer, metadata[Ids::vendor], nullptr); + jucerTree.setProperty (Ids::pluginAUIsSandboxSafe, "1", nullptr); StringArray pluginFormatsToBuild (Ids::buildVST3.toString(), Ids::buildAU.toString(), Ids::buildStandalone.toString()); pluginFormatsToBuild.addArray (getExtraPluginFormatsToBuild());