The JUCE cross-platform C++ framework, with DISTRHO/KXStudio specific changes
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

636 lines
31KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2020 - Raw Material Software Limited
  5. JUCE is an open source library subject to commercial or open-source
  6. licensing.
  7. By using JUCE, you agree to the terms of both the JUCE 6 End-User License
  8. Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020).
  9. End User License Agreement: www.juce.com/juce-6-licence
  10. Privacy Policy: www.juce.com/juce-privacy-policy
  11. Or: You may also use this code under the terms of the GPL v3 (see
  12. www.gnu.org/licenses).
  13. JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
  14. EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
  15. DISCLAIMED.
  16. ==============================================================================
  17. */
  18. #pragma once
  19. #include "../Application/UserAccount/jucer_LicenseController.h"
  20. #include "Modules/jucer_AvailableModulesList.h"
  21. class ProjectExporter;
  22. class LibraryModule;
  23. class EnabledModulesList;
  24. class ProjectSaver;
  25. namespace ProjectMessages
  26. {
  27. namespace Ids
  28. {
  29. #define DECLARE_ID(name) static const Identifier name (#name)
  30. DECLARE_ID (projectMessages);
  31. DECLARE_ID (incompatibleLicense);
  32. DECLARE_ID (cppStandard);
  33. DECLARE_ID (moduleNotFound);
  34. DECLARE_ID (jucePath);
  35. DECLARE_ID (jucerFileModified);
  36. DECLARE_ID (missingModuleDependencies);
  37. DECLARE_ID (oldProjucer);
  38. DECLARE_ID (cLion);
  39. DECLARE_ID (newVersionAvailable);
  40. DECLARE_ID (notification);
  41. DECLARE_ID (warning);
  42. DECLARE_ID (isVisible);
  43. #undef DECLARE_ID
  44. }
  45. inline Identifier getTypeForMessage (const Identifier& message)
  46. {
  47. static Identifier warnings[] = { Ids::incompatibleLicense, Ids::cppStandard, Ids::moduleNotFound,
  48. Ids::jucePath, Ids::jucerFileModified, Ids::missingModuleDependencies,
  49. Ids::oldProjucer, Ids::cLion };
  50. if (std::find (std::begin (warnings), std::end (warnings), message) != std::end (warnings))
  51. return Ids::warning;
  52. if (message == Ids::newVersionAvailable)
  53. return Ids::notification;
  54. jassertfalse;
  55. return {};
  56. }
  57. inline String getTitleForMessage (const Identifier& message)
  58. {
  59. if (message == Ids::incompatibleLicense) return "Incompatible License and Splash Screen Setting";
  60. if (message == Ids::cppStandard) return "C++ Standard";
  61. if (message == Ids::moduleNotFound) return "Module Not Found";
  62. if (message == Ids::jucePath) return "JUCE Path";
  63. if (message == Ids::jucerFileModified) return "Project File Modified";
  64. if (message == Ids::missingModuleDependencies) return "Missing Module Dependencies";
  65. if (message == Ids::oldProjucer) return "Projucer Out of Date";
  66. if (message == Ids::newVersionAvailable) return "New Version Available";
  67. if (message == Ids::cLion) return "Deprecated Exporter";
  68. jassertfalse;
  69. return {};
  70. }
  71. inline String getDescriptionForMessage (const Identifier& message)
  72. {
  73. if (message == Ids::incompatibleLicense) return "Save and export is disabled.";
  74. if (message == Ids::cppStandard) return "Module(s) have a higher C++ standard requirement than the project.";
  75. if (message == Ids::moduleNotFound) return "Module(s) could not be found at the specified paths.";
  76. if (message == Ids::jucePath) return "The path to your JUCE folder is incorrect.";
  77. if (message == Ids::jucerFileModified) return "The .jucer file has been modified since the last save.";
  78. if (message == Ids::missingModuleDependencies) return "Module(s) have missing dependencies.";
  79. if (message == Ids::oldProjucer) return "The version of the Projucer you are using is out of date.";
  80. if (message == Ids::newVersionAvailable) return "A new version of JUCE is available to download.";
  81. if (message == Ids::cLion) return "The CLion exporter is deprecated. Use JUCE's CMake support instead.";
  82. jassertfalse;
  83. return {};
  84. }
  85. using MessageAction = std::pair<String, std::function<void()>>;
  86. }
  87. enum class Async { no, yes };
  88. //==============================================================================
  89. class Project : public FileBasedDocument,
  90. private ValueTree::Listener,
  91. private LicenseController::LicenseStateListener,
  92. private ChangeListener,
  93. private AvailableModulesList::Listener
  94. {
  95. public:
  96. //==============================================================================
  97. Project (const File&);
  98. ~Project() override;
  99. //==============================================================================
  100. String getDocumentTitle() override;
  101. Result loadDocument (const File& file) override;
  102. Result saveDocument (const File& file) override;
  103. void saveDocumentAsync (const File& file, std::function<void (Result)> callback) override;
  104. void saveProject (Async, ProjectExporter* exporterToSave, std::function<void (Result)> onCompletion);
  105. Result saveResourcesOnly();
  106. void openProjectInIDE (ProjectExporter& exporterToOpen);
  107. File getLastDocumentOpened() override;
  108. void setLastDocumentOpened (const File& file) override;
  109. void setTitle (const String& newTitle);
  110. //==============================================================================
  111. File getProjectFolder() const { return getFile().getParentDirectory(); }
  112. File getGeneratedCodeFolder() const { return getFile().getSiblingFile ("JuceLibraryCode"); }
  113. File getSourceFilesFolder() const { return getProjectFolder().getChildFile ("Source"); }
  114. File getLocalModulesFolder() const { return getGeneratedCodeFolder().getChildFile ("modules"); }
  115. File getLocalModuleFolder (const String& moduleID) const { return getLocalModulesFolder().getChildFile (moduleID); }
  116. File getAppIncludeFile() const { return getGeneratedCodeFolder().getChildFile (getJuceSourceHFilename()); }
  117. File getBinaryDataCppFile (int index) const;
  118. File getBinaryDataHeaderFile() const { return getBinaryDataCppFile (0).withFileExtension (".h"); }
  119. static String getAppConfigFilename() { return "AppConfig.h"; }
  120. static String getPluginDefinesFilename() { return "JucePluginDefines.h"; }
  121. static String getJuceSourceHFilename() { return "JuceHeader.h"; }
  122. //==============================================================================
  123. template <class FileType>
  124. bool shouldBeAddedToBinaryResourcesByDefault (const FileType& file)
  125. {
  126. return ! file.hasFileExtension (sourceOrHeaderFileExtensions);
  127. }
  128. File resolveFilename (String filename) const;
  129. String getRelativePathForFile (const File& file) const;
  130. //==============================================================================
  131. // Creates editors for the project settings
  132. void createPropertyEditors (PropertyListBuilder&);
  133. //==============================================================================
  134. ValueTree getProjectRoot() const { return projectRoot; }
  135. Value getProjectValue (const Identifier& name) { return projectRoot.getPropertyAsValue (name, getUndoManagerFor (projectRoot)); }
  136. var getProjectVar (const Identifier& name) const { return projectRoot.getProperty (name); }
  137. const build_tools::ProjectType& getProjectType() const;
  138. String getProjectTypeString() const { return projectTypeValue.get(); }
  139. void setProjectType (const String& newProjectType) { projectTypeValue = newProjectType; }
  140. String getProjectNameString() const { return projectNameValue.get(); }
  141. String getProjectFilenameRootString() { return File::createLegalFileName (getDocumentTitle()); }
  142. String getProjectUIDString() const { return projectUIDValue.get(); }
  143. String getProjectLineFeed() const { return projectLineFeedValue.get(); }
  144. String getVersionString() const { return versionValue.get(); }
  145. String getVersionAsHex() const { return build_tools::getVersionAsHex (getVersionString()); }
  146. int getVersionAsHexInteger() const { return build_tools::getVersionAsHexInteger (getVersionString()); }
  147. void setProjectVersion (const String& newVersion) { versionValue = newVersion; }
  148. String getBundleIdentifierString() const { return bundleIdentifierValue.get(); }
  149. String getDefaultBundleIdentifierString() const;
  150. String getDefaultAAXIdentifierString() const { return getDefaultBundleIdentifierString(); }
  151. String getDefaultPluginManufacturerString() const;
  152. String getCompanyNameString() const { return companyNameValue.get(); }
  153. String getCompanyCopyrightString() const { return companyCopyrightValue.get(); }
  154. String getCompanyWebsiteString() const { return companyWebsiteValue.get(); }
  155. String getCompanyEmailString() const { return companyEmailValue.get(); }
  156. String getHeaderSearchPathsString() const { return headerSearchPathsValue.get(); }
  157. StringPairArray getPreprocessorDefs() const { return parsedPreprocessorDefs; }
  158. int getMaxBinaryFileSize() const { return maxBinaryFileSizeValue.get(); }
  159. bool shouldIncludeBinaryInJuceHeader() const { return includeBinaryDataInJuceHeaderValue.get(); }
  160. String getBinaryDataNamespaceString() const { return binaryDataNamespaceValue.get(); }
  161. bool shouldDisplaySplashScreen() const { return displaySplashScreenValue.get(); }
  162. String getSplashScreenColourString() const { return splashScreenColourValue.get(); }
  163. static StringArray getCppStandardStrings() { return { "C++14", "C++17", "C++20", "Use Latest" }; }
  164. static Array<var> getCppStandardVars() { return { "14", "17", "20", "latest" }; }
  165. static String getLatestNumberedCppStandardString()
  166. {
  167. auto cppStandardVars = getCppStandardVars();
  168. return cppStandardVars[cppStandardVars.size() - 2];
  169. }
  170. String getCppStandardString() const { return cppStandardValue.get(); }
  171. StringArray getCompilerFlagSchemes() const;
  172. void addCompilerFlagScheme (const String&);
  173. void removeCompilerFlagScheme (const String&);
  174. String getPostExportShellCommandPosixString() const { return postExportShellCommandPosixValue.get(); }
  175. String getPostExportShellCommandWinString() const { return postExportShellCommandWinValue.get(); }
  176. bool shouldUseAppConfig() const { return useAppConfigValue.get(); }
  177. bool shouldAddUsingNamespaceToJuceHeader() const { return addUsingNamespaceToJuceHeader.get(); }
  178. //==============================================================================
  179. String getPluginNameString() const { return pluginNameValue.get(); }
  180. String getPluginDescriptionString() const { return pluginDescriptionValue.get();}
  181. String getPluginManufacturerString() const { return pluginManufacturerValue.get(); }
  182. String getPluginManufacturerCodeString() const { return pluginManufacturerCodeValue.get(); }
  183. String getPluginCodeString() const { return pluginCodeValue.get(); }
  184. String getPluginChannelConfigsString() const { return pluginChannelConfigsValue.get(); }
  185. String getAAXIdentifierString() const { return pluginAAXIdentifierValue.get(); }
  186. String getPluginAUExportPrefixString() const { return pluginAUExportPrefixValue.get(); }
  187. String getVSTNumMIDIInputsString() const { return pluginVSTNumMidiInputsValue.get(); }
  188. String getVSTNumMIDIOutputsString() const { return pluginVSTNumMidiOutputsValue.get(); }
  189. static bool checkMultiChoiceVar (const ValueWithDefault& valueToCheck, Identifier idToCheck) noexcept
  190. {
  191. if (! valueToCheck.get().isArray())
  192. return false;
  193. auto v = valueToCheck.get();
  194. if (auto* varArray = v.getArray())
  195. return varArray->contains (idToCheck.toString());
  196. return false;
  197. }
  198. bool isAudioPluginProject() const { return getProjectType().isAudioPlugin(); }
  199. bool shouldBuildVST() const { return isAudioPluginProject() && checkMultiChoiceVar (pluginFormatsValue, Ids::buildVST); }
  200. bool shouldBuildVST3() const { return isAudioPluginProject() && checkMultiChoiceVar (pluginFormatsValue, Ids::buildVST3); }
  201. bool shouldBuildAU() const { return isAudioPluginProject() && checkMultiChoiceVar (pluginFormatsValue, Ids::buildAU); }
  202. bool shouldBuildAUv3() const { return isAudioPluginProject() && checkMultiChoiceVar (pluginFormatsValue, Ids::buildAUv3); }
  203. bool shouldBuildRTAS() const { return isAudioPluginProject() && checkMultiChoiceVar (pluginFormatsValue, Ids::buildRTAS); }
  204. bool shouldBuildAAX() const { return isAudioPluginProject() && checkMultiChoiceVar (pluginFormatsValue, Ids::buildAAX); }
  205. bool shouldBuildStandalonePlugin() const { return isAudioPluginProject() && checkMultiChoiceVar (pluginFormatsValue, Ids::buildStandalone); }
  206. bool shouldBuildUnityPlugin() const { return isAudioPluginProject() && checkMultiChoiceVar (pluginFormatsValue, Ids::buildUnity); }
  207. bool shouldEnableIAA() const { return isAudioPluginProject() && checkMultiChoiceVar (pluginFormatsValue, Ids::enableIAA); }
  208. bool isPluginSynth() const { return checkMultiChoiceVar (pluginCharacteristicsValue, Ids::pluginIsSynth); }
  209. bool pluginWantsMidiInput() const { return checkMultiChoiceVar (pluginCharacteristicsValue, Ids::pluginWantsMidiIn); }
  210. bool pluginProducesMidiOutput() const { return checkMultiChoiceVar (pluginCharacteristicsValue, Ids::pluginProducesMidiOut); }
  211. bool isPluginMidiEffect() const { return checkMultiChoiceVar (pluginCharacteristicsValue, Ids::pluginIsMidiEffectPlugin); }
  212. bool pluginEditorNeedsKeyFocus() const { return checkMultiChoiceVar (pluginCharacteristicsValue, Ids::pluginEditorRequiresKeys); }
  213. bool isPluginRTASBypassDisabled() const { return checkMultiChoiceVar (pluginCharacteristicsValue, Ids::pluginRTASDisableBypass); }
  214. bool isPluginRTASMultiMonoDisabled() const { return checkMultiChoiceVar (pluginCharacteristicsValue, Ids::pluginRTASDisableMultiMono); }
  215. bool isPluginAAXBypassDisabled() const { return checkMultiChoiceVar (pluginCharacteristicsValue, Ids::pluginAAXDisableBypass); }
  216. bool isPluginAAXMultiMonoDisabled() const { return checkMultiChoiceVar (pluginCharacteristicsValue, Ids::pluginAAXDisableMultiMono); }
  217. static StringArray getAllAUMainTypeStrings() noexcept;
  218. static Array<var> getAllAUMainTypeVars() noexcept;
  219. Array<var> getDefaultAUMainTypes() const noexcept;
  220. static StringArray getAllVSTCategoryStrings() noexcept;
  221. Array<var> getDefaultVSTCategories() const noexcept;
  222. static StringArray getAllVST3CategoryStrings() noexcept;
  223. Array<var> getDefaultVST3Categories() const noexcept;
  224. static StringArray getAllAAXCategoryStrings() noexcept;
  225. static Array<var> getAllAAXCategoryVars() noexcept;
  226. Array<var> getDefaultAAXCategories() const noexcept;
  227. static StringArray getAllRTASCategoryStrings() noexcept;
  228. static Array<var> getAllRTASCategoryVars() noexcept;
  229. Array<var> getDefaultRTASCategories() const noexcept;
  230. String getAUMainTypeString() const noexcept;
  231. bool isAUSandBoxSafe() const noexcept;
  232. String getVSTCategoryString() const noexcept;
  233. String getVST3CategoryString() const noexcept;
  234. int getAAXCategory() const noexcept;
  235. int getRTASCategory() const noexcept;
  236. String getIAATypeCode() const;
  237. String getIAAPluginName() const;
  238. String getUnityScriptName() const { return addUnityPluginPrefixIfNecessary (getProjectNameString()) + "_UnityScript.cs"; }
  239. static String addUnityPluginPrefixIfNecessary (const String& name)
  240. {
  241. if (! name.startsWithIgnoreCase ("audioplugin"))
  242. return "audioplugin_" + name;
  243. return name;
  244. }
  245. //==============================================================================
  246. bool isAUPluginHost();
  247. bool isVSTPluginHost();
  248. bool isVST3PluginHost();
  249. //==============================================================================
  250. bool shouldBuildTargetType (build_tools::ProjectType::Target::Type targetType) const noexcept;
  251. static build_tools::ProjectType::Target::Type getTargetTypeFromFilePath (const File& file, bool returnSharedTargetIfNoValidSuffix);
  252. //==============================================================================
  253. void updateDeprecatedProjectSettingsInteractively();
  254. StringPairArray getAppConfigDefs();
  255. StringPairArray getAudioPluginFlags() const;
  256. //==============================================================================
  257. class Item
  258. {
  259. public:
  260. //==============================================================================
  261. Item (Project& project, const ValueTree& itemNode, bool isModuleCode);
  262. Item (const Item& other);
  263. static Item createGroup (Project& project, const String& name, const String& uid, bool isModuleCode);
  264. void initialiseMissingProperties();
  265. //==============================================================================
  266. bool isValid() const { return state.isValid(); }
  267. bool operator== (const Item& other) const { return state == other.state && &project == &other.project; }
  268. bool operator!= (const Item& other) const { return ! operator== (other); }
  269. //==============================================================================
  270. bool isFile() const;
  271. bool isGroup() const;
  272. bool isMainGroup() const;
  273. bool isImageFile() const;
  274. bool isSourceFile() const;
  275. String getID() const;
  276. void setID (const String& newID);
  277. Item findItemWithID (const String& targetId) const; // (recursive search)
  278. String getImageFileID() const;
  279. std::unique_ptr<Drawable> loadAsImageFile() const;
  280. //==============================================================================
  281. Value getNameValue();
  282. String getName() const;
  283. File getFile() const;
  284. String getFilePath() const;
  285. void setFile (const File& file);
  286. void setFile (const build_tools::RelativePath& file);
  287. File determineGroupFolder() const;
  288. bool renameFile (const File& newFile);
  289. bool shouldBeAddedToTargetProject() const;
  290. bool shouldBeAddedToTargetExporter (const ProjectExporter&) const;
  291. bool shouldBeCompiled() const;
  292. Value getShouldCompileValue();
  293. bool shouldBeAddedToBinaryResources() const;
  294. Value getShouldAddToBinaryResourcesValue();
  295. bool shouldBeAddedToXcodeResources() const;
  296. Value getShouldAddToXcodeResourcesValue();
  297. Value getShouldInhibitWarningsValue();
  298. bool shouldInhibitWarnings() const;
  299. bool isModuleCode() const;
  300. Value getShouldSkipPCHValue();
  301. bool shouldSkipPCH() const;
  302. Value getCompilerFlagSchemeValue();
  303. String getCompilerFlagSchemeString() const;
  304. void setCompilerFlagScheme (const String&);
  305. void clearCurrentCompilerFlagScheme();
  306. //==============================================================================
  307. bool canContain (const Item& child) const;
  308. int getNumChildren() const { return state.getNumChildren(); }
  309. Item getChild (int index) const { return Item (project, state.getChild (index), belongsToModule); }
  310. Item addNewSubGroup (const String& name, int insertIndex);
  311. Item getOrCreateSubGroup (const String& name);
  312. void addChild (const Item& newChild, int insertIndex);
  313. bool addFileAtIndex (const File& file, int insertIndex, bool shouldCompile);
  314. bool addFileRetainingSortOrder (const File& file, bool shouldCompile);
  315. void addFileUnchecked (const File& file, int insertIndex, bool shouldCompile);
  316. bool addRelativeFile (const build_tools::RelativePath& file, int insertIndex, bool shouldCompile);
  317. void removeItemFromProject();
  318. void sortAlphabetically (bool keepGroupsAtStart, bool recursive);
  319. Item findItemForFile (const File& file) const;
  320. bool containsChildForFile (const build_tools::RelativePath& file) const;
  321. Item getParent() const;
  322. Item createCopy();
  323. UndoManager* getUndoManager() const { return project.getUndoManagerFor (state); }
  324. Icon getIcon (bool isOpen = false) const;
  325. bool isIconCrossedOut() const;
  326. bool needsSaving() const noexcept;
  327. Project& project;
  328. ValueTree state;
  329. private:
  330. Item& operator= (const Item&);
  331. bool belongsToModule;
  332. };
  333. Item getMainGroup();
  334. void findAllImageItems (OwnedArray<Item>& items);
  335. //==============================================================================
  336. ValueTree getExporters();
  337. int getNumExporters();
  338. std::unique_ptr<ProjectExporter> createExporter (int index);
  339. void addNewExporter (const Identifier& exporterIdentifier);
  340. void createExporterForCurrentPlatform();
  341. struct ExporterIterator
  342. {
  343. ExporterIterator (Project& project);
  344. bool next();
  345. ProjectExporter& operator*() const { return *exporter; }
  346. ProjectExporter* operator->() const { return exporter.get(); }
  347. std::unique_ptr<ProjectExporter> exporter;
  348. int index;
  349. private:
  350. Project& project;
  351. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ExporterIterator)
  352. };
  353. //==============================================================================
  354. struct ConfigFlag
  355. {
  356. String symbol, description, sourceModuleID;
  357. ValueWithDefault value;
  358. };
  359. ValueWithDefault getConfigFlag (const String& name);
  360. bool isConfigFlagEnabled (const String& name, bool defaultIsEnabled = false) const;
  361. //==============================================================================
  362. EnabledModulesList& getEnabledModules();
  363. AvailableModulesList& getExporterPathsModulesList() { return exporterPathsModulesList; }
  364. void rescanExporterPathModules (bool async = false);
  365. std::pair<String, File> getModuleWithID (const String&);
  366. //==============================================================================
  367. PropertiesFile& getStoredProperties() const;
  368. //==============================================================================
  369. UndoManager* getUndoManagerFor (const ValueTree&) const { return nullptr; }
  370. UndoManager* getUndoManager() const { return nullptr; }
  371. //==============================================================================
  372. static const char* projectFileExtension;
  373. //==============================================================================
  374. bool updateCachedFileState();
  375. String getCachedFileStateContent() const noexcept { return cachedFileState.second; }
  376. String serialiseProjectXml (std::unique_ptr<XmlElement>) const;
  377. //==============================================================================
  378. String getUniqueTargetFolderSuffixForExporter (const Identifier& exporterIdentifier, const String& baseTargetFolder);
  379. //==============================================================================
  380. bool isCurrentlySaving() const noexcept { return saver != nullptr; }
  381. bool isTemporaryProject() const noexcept { return tempDirectory != File(); }
  382. File getTemporaryDirectory() const noexcept { return tempDirectory; }
  383. void setTemporaryDirectory (const File&) noexcept;
  384. //==============================================================================
  385. ValueTree getProjectMessages() const { return projectMessages; }
  386. void addProjectMessage (const Identifier& messageToAdd, std::vector<ProjectMessages::MessageAction>&& messageActions);
  387. void removeProjectMessage (const Identifier& messageToRemove);
  388. std::vector<ProjectMessages::MessageAction> getMessageActions (const Identifier& message);
  389. //==============================================================================
  390. bool hasIncompatibleLicenseTypeAndSplashScreenSetting() const;
  391. bool isFileModificationCheckPending() const;
  392. bool isSaveAndExportDisabled() const;
  393. private:
  394. //==============================================================================
  395. void valueTreePropertyChanged (ValueTree&, const Identifier&) override;
  396. void valueTreeChildAdded (ValueTree&, ValueTree&) override;
  397. void valueTreeChildRemoved (ValueTree&, ValueTree&, int) override;
  398. void valueTreeChildOrderChanged (ValueTree&, int, int) override;
  399. //==============================================================================
  400. struct ProjectFileModificationPoller : private Timer
  401. {
  402. ProjectFileModificationPoller (Project& p);
  403. bool isCheckPending() const noexcept { return pending; }
  404. private:
  405. void timerCallback() override;
  406. void reset();
  407. void resaveProject();
  408. void reloadProjectFromDisk();
  409. Project& project;
  410. bool pending = false;
  411. };
  412. //==============================================================================
  413. ValueTree projectRoot { Ids::JUCERPROJECT };
  414. ValueWithDefault projectNameValue, projectUIDValue, projectLineFeedValue, projectTypeValue, versionValue, bundleIdentifierValue, companyNameValue,
  415. companyCopyrightValue, companyWebsiteValue, companyEmailValue, displaySplashScreenValue, splashScreenColourValue, cppStandardValue,
  416. headerSearchPathsValue, preprocessorDefsValue, userNotesValue, maxBinaryFileSizeValue, includeBinaryDataInJuceHeaderValue, binaryDataNamespaceValue,
  417. compilerFlagSchemesValue, postExportShellCommandPosixValue, postExportShellCommandWinValue, useAppConfigValue, addUsingNamespaceToJuceHeader;
  418. ValueWithDefault pluginFormatsValue, pluginNameValue, pluginDescriptionValue, pluginManufacturerValue, pluginManufacturerCodeValue,
  419. pluginCodeValue, pluginChannelConfigsValue, pluginCharacteristicsValue, pluginAUExportPrefixValue, pluginAAXIdentifierValue,
  420. pluginAUMainTypeValue, pluginAUSandboxSafeValue, pluginRTASCategoryValue, pluginVSTCategoryValue, pluginVST3CategoryValue, pluginAAXCategoryValue,
  421. pluginVSTNumMidiInputsValue, pluginVSTNumMidiOutputsValue;
  422. //==============================================================================
  423. std::unique_ptr<EnabledModulesList> enabledModulesList;
  424. AvailableModulesList exporterPathsModulesList;
  425. //==============================================================================
  426. void updateDeprecatedProjectSettings();
  427. //==============================================================================
  428. bool shouldWriteLegacyPluginFormatSettings = false;
  429. bool shouldWriteLegacyPluginCharacteristicsSettings = false;
  430. static Array<Identifier> getLegacyPluginFormatIdentifiers() noexcept;
  431. static Array<Identifier> getLegacyPluginCharacteristicsIdentifiers() noexcept;
  432. void writeLegacyPluginFormatSettings();
  433. void writeLegacyPluginCharacteristicsSettings();
  434. void coalescePluginFormatValues();
  435. void coalescePluginCharacteristicsValues();
  436. void updatePluginCategories();
  437. //==============================================================================
  438. File tempDirectory;
  439. std::pair<Time, String> cachedFileState;
  440. void saveAndMoveTemporaryProject (bool openInIDE);
  441. //==============================================================================
  442. friend class Item;
  443. StringPairArray parsedPreprocessorDefs;
  444. //==============================================================================
  445. void initialiseProjectValues();
  446. void initialiseMainGroup();
  447. void initialiseAudioPluginValues();
  448. bool setCppVersionFromOldExporterSettings();
  449. void createAudioPluginPropertyEditors (PropertyListBuilder& props);
  450. //==============================================================================
  451. void updateTitleDependencies();
  452. void updateCompanyNameDependencies();
  453. void updateProjectSettings();
  454. ValueTree getConfigurations() const;
  455. ValueTree getConfigNode();
  456. void updateOldStyleConfigList();
  457. void moveOldPropertyFromProjectToAllExporters (Identifier name);
  458. void removeDefunctExporters();
  459. void updateOldModulePaths();
  460. //==============================================================================
  461. void licenseStateChanged() override;
  462. void changeListenerCallback (ChangeBroadcaster*) override;
  463. void availableModulesChanged (AvailableModulesList*) override;
  464. void updateLicenseWarning();
  465. void updateJUCEPathWarning();
  466. void updateModuleWarnings();
  467. void updateExporterWarnings();
  468. void updateCppStandardWarning (bool showWarning);
  469. void updateMissingModuleDependenciesWarning (bool showWarning);
  470. void updateOldProjucerWarning (bool showWarning);
  471. void updateCLionWarning (bool showWarning);
  472. void updateModuleNotFoundWarning (bool showWarning);
  473. ValueTree projectMessages { ProjectMessages::Ids::projectMessages, {},
  474. { { ProjectMessages::Ids::notification, {} }, { ProjectMessages::Ids::warning, {} } } };
  475. std::map<Identifier, std::vector<ProjectMessages::MessageAction>> messageActions;
  476. ProjectFileModificationPoller fileModificationPoller { *this };
  477. std::unique_ptr<FileChooser> chooser;
  478. std::unique_ptr<ProjectSaver> saver;
  479. //==============================================================================
  480. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Project)
  481. JUCE_DECLARE_WEAK_REFERENCEABLE (Project)
  482. };