| @@ -117,8 +117,7 @@ protected: | |||
| if (getWarningLevel() == 0) | |||
| getWarningLevelValue() = 4; | |||
| if (shouldGenerateManifestValue().getValue().isVoid()) | |||
| shouldGenerateManifestValue() = var (true); | |||
| setValueIfVoid (shouldGenerateManifestValue(), true); | |||
| } | |||
| Value getWarningLevelValue() { return getValue (Ids::winWarningLevel); } | |||
| @@ -102,8 +102,7 @@ protected: | |||
| MakeBuildConfiguration (Project& project, const ValueTree& settings) | |||
| : BuildConfiguration (project, settings) | |||
| { | |||
| if (getLibrarySearchPathValue().getValue().isVoid()) | |||
| getLibrarySearchPathValue() = "/usr/X11R6/lib/"; | |||
| setValueIfVoid (getLibrarySearchPathValue(), "/usr/X11R6/lib/"); | |||
| } | |||
| void createPropertyEditors (PropertyListBuilder& props) | |||
| @@ -62,8 +62,7 @@ public: | |||
| if (getTargetLocationString().isEmpty()) | |||
| getTargetLocationValue() = getDefaultBuildsRootFolder() + (iOS ? "iOS" : "MacOSX"); | |||
| if (settings ["objCExtraSuffix"].isVoid()) | |||
| getObjCSuffixValue() = createAlphaNumericUID(); | |||
| setValueIfVoid (getObjCSuffixValue(), createAlphaNumericUID()); | |||
| } | |||
| static XCodeProjectExporter* createForSettings (Project& project, const ValueTree& settings) | |||
| @@ -665,6 +664,7 @@ private: | |||
| s.add ("GCC_VERSION = " + gccVersion); | |||
| s.add ("CLANG_CXX_LANGUAGE_STANDARD = \"c++0x\""); | |||
| //s.add ("CLANG_CXX_LIBRARY = \"libc++\""); | |||
| { | |||
| StringArray linkerFlags, librarySearchPaths; | |||
| @@ -31,8 +31,9 @@ | |||
| namespace | |||
| { | |||
| Value shouldBuildVST (Project& project) { return project.getProjectValue ("buildVST"); } | |||
| Value shouldBuildRTAS (Project& project) { return project.getProjectValue ("buildRTAS"); } | |||
| Value shouldBuildAU (Project& project) { return project.getProjectValue ("buildAU"); } | |||
| Value shouldBuildRTAS (Project& project) { return project.getProjectValue ("buildRTAS"); } | |||
| Value shouldBuildAAX (Project& project) { return project.getProjectValue ("buildAAX"); } | |||
| Value getPluginName (Project& project) { return project.getProjectValue ("pluginName"); } | |||
| Value getPluginDesc (Project& project) { return project.getProjectValue ("pluginDesc"); } | |||
| @@ -101,6 +102,7 @@ namespace | |||
| flags.set ("JucePlugin_Build_VST", valueToBool (shouldBuildVST (project))); | |||
| flags.set ("JucePlugin_Build_AU", valueToBool (shouldBuildAU (project))); | |||
| flags.set ("JucePlugin_Build_RTAS", valueToBool (shouldBuildRTAS (project))); | |||
| flags.set ("JucePlugin_Build_AAX", valueToBool (shouldBuildAAX (project))); | |||
| flags.set ("JucePlugin_Name", getPluginName (project).toString().quoted()); | |||
| flags.set ("JucePlugin_Desc", getPluginDesc (project).toString().quoted()); | |||
| flags.set ("JucePlugin_Manufacturer", getPluginManufacturer (project).toString().quoted()); | |||
| @@ -129,6 +131,7 @@ namespace | |||
| flags.set ("JucePlugin_RTASCategory", getPluginRTASCategoryCode (project)); | |||
| flags.set ("JucePlugin_RTASManufacturerCode", "JucePlugin_ManufacturerCode"); | |||
| flags.set ("JucePlugin_RTASProductId", "JucePlugin_PluginCode"); | |||
| flags.set ("JucePlugin_AAXIdentifier", project.getAAXIdentifier().toString()); | |||
| MemoryOutputStream mem; | |||
| @@ -452,4 +455,63 @@ namespace AUHelpers | |||
| } | |||
| } | |||
| //============================================================================== | |||
| namespace AAXHelpers | |||
| { | |||
| static Value getAAXFolder (ProjectExporter& exporter) { return exporter.getSetting (Ids::aaxFolder); } | |||
| static RelativePath getAAXFolderRelativePath (ProjectExporter& exporter) | |||
| { | |||
| return exporter.rebaseFromProjectFolderToBuildTarget (RelativePath (getAAXFolder (exporter).toString(), | |||
| RelativePath::projectFolder)); | |||
| } | |||
| static void fixMissingAAXValues (ProjectExporter& exporter) | |||
| { | |||
| if (getAAXFolder (exporter).toString().isEmpty()) | |||
| { | |||
| if (exporter.isVisualStudio()) | |||
| getAAXFolder (exporter) = "c:\\SDKs\\AAX"; | |||
| else | |||
| getAAXFolder (exporter) = "~/SDKs/AAX"; | |||
| } | |||
| } | |||
| static void addExtraSearchPaths (ProjectExporter& exporter) | |||
| { | |||
| RelativePath aaxFolder (getAAXFolder (exporter).toString(), RelativePath::projectFolder); | |||
| exporter.addToExtraSearchPaths (aaxFolder.getChildFile ("Interfaces")); | |||
| } | |||
| static inline void prepareExporter (ProjectExporter& exporter, ProjectSaver& projectSaver, const File& moduleFolder) | |||
| { | |||
| fixMissingAAXValues (exporter); | |||
| if (exporter.isVisualStudio()) | |||
| { | |||
| // XXX todo | |||
| } | |||
| else | |||
| { | |||
| // XXX todo | |||
| } | |||
| writePluginCharacteristicsFile (projectSaver); | |||
| addExtraSearchPaths (exporter); | |||
| } | |||
| static inline void createPropertyEditors (ProjectExporter& exporter, PropertyListBuilder& props) | |||
| { | |||
| if (exporter.isXcode() || exporter.isVisualStudio()) | |||
| { | |||
| fixMissingAAXValues (exporter); | |||
| props.add (new TextPropertyComponent (getAAXFolder (exporter), "AAX SDK Folder", 1024, false), | |||
| "If you're building an AAX, this must be the folder containing the AAX SDK. This should be an absolute path."); | |||
| } | |||
| } | |||
| } | |||
| #endif // __JUCER_AUDIOPLUGINMODULE_JUCEHEADER__ | |||
| @@ -526,8 +526,9 @@ void LibraryModule::prepareExporter (ProjectExporter& exporter, ProjectSaver& pr | |||
| if (isPluginClient()) | |||
| { | |||
| if (shouldBuildVST (project).getValue()) VSTHelpers::prepareExporter (exporter, projectSaver); | |||
| if (shouldBuildRTAS (project).getValue()) RTASHelpers::prepareExporter (exporter, projectSaver, localFolder); | |||
| if (shouldBuildAU (project).getValue()) AUHelpers::prepareExporter (exporter, projectSaver); | |||
| if (shouldBuildRTAS (project).getValue()) RTASHelpers::prepareExporter (exporter, projectSaver, localFolder); | |||
| if (shouldBuildAAX (project).getValue()) AAXHelpers::prepareExporter (exporter, projectSaver, localFolder); | |||
| } | |||
| } | |||
| @@ -540,6 +541,7 @@ void LibraryModule::createPropertyEditors (ProjectExporter& exporter, PropertyLi | |||
| { | |||
| if (shouldBuildVST (exporter.getProject()).getValue()) VSTHelpers::createPropertyEditors (exporter, props); | |||
| if (shouldBuildRTAS (exporter.getProject()).getValue()) RTASHelpers::createPropertyEditors (exporter, props); | |||
| if (shouldBuildAAX (exporter.getProject()).getValue()) AAXHelpers::createPropertyEditors (exporter, props); | |||
| } | |||
| } | |||
| @@ -399,7 +399,6 @@ Project* NewProjectWizard::runWizard (Component* ownerWindow_, | |||
| { | |||
| project->setFile (projectFile); | |||
| project->setTitle (appTitle); | |||
| project->setBundleIdentifierToDefault(); | |||
| if (! initialiseProject (*project)) | |||
| return nullptr; | |||
| @@ -103,7 +103,7 @@ void Project::setMissingDefaultValues() | |||
| getMainGroup().initialiseMissingProperties(); | |||
| if (getDocumentTitle().isEmpty()) | |||
| setTitle ("Juce Project"); | |||
| setTitle ("JUCE Project"); | |||
| if (! projectRoot.hasProperty (Ids::projectType)) | |||
| getProjectTypeValue() = ProjectType::getGUIAppTypeName(); | |||
| @@ -117,9 +117,6 @@ void Project::setMissingDefaultValues() | |||
| getProjectType().setMissingProjectProperties (*this); | |||
| if (! projectRoot.hasProperty (Ids::bundleIdentifier)) | |||
| setBundleIdentifierToDefault(); | |||
| if (! projectRoot.getChildWithName (Tags::modulesGroup).isValid()) | |||
| addDefaultModules (false); | |||
| } | |||
| @@ -84,7 +84,10 @@ public: | |||
| String getVersionAsHex() const; | |||
| Value getBundleIdentifier() { return getProjectValue (Ids::bundleIdentifier); } | |||
| void setBundleIdentifierToDefault() { getBundleIdentifier() = "com.yourcompany." + CodeHelpers::makeValidIdentifier (getProjectName().toString(), false, true, false); } | |||
| String getDefaultBundleIdentifier() { return "com.yourcompany." + CodeHelpers::makeValidIdentifier (getProjectName().toString(), false, true, false); } | |||
| Value getAAXIdentifier() { return getProjectValue (Ids::aaxIdentifier); } | |||
| String getDefaultAAXIdentifier() { return getDefaultBundleIdentifier(); } | |||
| Value getCompanyName() { return getProjectValue (Ids::companyName); } | |||
| @@ -156,11 +156,8 @@ public: | |||
| } | |||
| exporter.xcodeProductInstallPath = String::empty; | |||
| exporter.makefileTargetSuffix = ".so"; | |||
| exporter.msvcTargetSuffix = exporter.getSetting (Ids::libraryType) == 2 ? ".dll" : ".lib"; | |||
| exporter.msvcExtraPreprocessorDefs.set ("_LIB", ""); | |||
| } | |||
| }; | |||
| @@ -176,30 +173,28 @@ public: | |||
| void setMissingProjectProperties (Project& project) const | |||
| { | |||
| if (! project.getProjectRoot().hasProperty (Ids::buildVST)) | |||
| { | |||
| const String sanitisedProjectName (CodeHelpers::makeValidIdentifier (project.getProjectName().toString(), false, true, false)); | |||
| shouldBuildVST (project) = true; | |||
| shouldBuildRTAS (project) = false; | |||
| shouldBuildAU (project) = true; | |||
| getPluginName (project) = project.getProjectName().toString(); | |||
| getPluginDesc (project) = project.getProjectName().toString(); | |||
| getPluginManufacturer (project) = "yourcompany"; | |||
| getPluginManufacturerCode (project) = "Manu"; | |||
| getPluginCode (project) = "Plug"; | |||
| getPluginChannelConfigs (project) = "{1, 1}, {2, 2}"; | |||
| getPluginIsSynth (project) = false; | |||
| getPluginWantsMidiInput (project) = false; | |||
| getPluginProducesMidiOut (project) = false; | |||
| getPluginSilenceInProducesSilenceOut (project) = false; | |||
| getPluginTailLengthSeconds (project) = 0; | |||
| getPluginEditorNeedsKeyFocus (project) = false; | |||
| getPluginAUExportPrefix (project) = sanitisedProjectName + "AU"; | |||
| getPluginAUCocoaViewClassName (project) = sanitisedProjectName + "AU_V1"; | |||
| getPluginRTASCategory (project) = String::empty; | |||
| } | |||
| const String sanitisedProjectName (CodeHelpers::makeValidIdentifier (project.getProjectName().toString(), false, true, false)); | |||
| setValueIfVoid (shouldBuildVST (project), true); | |||
| setValueIfVoid (shouldBuildAU (project), true); | |||
| setValueIfVoid (getPluginName (project), project.getProjectName().toString()); | |||
| setValueIfVoid (getPluginDesc (project), project.getProjectName().toString()); | |||
| setValueIfVoid (getPluginManufacturer (project), "yourcompany"); | |||
| setValueIfVoid (getPluginManufacturerCode (project), "Manu"); | |||
| setValueIfVoid (getPluginCode (project), "Plug"); | |||
| setValueIfVoid (getPluginChannelConfigs (project), "{1, 1}, {2, 2}"); | |||
| setValueIfVoid (getPluginIsSynth (project), false); | |||
| setValueIfVoid (getPluginWantsMidiInput (project), false); | |||
| setValueIfVoid (getPluginProducesMidiOut (project), false); | |||
| setValueIfVoid (getPluginSilenceInProducesSilenceOut (project), false); | |||
| setValueIfVoid (getPluginTailLengthSeconds (project), 0); | |||
| setValueIfVoid (getPluginEditorNeedsKeyFocus (project), false); | |||
| setValueIfVoid (getPluginAUExportPrefix (project), sanitisedProjectName + "AU"); | |||
| setValueIfVoid (getPluginAUCocoaViewClassName (project), sanitisedProjectName + "AU_V1"); | |||
| setValueIfVoid (getPluginRTASCategory (project), String::empty); | |||
| setValueIfVoid (project.getBundleIdentifier(), project.getDefaultBundleIdentifier()); | |||
| setValueIfVoid (project.getAAXIdentifier(), project.getDefaultAAXIdentifier()); | |||
| } | |||
| void createPropertyEditors (Project& project, PropertyListBuilder& props) const | |||
| @@ -210,6 +205,8 @@ public: | |||
| "Whether the project should produce an AudioUnit plugin."); | |||
| props.add (new BooleanPropertyComponent (shouldBuildRTAS (project), "Build RTAS", "Enabled"), | |||
| "Whether the project should produce an RTAS plugin."); | |||
| // props.add (new BooleanPropertyComponent (shouldBuildAAX (project), "Build AAX", "Enabled"), | |||
| // "Whether the project should produce an AAX plugin."); | |||
| props.add (new TextPropertyComponent (getPluginName (project), "Plugin Name", 128, false), | |||
| "The name of your plugin (keep it short!)"); | |||
| @@ -71,6 +71,12 @@ String addQuotesIfContainsSpaces (const String& text) | |||
| return (text.containsChar (' ') && ! text.isQuotedString()) ? text.quoted() : text; | |||
| } | |||
| void setValueIfVoid (Value value, const var& defaultValue) | |||
| { | |||
| if (value.getValue().isVoid()) | |||
| value = defaultValue; | |||
| } | |||
| //============================================================================== | |||
| StringPairArray parsePreprocessorDefs (const String& text) | |||
| { | |||
| @@ -37,6 +37,8 @@ StringPairArray mergePreprocessorDefs (StringPairArray inheritedDefs, const Stri | |||
| String createGCCPreprocessorFlags (const StringPairArray& defs); | |||
| String replacePreprocessorDefs (const StringPairArray& definitions, String sourceString); | |||
| void setValueIfVoid (Value value, const var& defaultValue); | |||
| //============================================================================== | |||
| int indexOfLineStartingWith (const StringArray& lines, const String& text, int startIndex); | |||
| @@ -76,6 +76,8 @@ namespace Ids | |||
| DECLARE_ID (juceLinkage); | |||
| DECLARE_ID (buildVST); | |||
| DECLARE_ID (bundleIdentifier); | |||
| DECLARE_ID (aaxIdentifier); | |||
| DECLARE_ID (aaxFolder); | |||
| DECLARE_ID (compile); | |||
| DECLARE_ID (noWarnings); | |||
| DECLARE_ID (resource); | |||
| @@ -26,7 +26,8 @@ | |||
| // The following checks should cause a compile error if you've forgotten to | |||
| // define all your plugin settings properly.. | |||
| #if ! (JucePlugin_Build_VST || JucePlugin_Build_AU || JucePlugin_Build_RTAS || JucePlugin_Build_Standalone || JucePlugin_Build_LV2) | |||
| #if ! (JucePlugin_Build_VST || JucePlugin_Build_AU || JucePlugin_Build_RTAS || JucePlugin_Build_AAX \ | |||
| || JucePlugin_Build_Standalone || JucePlugin_Build_LV2) | |||
| #error "You need to enable at least one plugin format!" | |||
| #endif | |||
| @@ -103,3 +104,7 @@ | |||
| #if JucePlugin_Build_LV2 && ! defined (JucePlugin_LV2URI) | |||
| #error "You need to define the JucePlugin_LV2URI value!" | |||
| #endif | |||
| #if JucePlugin_Build_AAX && ! defined (JucePlugin_AAXIdentifier) | |||
| #error "You need to define the JucePlugin_AAXIdentifier value!" | |||
| #endif | |||