@@ -1,9 +1,9 @@ | |||
/* | |||
IMPORTANT! This file is auto-generated by the Jucer each time you save your | |||
IMPORTANT! This file is auto-generated each time you save your | |||
project - if you alter its contents, your changes may be overwritten! | |||
If you want to change any of these values, use the Jucer to do so, rather than | |||
If you want to change any of these values, use the Introjucer to do so, rather than | |||
editing this file directly! | |||
Any commented-out settings will fall back to using the default values that | |||
@@ -1,6 +1,6 @@ | |||
/* | |||
IMPORTANT! This file is auto-generated by the Jucer each time you save your | |||
IMPORTANT! This file is auto-generated each time you save your | |||
project - if you alter its contents, your changes may be overwritten! | |||
This is the header file that your files should include in order to get all the | |||
@@ -1,6 +1,6 @@ | |||
/* | |||
IMPORTANT! This file is auto-generated by the Jucer each time you save your | |||
IMPORTANT! This file is auto-generated each time you save your | |||
project - if you alter its contents, your changes may be overwritten! | |||
This file pulls in all the Juce source code, and builds it using the settings | |||
@@ -1,6 +1,6 @@ | |||
/* | |||
IMPORTANT! This file is auto-generated by the Jucer each time you save your | |||
IMPORTANT! This file is auto-generated each time you save your | |||
project - if you alter its contents, your changes may be overwritten! | |||
This file pulls in all the Juce source code, and builds it using the settings | |||
@@ -1,6 +1,6 @@ | |||
/* | |||
IMPORTANT! This file is auto-generated by the Jucer each time you save your | |||
IMPORTANT! This file is auto-generated each time you save your | |||
project - if you alter its contents, your changes may be overwritten! | |||
This file pulls in all the Juce source code, and builds it using the settings | |||
@@ -1,6 +1,6 @@ | |||
/* | |||
IMPORTANT! This file is auto-generated by the Jucer each time you save your | |||
IMPORTANT! This file is auto-generated each time you save your | |||
project - if you alter its contents, your changes may be overwritten! | |||
This file pulls in all the Juce source code, and builds it using the settings | |||
@@ -1,6 +1,6 @@ | |||
/* | |||
IMPORTANT! This file is auto-generated by the Jucer each time you save your | |||
IMPORTANT! This file is auto-generated each time you save your | |||
project - if you alter its contents, your changes may be overwritten! | |||
This file pulls in all the Juce source code, and builds it using the settings | |||
@@ -1,6 +1,6 @@ | |||
/* | |||
IMPORTANT! This file is auto-generated by the Jucer each time you save your | |||
IMPORTANT! This file is auto-generated each time you save your | |||
project - if you alter its contents, your changes may be overwritten! | |||
This file pulls in all the Juce source code, and builds it using the settings | |||
@@ -1,6 +1,6 @@ | |||
/* | |||
IMPORTANT! This file is auto-generated by the Jucer each time you save your | |||
IMPORTANT! This file is auto-generated each time you save your | |||
project - if you alter its contents, your changes may be overwritten! | |||
This file pulls in all the Juce source code, and builds it using the settings | |||
@@ -1,6 +1,6 @@ | |||
/* | |||
IMPORTANT! This file is auto-generated by the Jucer each time you save your | |||
IMPORTANT! This file is auto-generated each time you save your | |||
project - if you alter its contents, your changes may be overwritten! | |||
This file pulls in all the Juce source code, and builds it using the settings | |||
@@ -69,7 +69,7 @@ public: | |||
File mainWindowH = mainWindowCpp.withFileExtension (".h"); | |||
String windowClassName = "MainAppWindow"; | |||
project.getProjectTypeValue() = ProjectType_GUIApp::getTypeName(); | |||
project.getProjectTypeValue() = ProjectType::getGUIAppTypeName(); | |||
Project::Item sourceGroup (project.getMainGroup().addNewSubGroup ("Source", 0)); | |||
@@ -170,7 +170,7 @@ public: | |||
File mainCppFile = getSourceFilesFolder().getChildFile ("Main.cpp"); | |||
project.getProjectTypeValue() = ProjectType_ConsoleApp::getTypeName(); | |||
project.getProjectTypeValue() = ProjectType::getConsoleAppTypeName(); | |||
Project::Item sourceGroup (project.getMainGroup().addNewSubGroup ("Source", 0)); | |||
@@ -229,10 +229,10 @@ public: | |||
File editorCppFile = getSourceFilesFolder().getChildFile ("PluginEditor.cpp"); | |||
File editorHFile = editorCppFile.withFileExtension (".h"); | |||
project.getProjectTypeValue() = ProjectType_AudioPlugin::getTypeName(); | |||
project.getProjectTypeValue() = ProjectType::getAudioPluginTypeName(); | |||
Project::Item sourceGroup (project.getMainGroup().addNewSubGroup ("Source", 0)); | |||
project.getJuceConfigFlag ("JUCE_QUICKTIME") = Project::configFlagDisabled; // disabled because it interferes with RTAS build on PC | |||
project.getConfigFlag ("JUCE_QUICKTIME") = Project::configFlagDisabled; // disabled because it interferes with RTAS build on PC | |||
for (int i = project.getNumConfigurations(); --i >= 0;) | |||
project.getConfiguration(i).getTargetBinaryName() = File::createLegalFileName (appTitle); | |||
@@ -91,7 +91,7 @@ void Project::updateProjectSettings() | |||
void Project::setMissingDefaultValues() | |||
{ | |||
if (! projectRoot.hasProperty (Ids::id_)) | |||
projectRoot.setProperty (Ids::id_, createAlphaNumericUID(), 0); | |||
projectRoot.setProperty (Ids::id_, createAlphaNumericUID(), nullptr); | |||
// Create main file group if missing | |||
if (! projectRoot.getChildWithName (Tags::projectMainGroup).isValid()) | |||
@@ -106,7 +106,7 @@ void Project::setMissingDefaultValues() | |||
setTitle ("Juce Project"); | |||
if (! projectRoot.hasProperty (Ids::projectType)) | |||
getProjectTypeValue() = ProjectType_GUIApp::getTypeName(); | |||
getProjectTypeValue() = ProjectType::getGUIAppTypeName(); | |||
if (! projectRoot.hasProperty (Ids::version)) | |||
getVersion() = "1.0.0"; | |||
@@ -183,8 +183,8 @@ const String Project::saveDocument (const File& file) | |||
{ | |||
// (getting these forces the values to be sanitised) | |||
OwnedArray <Project::JuceConfigFlag> flags; | |||
getJuceConfigFlags (flags); | |||
OwnedArray <Project::ConfigFlag> flags; | |||
getAllConfigFlags (flags); | |||
} | |||
if (FileHelpers::isJuceFolder (getLocalJuceFolder())) | |||
@@ -284,7 +284,7 @@ const ProjectType& Project::getProjectType() const | |||
if (type == nullptr) | |||
{ | |||
type = ProjectType::findType (ProjectType_GUIApp::getTypeName()); | |||
type = ProjectType::findType (ProjectType::getGUIAppTypeName()); | |||
jassert (type != nullptr); | |||
} | |||
@@ -437,6 +437,21 @@ void Project::createPropertyEditors (Array <PropertyComponent*>& props) | |||
props.getUnchecked(i)->setPreferredHeight (22); | |||
} | |||
String Project::getVersionAsHex() const | |||
{ | |||
StringArray configs; | |||
configs.addTokens (getVersion().toString(), ",.", String::empty); | |||
configs.trim(); | |||
configs.removeEmptyStrings(); | |||
int value = (configs[0].getIntValue() << 16) + (configs[1].getIntValue() << 8) + configs[2].getIntValue(); | |||
if (configs.size() >= 4) | |||
value = (value << 8) + configs[3].getIntValue(); | |||
return "0x" + String::toHexString (value); | |||
} | |||
Image Project::getBigIcon() | |||
{ | |||
Item icon (getMainGroup().findItemWithID (getBigIconImageItemID().toString())); | |||
@@ -546,6 +561,8 @@ Project::Item::~Item() | |||
} | |||
String Project::Item::getID() const { return node [Ids::id_]; } | |||
void Project::Item::setID (const String& newID) { node.setProperty (Ids::id_, newID, nullptr); } | |||
String Project::Item::getImageFileID() const { return "id:" + getID(); } | |||
Project::Item Project::Item::createGroup (Project& project, const String& name) | |||
@@ -596,24 +613,20 @@ bool Project::Item::shouldBeAddedToTargetProject() const | |||
return isFile(); | |||
} | |||
bool Project::Item::shouldBeCompiled() const | |||
{ | |||
return getShouldCompileValue().getValue(); | |||
} | |||
bool Project::Item::shouldBeCompiled() const { return getShouldCompileValue().getValue(); } | |||
Value Project::Item::getShouldCompileValue() const { return node.getPropertyAsValue (Ids::compile, getUndoManager()); } | |||
Value Project::Item::getShouldCompileValue() const | |||
{ | |||
return node.getPropertyAsValue (Ids::compile, getUndoManager()); | |||
} | |||
bool Project::Item::shouldBeAddedToBinaryResources() const { return getShouldAddToResourceValue().getValue(); } | |||
Value Project::Item::getShouldAddToResourceValue() const { return node.getPropertyAsValue (Ids::resource, getUndoManager()); } | |||
bool Project::Item::shouldBeAddedToBinaryResources() const | |||
{ | |||
return getShouldAddToResourceValue().getValue(); | |||
} | |||
Value Project::Item::getShouldInhibitWarningsValue() const { return node.getPropertyAsValue (Ids::noWarnings, getUndoManager()); } | |||
Value Project::Item::getShouldAddToResourceValue() const | |||
String Project::Item::getFilePath() const | |||
{ | |||
return node.getPropertyAsValue (Ids::resource, getUndoManager()); | |||
if (isFile()) | |||
return node [Ids::file].toString(); | |||
else | |||
return String::empty; | |||
} | |||
File Project::Item::getFile() const | |||
@@ -706,7 +719,7 @@ File Project::Item::determineGroupFolder() const | |||
void Project::Item::initialiseNodeValues() | |||
{ | |||
if (! node.hasProperty (Ids::id_)) | |||
node.setProperty (Ids::id_, createAlphaNumericUID(), 0); | |||
setID (createAlphaNumericUID()); | |||
if (isFile()) | |||
{ | |||
@@ -808,12 +821,12 @@ bool Project::Item::addFile (const File& file, int insertIndex) | |||
return true; | |||
} | |||
bool Project::Item::addRelativeFile (const RelativePath& file, int insertIndex) | |||
bool Project::Item::addRelativeFile (const RelativePath& file, int insertIndex, bool shouldCompile) | |||
{ | |||
Item item (getProject(), ValueTree (Tags::file)); | |||
item.initialiseNodeValues(); | |||
item.getName() = file.getFileName(); | |||
item.getShouldCompileValue() = file.hasFileExtension ("cpp;mm;c;m;cc;cxx"); | |||
item.getShouldCompileValue() = shouldCompile; | |||
item.getShouldAddToResourceValue() = getProject().shouldBeAddedToBinaryResourcesByDefault (file); | |||
if (canContain (item)) | |||
@@ -844,54 +857,31 @@ const Drawable* Project::Item::getIcon() const | |||
} | |||
//============================================================================== | |||
ValueTree Project::getJuceConfigNode() | |||
ValueTree Project::getConfigNode() | |||
{ | |||
return projectRoot.getOrCreateChildWithName (Tags::configGroup, nullptr); | |||
} | |||
void Project::getJuceConfigFlags (OwnedArray <JuceConfigFlag>& flags) | |||
void Project::getAllConfigFlags (OwnedArray <ConfigFlag>& flags) | |||
{ | |||
ValueTree configNode (getJuceConfigNode()); | |||
StringArray lines; | |||
getLocalJuceFolder().getChildFile ("juce_Config.h").readLines (lines); | |||
for (int i = 0; i < lines.size(); ++i) | |||
{ | |||
String line (lines[i].trim()); | |||
OwnedArray<LibraryModule> modules; | |||
getProjectType().createRequiredModules (*this, modules); | |||
if (line.startsWith ("/** ") && line.containsChar (':')) | |||
{ | |||
ScopedPointer <JuceConfigFlag> config (new JuceConfigFlag()); | |||
config->symbol = line.substring (4).upToFirstOccurrenceOf (":", false, false).trim(); | |||
int i; | |||
for (i = 0; i < modules.size(); ++i) | |||
modules.getUnchecked(i)->getConfigFlags (*this, flags); | |||
if (config->symbol.length() > 4) | |||
{ | |||
config->description = line.fromFirstOccurrenceOf (":", false, false).trimStart(); | |||
++i; | |||
while (! (lines[i].contains ("*/") || lines[i].contains ("@see"))) | |||
{ | |||
if (lines[i].trim().isNotEmpty()) | |||
config->description = config->description.trim() + " " + lines[i].trim(); | |||
++i; | |||
} | |||
config->description = config->description.upToFirstOccurrenceOf ("*/", false, false); | |||
config->value.referTo (getJuceConfigFlag (config->symbol)); | |||
flags.add (config.release()); | |||
} | |||
} | |||
} | |||
for (i = 0; i < flags.size(); ++i) | |||
flags.getUnchecked(i)->value.referTo (getConfigFlag (flags.getUnchecked(i)->symbol)); | |||
} | |||
const char* const Project::configFlagDefault = "default"; | |||
const char* const Project::configFlagEnabled = "enabled"; | |||
const char* const Project::configFlagDisabled = "disabled"; | |||
Value Project::getJuceConfigFlag (const String& name) | |||
Value Project::getConfigFlag (const String& name) | |||
{ | |||
const ValueTree configNode (getJuceConfigNode()); | |||
const ValueTree configNode (getConfigNode()); | |||
Value v (configNode.getPropertyAsValue (name, getUndoManagerFor (configNode))); | |||
if (v.getValue().toString().isEmpty()) | |||
@@ -900,7 +890,7 @@ Value Project::getJuceConfigFlag (const String& name) | |||
return v; | |||
} | |||
bool Project::isJuceConfigFlagEnabled (const String& name) const | |||
bool Project::isConfigFlagEnabled (const String& name) const | |||
{ | |||
return projectRoot.getChildWithName (Tags::configGroup).getProperty (name) == configFlagEnabled; | |||
} | |||
@@ -75,6 +75,7 @@ public: | |||
Value getProjectTypeValue() const { return getProjectValue ("projectType"); } | |||
Value getVersion() const { return getProjectValue ("version"); } | |||
String getVersionAsHex() const; | |||
Value getBundleIdentifier() const { return getProjectValue ("bundleIdentifier"); } | |||
void setBundleIdentifierToDefault() { getBundleIdentifier() = "com.yourcompany." + CodeHelpers::makeValidIdentifier (getProjectName().toString(), false, true, false); } | |||
@@ -127,9 +128,10 @@ public: | |||
Value getPluginRTASCategory() const { return getProjectValue ("pluginRTASCategory"); } | |||
//============================================================================== | |||
File getAppIncludeFile() const { return getWrapperFolder().getChildFile (getJuceSourceHFilename()); } | |||
File getWrapperFolder() const { return getFile().getSiblingFile ("JuceLibraryCode"); } | |||
File getPluginCharacteristicsFile() const { return getWrapperFolder().getChildFile (getPluginCharacteristicsFilename()); } | |||
File getAppIncludeFile() const { return getGeneratedCodeFolder().getChildFile (getJuceSourceHFilename()); } | |||
File getGeneratedCodeFolder() const { return getFile().getSiblingFile ("JuceLibraryCode"); } | |||
File getPluginCharacteristicsFile() const { return getGeneratedCodeFolder().getChildFile (getPluginCharacteristicsFilename()); } | |||
File getLocalJuceFolder(); | |||
//============================================================================== | |||
String getAmalgamatedHeaderFileName() const { return "juce_amalgamated.h"; } | |||
@@ -173,10 +175,12 @@ public: | |||
String getID() const; | |||
Item findItemWithID (const String& targetId) const; // (recursive search) | |||
String getImageFileID() const; | |||
void setID (const String& newID); | |||
//============================================================================== | |||
Value getName() const; | |||
File getFile() const; | |||
String getFilePath() const; | |||
void setFile (const File& file); | |||
void setFile (const RelativePath& file); | |||
File determineGroupFolder() const; | |||
@@ -187,6 +191,7 @@ public: | |||
Value getShouldCompileValue() const; | |||
bool shouldBeAddedToBinaryResources() const; | |||
Value getShouldAddToResourceValue() const; | |||
Value getShouldInhibitWarningsValue() const; | |||
//============================================================================== | |||
bool canContain (const Item& child) const; | |||
@@ -196,7 +201,7 @@ public: | |||
Item addNewSubGroup (const String& name, int insertIndex); | |||
void addChild (const Item& newChild, int insertIndex); | |||
bool addFile (const File& file, int insertIndex); | |||
bool addRelativeFile (const RelativePath& file, int insertIndex); | |||
bool addRelativeFile (const RelativePath& file, int insertIndex, bool shouldCompile); | |||
void removeItemFromProject(); | |||
void sortAlphabetically(); | |||
Item findItemForFile (const File& file) const; | |||
@@ -285,19 +290,19 @@ public: | |||
void createDefaultExporters(); | |||
//============================================================================== | |||
struct JuceConfigFlag | |||
struct ConfigFlag | |||
{ | |||
String symbol, description; | |||
Value value; // 1 = true, 2 = false, anything else = use default | |||
}; | |||
void getJuceConfigFlags (OwnedArray <JuceConfigFlag>& flags); | |||
void getAllConfigFlags (OwnedArray <ConfigFlag>& flags); | |||
static const char* const configFlagDefault; | |||
static const char* const configFlagEnabled; | |||
static const char* const configFlagDisabled; | |||
Value getJuceConfigFlag (const String& name); | |||
bool isJuceConfigFlagEnabled (const String& name) const; | |||
Value getConfigFlag (const String& name); | |||
bool isConfigFlagEnabled (const String& name) const; | |||
//============================================================================== | |||
String getFileTemplate (const String& templateName); | |||
@@ -323,12 +328,11 @@ private: | |||
static File lastDocumentOpened; | |||
DrawableImage mainProjectIcon; | |||
File getLocalJuceFolder(); | |||
void updateProjectSettings(); | |||
void setMissingDefaultValues(); | |||
ValueTree getConfigurations() const; | |||
void createDefaultConfigs(); | |||
ValueTree getJuceConfigNode(); | |||
ValueTree getConfigNode(); | |||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Project); | |||
}; | |||
@@ -209,7 +209,9 @@ private: | |||
{ | |||
Array<RelativePath> files; | |||
findAllFilesToCompile (project.getMainGroup(), files); | |||
findAllFilesToCompile (libraryFilesGroup, files); | |||
for (int i = 0; i < generatedGroups.size(); ++i) | |||
findAllFilesToCompile (generatedGroups.getReference(i), files); | |||
MemoryOutputStream mo; | |||
writeAndroidMk (mo, files); | |||
@@ -164,7 +164,8 @@ protected: | |||
{ | |||
StringArray searchPaths (config.getHeaderSearchPaths()); | |||
project.getProjectType().addExtraSearchPaths (*this, searchPaths); | |||
for (int i = 0; i < libraryModules.size(); ++i) | |||
libraryModules.getUnchecked(i)->addExtraSearchPaths (*this, searchPaths); | |||
return searchPaths; | |||
} | |||
@@ -399,11 +400,11 @@ public: | |||
if (hasIcon) | |||
{ | |||
libraryFilesGroup.addFile (iconFile, -1); | |||
libraryFilesGroup.addFile (rcFile, -1); | |||
generatedGroups.getReference(0).addFile (iconFile, -1); | |||
generatedGroups.getReference(0).addFile (rcFile, -1); | |||
libraryFilesGroup.findItemForFile (iconFile).getShouldAddToResourceValue() = false; | |||
libraryFilesGroup.findItemForFile (rcFile).getShouldAddToResourceValue() = false; | |||
generatedGroups.getReference(0).findItemForFile (iconFile).getShouldAddToResourceValue() = false; | |||
generatedGroups.getReference(0).findItemForFile (rcFile).getShouldAddToResourceValue() = false; | |||
} | |||
{ | |||
@@ -523,11 +524,9 @@ protected: | |||
{ | |||
addFiles (project.getMainGroup(), files, false); | |||
if (libraryFilesGroup.getNumChildren() > 0) | |||
addFiles (libraryFilesGroup, files, false); | |||
if (isVST()) addFiles (createVSTGroup (false), files, false); | |||
if (isRTAS()) addFiles (createRTASGroup (false), files, true); | |||
for (int i = 0; i < generatedGroups.size(); ++i) | |||
if (generatedGroups.getReference(i).getNumChildren() > 0) | |||
addFiles (generatedGroups.getReference(i), files, false); | |||
} | |||
//============================================================================== | |||
@@ -935,11 +934,9 @@ private: | |||
writeFiles (out, project.getMainGroup()); | |||
if (libraryFilesGroup.getNumChildren() > 0) | |||
writeFiles (out, libraryFilesGroup); | |||
if (isVST()) | |||
writeFiles (out, createVSTGroup (false)); | |||
for (int i = 0; i < generatedGroups.size(); ++i) | |||
if (generatedGroups.getReference(i).getNumChildren() > 0) | |||
writeFiles (out, generatedGroups.getReference(i)); | |||
out << "# End Target" << newLine | |||
<< "# End Project" << newLine; | |||
@@ -1290,14 +1287,9 @@ protected: | |||
addFilesToCompile (project.getMainGroup(), *cppFiles, *headerFiles, false); | |||
if (libraryFilesGroup.getNumChildren() > 0) | |||
addFilesToCompile (libraryFilesGroup, *cppFiles, *headerFiles, false); | |||
if (isVST()) | |||
addFilesToCompile (createVSTGroup (false), *cppFiles, *headerFiles, false); | |||
if (isRTAS()) | |||
addFilesToCompile (createRTASGroup (false), *cppFiles, *headerFiles, true); | |||
for (int i = 0; i < generatedGroups.size(); ++i) | |||
if (generatedGroups.getReference(i).getNumChildren() > 0) | |||
addFilesToCompile (generatedGroups.getReference(i), *cppFiles, *headerFiles, false); | |||
} | |||
if (hasIcon) | |||
@@ -1450,20 +1442,9 @@ protected: | |||
addFilesToFilter (project.getMainGroup(), project.getProjectName().toString(), *cpps, *headers, *groups); | |||
if (libraryFilesGroup.getNumChildren() > 0) | |||
addFilesToFilter (libraryFilesGroup, project.getJuceCodeGroupName(), *cpps, *headers, *groups); | |||
if (isVST()) | |||
{ | |||
Project::Item vstGroup (createVSTGroup (false)); | |||
addFilesToFilter (vstGroup, vstGroup.getName().toString(), *cpps, *headers, *groups); | |||
} | |||
if (isRTAS()) | |||
{ | |||
Project::Item rtasGroup (createRTASGroup (false)); | |||
addFilesToFilter (rtasGroup, rtasGroup.getName().toString(), *cpps, *headers, *groups); | |||
} | |||
for (int i = 0; i < generatedGroups.size(); ++i) | |||
if (generatedGroups.getReference(i).getNumChildren() > 0) | |||
addFilesToFilter (generatedGroups.getReference(i), project.getJuceCodeGroupName(), *cpps, *headers, *groups); | |||
if (iconFile.exists()) | |||
{ | |||
@@ -88,10 +88,9 @@ public: | |||
{ | |||
Array<RelativePath> files; | |||
findAllFilesToCompile (project.getMainGroup(), files); | |||
findAllFilesToCompile (libraryFilesGroup, files); | |||
if (isVST()) | |||
findAllFilesToCompile (createVSTGroup (false), files); | |||
for (int i = 0; i < generatedGroups.size(); ++i) | |||
findAllFilesToCompile (generatedGroups.getReference(i), files); | |||
MemoryOutputStream mo; | |||
writeMakefile (mo, files); | |||
@@ -139,7 +138,8 @@ private: | |||
headerPaths.insert (0, "/usr/include/freetype2"); | |||
headerPaths.insert (0, "/usr/include"); | |||
project.getProjectType().addExtraSearchPaths (*this, headerPaths); | |||
for (int i = 0; i < libraryModules.size(); ++i) | |||
libraryModules.getUnchecked(i)->addExtraSearchPaths (*this, headerPaths); | |||
for (int i = 0; i < headerPaths.size(); ++i) | |||
out << " -I " << FileHelpers::unixStylePath (replacePreprocessorTokens (config, headerPaths[i])).quoted(); | |||
@@ -185,19 +185,19 @@ private: | |||
if (hasPList()) | |||
{ | |||
RelativePath plistPath (infoPlistFile, getTargetFolder(), RelativePath::buildTargetFolder); | |||
addFileReference (plistPath); | |||
addFileReference (plistPath.toUnixStyle()); | |||
resourceFileRefs.add (createID (plistPath)); | |||
} | |||
if (iconFile.exists()) | |||
{ | |||
RelativePath iconPath (iconFile, getTargetFolder(), RelativePath::buildTargetFolder); | |||
addFileReference (iconPath); | |||
addFileReference (iconPath.toUnixStyle()); | |||
resourceIDs.add (addBuildFile (iconPath, false, false)); | |||
resourceFileRefs.add (createID (iconPath)); | |||
} | |||
addProjectItem (project.getMainGroup(), String::empty, false); | |||
addProjectItem (project.getMainGroup()); | |||
for (int i = 0; i < project.getNumConfigurations(); ++i) | |||
{ | |||
@@ -402,7 +402,8 @@ private: | |||
{ | |||
StringArray searchPaths (config.getHeaderSearchPaths()); | |||
project.getProjectType().addExtraSearchPaths (*this, searchPaths); | |||
for (int i = 0; i < libraryModules.size(); ++i) | |||
libraryModules.getUnchecked(i)->addExtraSearchPaths (*this, searchPaths); | |||
return searchPaths; | |||
} | |||
@@ -650,7 +651,7 @@ private: | |||
if (isAU()) | |||
s.addTokens ("AudioUnit CoreAudioKit AudioToolbox", false); | |||
else if (project.getJuceConfigFlag ("JUCE_PLUGINHOST_AU").toString() == Project::configFlagEnabled) | |||
else if (project.getConfigFlag ("JUCE_PLUGINHOST_AU").toString() == Project::configFlagEnabled) | |||
s.addTokens ("AudioUnit CoreAudioKit", false); | |||
} | |||
@@ -711,9 +712,9 @@ private: | |||
xml->createNewChildElement (value ? "true" : "false"); | |||
} | |||
String addBuildFile (const RelativePath& path, const String& fileRefID, bool addToSourceBuildPhase, bool inhibitWarnings) | |||
String addBuildFile (const String& path, const String& fileRefID, bool addToSourceBuildPhase, bool inhibitWarnings) | |||
{ | |||
String fileID (createID (path.toUnixStyle() + "buildref")); | |||
String fileID (createID (path + "buildref")); | |||
if (addToSourceBuildPhase) | |||
sourceIDs.add (fileID); | |||
@@ -731,27 +732,33 @@ private: | |||
String addBuildFile (const RelativePath& path, bool addToSourceBuildPhase, bool inhibitWarnings) | |||
{ | |||
return addBuildFile (path, createID (path), addToSourceBuildPhase, inhibitWarnings); | |||
return addBuildFile (path.toUnixStyle(), createID (path), addToSourceBuildPhase, inhibitWarnings); | |||
} | |||
void addFileReference (const RelativePath& path, const String& sourceTree, const String& lastKnownFileType, const String& fileRefID) | |||
String addFileReference (String pathString) | |||
{ | |||
String sourceTree ("SOURCE_ROOT"); | |||
RelativePath path (pathString, RelativePath::unknown); | |||
if (pathString.startsWith ("${")) | |||
{ | |||
sourceTree = pathString.substring (2).upToFirstOccurrenceOf ("}", false, false); | |||
pathString = pathString.fromFirstOccurrenceOf ("}/", false, false); | |||
} | |||
else if (path.isAbsolute()) | |||
{ | |||
sourceTree = "<absolute>"; | |||
} | |||
const String fileRefID (createID (pathString)); | |||
ValueTree* v = new ValueTree (fileRefID); | |||
v->setProperty ("isa", "PBXFileReference", 0); | |||
v->setProperty ("lastKnownFileType", lastKnownFileType, 0); | |||
v->setProperty (Ids::name, path.getFileName(), 0); | |||
v->setProperty ("path", sanitisePath (path.toUnixStyle()), 0); | |||
v->setProperty ("lastKnownFileType", getFileType (path), 0); | |||
v->setProperty (Ids::name, pathString.fromLastOccurrenceOf ("/", false, false), 0); | |||
v->setProperty ("path", sanitisePath (pathString), 0); | |||
v->setProperty ("sourceTree", sourceTree, 0); | |||
pbxFileReferences.add (v); | |||
} | |||
String addFileReference (const RelativePath& path) | |||
{ | |||
const String fileRefID (createID (path)); | |||
jassert (path.isAbsolute() || path.getRoot() == RelativePath::buildTargetFolder); | |||
addFileReference (path, path.isAbsolute() ? "<absolute>" : "SOURCE_ROOT", | |||
getFileType (path), fileRefID); | |||
return fileRefID; | |||
} | |||
@@ -779,34 +786,48 @@ private: | |||
String addFile (const RelativePath& path, bool shouldBeCompiled, bool inhibitWarnings) | |||
{ | |||
if (shouldBeCompiled) | |||
addBuildFile (path, true, inhibitWarnings); | |||
else if (path.hasFileExtension (".r")) | |||
rezFileIDs.add (addBuildFile (path, false, inhibitWarnings)); | |||
{ | |||
if (path.hasFileExtension (".r")) | |||
rezFileIDs.add (addBuildFile (path, false, inhibitWarnings)); | |||
else | |||
addBuildFile (path, true, inhibitWarnings); | |||
} | |||
return addFileReference (path); | |||
return addFileReference (path.toUnixStyle()); | |||
} | |||
String addProjectItem (const Project::Item& projectItem, const String& groupID, bool inhibitWarnings) | |||
String addProjectItem (const Project::Item& projectItem) | |||
{ | |||
if (projectItem.isGroup()) | |||
{ | |||
StringArray childIDs; | |||
for (int i = 0; i < projectItem.getNumChildren(); ++i) | |||
{ | |||
const String childID (addProjectItem (projectItem.getChild(i), String::empty, inhibitWarnings)); | |||
const String childID (addProjectItem (projectItem.getChild(i))); | |||
if (childID.isNotEmpty()) | |||
childIDs.add (childID); | |||
} | |||
return addGroup (projectItem, childIDs, groupID); | |||
return addGroup (projectItem, childIDs); | |||
} | |||
else | |||
{ | |||
if (projectItem.shouldBeAddedToTargetProject()) | |||
{ | |||
const RelativePath path (projectItem.getFile(), getTargetFolder(), RelativePath::buildTargetFolder); | |||
return addFile (path, projectItem.shouldBeCompiled(), inhibitWarnings); | |||
String itemPath (projectItem.getFilePath()); | |||
bool inhibitWarnings = projectItem.getShouldInhibitWarningsValue().getValue(); | |||
if (itemPath.startsWith ("${")) | |||
{ | |||
const RelativePath path (itemPath, RelativePath::unknown); | |||
return addFile (path, projectItem.shouldBeCompiled(), inhibitWarnings); | |||
} | |||
else | |||
{ | |||
const RelativePath path (projectItem.getFile(), getTargetFolder(), RelativePath::buildTargetFolder); | |||
return addFile (path, projectItem.shouldBeCompiled(), inhibitWarnings); | |||
} | |||
} | |||
} | |||
@@ -815,9 +836,9 @@ private: | |||
void addFramework (const String& frameworkName) | |||
{ | |||
const RelativePath path ("System/Library/Frameworks/" + frameworkName + ".framework", RelativePath::unknown); | |||
const String path ("System/Library/Frameworks/" + frameworkName + ".framework"); | |||
const String fileRefID (createID (path)); | |||
addFileReference (path, "SDKROOT", getFileType (path), fileRefID); | |||
addFileReference ("${SDKROOT}/" + path); | |||
frameworkIDs.add (addBuildFile (path, fileRefID, false, false)); | |||
frameworkFileIDs.add (fileRefID); | |||
} | |||
@@ -832,7 +853,7 @@ private: | |||
groups.add (v); | |||
} | |||
String addGroup (const Project::Item& item, StringArray& childIDs, String groupID) | |||
String addGroup (const Project::Item& item, StringArray& childIDs) | |||
{ | |||
String groupName (item.getName().toString()); | |||
@@ -840,17 +861,9 @@ private: | |||
{ | |||
groupName = "Source"; | |||
if (libraryFilesGroup.getNumChildren() > 0) | |||
childIDs.add (addProjectItem (libraryFilesGroup, createID ("__jucelibfiles"), false)); | |||
if (isVST()) | |||
childIDs.add (addProjectItem (createVSTGroup (true), createID ("__jucevstfiles"), false)); | |||
if (isAU()) | |||
childIDs.add (createAUWrappersGroup()); | |||
if (isRTAS()) | |||
childIDs.add (addProjectItem (createRTASGroup (true), createID ("__jucertasfiles"), true)); | |||
for (int i = 0; i < generatedGroups.size(); ++i) | |||
if (generatedGroups.getReference(i).getNumChildren() > 0) | |||
childIDs.add (addProjectItem (generatedGroups.getReference(i))); | |||
{ // Add 'resources' group | |||
String resourcesGroupID (createID ("__resources")); | |||
@@ -873,9 +886,7 @@ private: | |||
} | |||
} | |||
if (groupID.isEmpty()) | |||
groupID = getIDForGroup (item); | |||
const String groupID (getIDForGroup (item)); | |||
addGroup (groupID, groupName, childIDs); | |||
return groupID; | |||
} | |||
@@ -1019,14 +1030,17 @@ private: | |||
return createID (path.toUnixStyle()); | |||
} | |||
String createID (const String& rootString) const | |||
String createID (String rootString) const | |||
{ | |||
if (rootString.startsWith ("${")) | |||
rootString = rootString.fromFirstOccurrenceOf ("}/", false, false); | |||
static const char digits[] = "0123456789ABCDEF"; | |||
char n[24]; | |||
Random ran (projectIDSalt + hashCode64 (rootString)); | |||
for (int i = 0; i < numElementsInArray (n); ++i) | |||
n[i] = digits [ran.nextInt (16)]; | |||
n[i] = digits [ran.nextInt() & 15]; | |||
return String (n, numElementsInArray (n)); | |||
} | |||
@@ -1040,101 +1054,6 @@ private: | |||
{ | |||
return file.hasFileExtension (sourceFileExtensions); | |||
} | |||
//============================================================================== | |||
String createAUWrappersGroup() | |||
{ | |||
Array<RelativePath> auWrappers; | |||
const char* files[] = { JUCE_PLUGINS_PATH_AU "juce_AU_Resources.r", | |||
JUCE_PLUGINS_PATH_AU "juce_AU_Wrapper.mm" }; | |||
int i; | |||
for (i = 0; i < numElementsInArray (files); ++i) | |||
auWrappers.add (getJucePathFromTargetFolder().getChildFile (files[i])); | |||
#define JUCE_AU_PUBLICUTILITY "Extras/CoreAudio/PublicUtility/" | |||
#define JUCE_AU_PUBLIC "Extras/CoreAudio/AudioUnits/AUPublic/" | |||
const char* appleAUFiles[] = { JUCE_AU_PUBLICUTILITY "CADebugMacros.h", | |||
JUCE_AU_PUBLICUTILITY "CAAUParameter.cpp", | |||
JUCE_AU_PUBLICUTILITY "CAAUParameter.h", | |||
JUCE_AU_PUBLICUTILITY "CAAudioChannelLayout.cpp", | |||
JUCE_AU_PUBLICUTILITY "CAAudioChannelLayout.h", | |||
JUCE_AU_PUBLICUTILITY "CAMutex.cpp", | |||
JUCE_AU_PUBLICUTILITY "CAMutex.h", | |||
JUCE_AU_PUBLICUTILITY "CAStreamBasicDescription.cpp", | |||
JUCE_AU_PUBLICUTILITY "CAStreamBasicDescription.h", | |||
JUCE_AU_PUBLICUTILITY "CAVectorUnitTypes.h", | |||
JUCE_AU_PUBLICUTILITY "CAVectorUnit.cpp", | |||
JUCE_AU_PUBLICUTILITY "CAVectorUnit.h", | |||
JUCE_AU_PUBLIC "AUViewBase/AUViewLocalizedStringKeys.h", | |||
JUCE_AU_PUBLIC "AUCarbonViewBase/AUCarbonViewDispatch.cpp", | |||
JUCE_AU_PUBLIC "AUCarbonViewBase/AUCarbonViewControl.cpp", | |||
JUCE_AU_PUBLIC "AUCarbonViewBase/AUCarbonViewControl.h", | |||
JUCE_AU_PUBLIC "AUCarbonViewBase/CarbonEventHandler.cpp", | |||
JUCE_AU_PUBLIC "AUCarbonViewBase/CarbonEventHandler.h", | |||
JUCE_AU_PUBLIC "AUCarbonViewBase/AUCarbonViewBase.cpp", | |||
JUCE_AU_PUBLIC "AUCarbonViewBase/AUCarbonViewBase.h", | |||
JUCE_AU_PUBLIC "AUBase/AUBase.cpp", | |||
JUCE_AU_PUBLIC "AUBase/AUBase.h", | |||
JUCE_AU_PUBLIC "AUBase/AUDispatch.cpp", | |||
JUCE_AU_PUBLIC "AUBase/AUDispatch.h", | |||
JUCE_AU_PUBLIC "AUBase/AUInputElement.cpp", | |||
JUCE_AU_PUBLIC "AUBase/AUInputElement.h", | |||
JUCE_AU_PUBLIC "AUBase/AUOutputElement.cpp", | |||
JUCE_AU_PUBLIC "AUBase/AUOutputElement.h", | |||
JUCE_AU_PUBLIC "AUBase/AUResources.r", | |||
JUCE_AU_PUBLIC "AUBase/AUScopeElement.cpp", | |||
JUCE_AU_PUBLIC "AUBase/AUScopeElement.h", | |||
JUCE_AU_PUBLIC "AUBase/ComponentBase.cpp", | |||
JUCE_AU_PUBLIC "AUBase/ComponentBase.h", | |||
JUCE_AU_PUBLIC "OtherBases/AUMIDIBase.cpp", | |||
JUCE_AU_PUBLIC "OtherBases/AUMIDIBase.h", | |||
JUCE_AU_PUBLIC "OtherBases/AUMIDIEffectBase.cpp", | |||
JUCE_AU_PUBLIC "OtherBases/AUMIDIEffectBase.h", | |||
JUCE_AU_PUBLIC "OtherBases/AUOutputBase.cpp", | |||
JUCE_AU_PUBLIC "OtherBases/AUOutputBase.h", | |||
JUCE_AU_PUBLIC "OtherBases/MusicDeviceBase.cpp", | |||
JUCE_AU_PUBLIC "OtherBases/MusicDeviceBase.h", | |||
JUCE_AU_PUBLIC "OtherBases/AUEffectBase.cpp", | |||
JUCE_AU_PUBLIC "OtherBases/AUEffectBase.h", | |||
JUCE_AU_PUBLIC "Utility/AUBuffer.cpp", | |||
JUCE_AU_PUBLIC "Utility/AUBuffer.h", | |||
JUCE_AU_PUBLIC "Utility/AUDebugDispatcher.cpp", | |||
JUCE_AU_PUBLIC "Utility/AUDebugDispatcher.h", | |||
JUCE_AU_PUBLIC "Utility/AUInputFormatConverter.h", | |||
JUCE_AU_PUBLIC "Utility/AUSilentTimeout.h", | |||
JUCE_AU_PUBLIC "Utility/AUTimestampGenerator.h" }; | |||
StringArray fileIDs, appleFileIDs; | |||
for (i = 0; i < auWrappers.size(); ++i) | |||
{ | |||
addFile (auWrappers.getReference(i), shouldFileBeCompiledByDefault (auWrappers.getReference(i)), false); | |||
fileIDs.add (createID (auWrappers.getReference(i))); | |||
} | |||
for (i = 0; i < numElementsInArray (appleAUFiles); ++i) | |||
{ | |||
RelativePath file (appleAUFiles[i], RelativePath::unknown); | |||
const String fileRefID (createID (file)); | |||
addFileReference (file, "DEVELOPER_DIR", getFileType (file), fileRefID); | |||
if (shouldFileBeCompiledByDefault (file)) | |||
addBuildFile (file, fileRefID, true, true); | |||
appleFileIDs.add (fileRefID); | |||
} | |||
const String appleGroupID (createID ("__juceappleaufiles")); | |||
addGroup (appleGroupID, "Apple AU Files", appleFileIDs); | |||
fileIDs.add (appleGroupID); | |||
const String groupID (createID ("__juceaufiles")); | |||
addGroup (groupID, "Juce AU Wrapper", fileIDs); | |||
return groupID; | |||
} | |||
}; | |||
@@ -32,8 +32,7 @@ | |||
//============================================================================== | |||
ProjectExporter::ProjectExporter (Project& project_, const ValueTree& settings_) | |||
: libraryFilesGroup (Project::Item::createGroup (project_, project_.getJuceCodeGroupName())), | |||
project (project_), | |||
: project (project_), | |||
settings (settings_) | |||
{ | |||
} | |||
@@ -87,6 +86,7 @@ ProjectExporter* ProjectExporter::createNewExporter (Project& project, const int | |||
else | |||
exp->getJuceFolder() = juceFolder.getFullPathName(); | |||
exp->createLibraryModules(); | |||
return exp; | |||
} | |||
@@ -101,6 +101,7 @@ ProjectExporter* ProjectExporter::createExporter (Project& project, const ValueT | |||
if (exp == nullptr) exp = AndroidProjectExporter::createForSettings (project, settings); | |||
jassert (exp != nullptr); | |||
exp->createLibraryModules(); | |||
return exp; | |||
} | |||
@@ -125,6 +126,12 @@ ProjectExporter* ProjectExporter::createPlatformDefaultExporter (Project& projec | |||
return best.release(); | |||
} | |||
void ProjectExporter::createLibraryModules() | |||
{ | |||
libraryModules.clear(); | |||
project.getProjectType().createRequiredModules (project, libraryModules); | |||
} | |||
File ProjectExporter::getTargetFolder() const | |||
{ | |||
return project.resolveFilename (getTargetLocation().toString()); | |||
@@ -180,7 +187,8 @@ void ProjectExporter::createPropertyEditors (Array <PropertyComponent*>& props) | |||
props.add (new TextPropertyComponent (getJuceFolder(), "Juce Location", 1024, false)); | |||
props.getLast()->setTooltip ("The location of the Juce library folder that the " + name + " project will use to when compiling. This can be an absolute path, or relative to the jucer project folder, but it must be valid on the filesystem of the machine you use to actually do the compiling."); | |||
project.getProjectType().createPropertyEditors (*this, props); | |||
for (int i = 0; i < libraryModules.size(); ++i) | |||
libraryModules.getUnchecked(i)->createPropertyEditors (*this, props); | |||
props.add (new TextPropertyComponent (getExporterPreprocessorDefs(), "Extra Preprocessor Definitions", 32768, false)); | |||
props.getLast()->setTooltip ("Extra preprocessor definitions. Use the form \"NAME1=value NAME2=value\", using whitespace or commas to separate the items - to include a space or comma in a definition, precede it with a backslash."); | |||
@@ -191,49 +199,6 @@ void ProjectExporter::createPropertyEditors (Array <PropertyComponent*>& props) | |||
props.getLast()->setTooltip ("Extra command-line flags to be passed to the linker. You might want to use this for adding additional libraries. This string can contain references to preprocessor definitions in the form ${NAME_OF_VALUE}, which will be replaced with their values."); | |||
} | |||
Project::Item ProjectExporter::createVSTGroup (bool forOSX) const | |||
{ | |||
jassert (isVST()); | |||
Project::Item group (Project::Item::createGroup (project, "Juce VST Wrapper")); | |||
const char* osxFiles[] = { JUCE_PLUGINS_PATH_VST "juce_VST_Wrapper.cpp", | |||
JUCE_PLUGINS_PATH_VST "juce_VST_Wrapper.mm", 0 }; | |||
const char* winFiles[] = { JUCE_PLUGINS_PATH_VST "juce_VST_Wrapper.cpp", 0}; | |||
for (const char** f = (forOSX ? osxFiles : winFiles); *f != 0; ++f) | |||
group.addRelativeFile (getJucePathFromProjectFolder().getChildFile (*f), -1); | |||
return group; | |||
} | |||
Project::Item ProjectExporter::createRTASGroup (bool forOSX) const | |||
{ | |||
jassert (isRTAS()); | |||
Project::Item group (Project::Item::createGroup (project, "Juce RTAS Wrapper")); | |||
const char* osxFiles[] = { JUCE_PLUGINS_PATH_RTAS "juce_RTAS_DigiCode1.cpp", | |||
JUCE_PLUGINS_PATH_RTAS "juce_RTAS_DigiCode2.cpp", | |||
JUCE_PLUGINS_PATH_RTAS "juce_RTAS_DigiCode3.cpp", | |||
JUCE_PLUGINS_PATH_RTAS "juce_RTAS_DigiCode_Header.h", | |||
JUCE_PLUGINS_PATH_RTAS "juce_RTAS_MacResources.r", | |||
JUCE_PLUGINS_PATH_RTAS "juce_RTAS_MacUtilities.mm", | |||
JUCE_PLUGINS_PATH_RTAS "juce_RTAS_Wrapper.cpp", 0 }; | |||
const char* winFiles[] = { JUCE_PLUGINS_PATH_RTAS "juce_RTAS_DigiCode1.cpp", | |||
JUCE_PLUGINS_PATH_RTAS "juce_RTAS_DigiCode2.cpp", | |||
JUCE_PLUGINS_PATH_RTAS "juce_RTAS_DigiCode3.cpp", | |||
JUCE_PLUGINS_PATH_RTAS "juce_RTAS_DigiCode_Header.h", | |||
JUCE_PLUGINS_PATH_RTAS "juce_RTAS_WinUtilities.cpp", | |||
JUCE_PLUGINS_PATH_RTAS "juce_RTAS_Wrapper.cpp" , 0}; | |||
for (const char** f = (forOSX ? osxFiles : winFiles); *f != 0; ++f) | |||
group.addRelativeFile (getJucePathFromProjectFolder().getChildFile (*f), -1); | |||
return group; | |||
} | |||
StringPairArray ProjectExporter::getAllPreprocessorDefs (const Project::BuildConfiguration& config) const | |||
{ | |||
StringPairArray defs (mergePreprocessorDefs (config.getAllPreprocessorDefs(), | |||
@@ -107,8 +107,6 @@ public: | |||
+ String::toHexString (settings [Ids::targetFolder].toString().hashCode()).toUpperCase(); | |||
} | |||
Project::Item libraryFilesGroup; | |||
// An exception that can be thrown by the create() method. | |||
class SaveError | |||
{ | |||
@@ -125,20 +123,22 @@ public: | |||
Project::Item& getMainGroup(); | |||
RelativePath getJucePathFromTargetFolder() const; | |||
RelativePath getJucePathFromProjectFolder() const; | |||
Array<Project::Item> generatedGroups; | |||
OwnedArray<LibraryModule> libraryModules; | |||
void createLibraryModules(); | |||
protected: | |||
//============================================================================== | |||
Project& project; | |||
ValueTree settings; | |||
String name; | |||
RelativePath getJucePathFromTargetFolder() const; | |||
RelativePath getJucePathFromProjectFolder() const; | |||
static String getDefaultBuildsRootFolder() { return "Builds/"; } | |||
Project::Item createVSTGroup (bool forOSX) const; | |||
Project::Item createRTASGroup (bool forOSX) const; | |||
static String getLibbedFilename (String name) | |||
{ | |||
if (! name.startsWith ("lib")) | |||
@@ -45,8 +45,8 @@ public: | |||
else if (tabIndex == 1) | |||
{ | |||
// The Juce options tab... | |||
OwnedArray <Project::JuceConfigFlag> flags; | |||
project.getJuceConfigFlags (flags); | |||
OwnedArray <Project::ConfigFlag> flags; | |||
project.getAllConfigFlags (flags); | |||
StringArray possibleValues; | |||
possibleValues.add ("(Use default from juce_Config.h)"); | |||
@@ -32,7 +32,8 @@ class ProjectSaver | |||
{ | |||
public: | |||
ProjectSaver (Project& project_, const File& projectFile_) | |||
: project (project_), projectFile (projectFile_), resourceFile (project_) | |||
: project (project_), projectFile (projectFile_), resourceFile (project_), | |||
generatedCodeFolder (project.getGeneratedCodeFolder()) | |||
{ | |||
} | |||
@@ -46,26 +47,22 @@ public: | |||
if (linkageMode == Project::notLinkedToJuce) | |||
{ | |||
hasAppHeaderFile = ! project.getProjectType().isLibrary(); | |||
hasAppConfigFile = false; | |||
numJuceSourceFiles = 0; | |||
} | |||
else if (linkageMode == Project::useAmalgamatedJuce | |||
|| linkageMode == Project::useAmalgamatedJuceViaSingleTemplate) | |||
{ | |||
hasAppHeaderFile = true; | |||
hasAppConfigFile = true; | |||
numJuceSourceFiles = 1; | |||
} | |||
else if (linkageMode == Project::useAmalgamatedJuceViaMultipleTemplates) | |||
{ | |||
hasAppHeaderFile = true; | |||
hasAppConfigFile = true; | |||
numJuceSourceFiles = project.getNumSeparateAmalgamatedFiles(); | |||
} | |||
else if (linkageMode == Project::useLinkedJuce) | |||
{ | |||
hasAppHeaderFile = true; | |||
hasAppConfigFile = true; | |||
numJuceSourceFiles = 0; | |||
} | |||
else | |||
@@ -77,6 +74,12 @@ public: | |||
writeMainProjectFile(); | |||
if (! generatedCodeFolder.createDirectory()) | |||
errors.add ("Couldn't create folder: " + generatedCodeFolder.getFullPathName()); | |||
if (errors.size() == 0) | |||
writeAppConfigFile(); | |||
if (errors.size() == 0) | |||
writeJuceSourceWrappers(); | |||
@@ -89,14 +92,20 @@ public: | |||
return errors[0]; | |||
} | |||
bool saveGeneratedFile (const String& filePath, const MemoryOutputStream& newData) | |||
{ | |||
return replaceFileIfDifferent (generatedCodeFolder.getChildFile (filePath), newData); | |||
} | |||
private: | |||
Project& project; | |||
const File& projectFile; | |||
ResourceFile resourceFile; | |||
File generatedCodeFolder; | |||
StringArray errors; | |||
File appConfigFile, juceHeaderFile, binaryDataCpp, pluginCharacteristicsFile; | |||
bool hasAppHeaderFile, hasAppConfigFile, hasResources; | |||
bool hasAppHeaderFile, hasResources; | |||
int numJuceSourceFiles; | |||
void writeMainProjectFile() | |||
@@ -128,18 +137,18 @@ private: | |||
} | |||
} | |||
void writeJucerComment (OutputStream& out) | |||
static void writeJucerComment (OutputStream& out) | |||
{ | |||
out << "/*" << newLine << newLine | |||
<< " IMPORTANT! This file is auto-generated by the Jucer each time you save your" << newLine | |||
<< " IMPORTANT! This file is auto-generated each time you save your" << newLine | |||
<< " project - if you alter its contents, your changes may be overwritten!" << newLine | |||
<< newLine; | |||
} | |||
void writeAppConfig (OutputStream& out) | |||
bool writeAppConfig (OutputStream& out) | |||
{ | |||
writeJucerComment (out); | |||
out << " If you want to change any of these values, use the Jucer to do so, rather than" << newLine | |||
out << " If you want to change any of these values, use the Introjucer to do so, rather than" << newLine | |||
<< " editing this file directly!" << newLine | |||
<< newLine | |||
<< " Any commented-out settings will fall back to using the default values that" << newLine | |||
@@ -154,12 +163,12 @@ private: | |||
<< " If you need to set a configuration that differs from the default, you'll need" << newLine | |||
<< " to include the amalgamated Juce files." << newLine << newLine; | |||
OwnedArray <Project::JuceConfigFlag> flags; | |||
project.getJuceConfigFlags (flags); | |||
OwnedArray <Project::ConfigFlag> flags; | |||
project.getAllConfigFlags (flags); | |||
for (int i = 0; i < flags.size(); ++i) | |||
{ | |||
const Project::JuceConfigFlag* const f = flags[i]; | |||
const Project::ConfigFlag* const f = flags[i]; | |||
const String value (f->value.toString()); | |||
if (value != Project::configFlagEnabled && value != Project::configFlagDisabled) | |||
@@ -179,6 +188,8 @@ private: | |||
if (notActive) | |||
out << newLine << "*/" << newLine; | |||
return flags.size() > 0; | |||
} | |||
void writeSourceWrapper (OutputStream& out, int fileNumber) | |||
@@ -215,7 +226,7 @@ private: | |||
out << "#ifndef " << headerGuard << newLine | |||
<< "#define " << headerGuard << newLine << newLine; | |||
if (hasAppConfigFile) | |||
if (appConfigFile.exists()) | |||
out << CodeHelpers::createIncludeStatement (appConfigFile, appConfigFile) << newLine; | |||
if (project.getJuceLinkageMode() != Project::notLinkedToJuce) | |||
@@ -235,7 +246,7 @@ private: | |||
<< "{" << newLine | |||
<< " const char* const projectName = " << CodeHelpers::addEscapeChars (project.getProjectName().toString()).quoted() << ";" << newLine | |||
<< " const char* const versionString = " << CodeHelpers::addEscapeChars (project.getVersion().toString()).quoted() << ";" << newLine | |||
<< " const int versionNumber = " << createVersionCode (project.getVersion().toString()) << ";" << newLine | |||
<< " const int versionNumber = " << project.getVersionAsHex() << ";" << newLine | |||
<< "}" << newLine | |||
<< newLine | |||
<< "#endif // " << headerGuard << newLine; | |||
@@ -303,24 +314,9 @@ private: | |||
return maxVal; | |||
} | |||
static String createVersionCode (const String& version) | |||
{ | |||
StringArray configs; | |||
configs.addTokens (version, ",.", String::empty); | |||
configs.trim(); | |||
configs.removeEmptyStrings(); | |||
int value = (configs[0].getIntValue() << 16) + (configs[1].getIntValue() << 8) + configs[2].getIntValue(); | |||
if (configs.size() >= 4) | |||
value = (value << 8) + configs[3].getIntValue(); | |||
return "0x" + String::toHexString (value); | |||
} | |||
void writePluginCharacteristics (OutputStream& out) | |||
static void writePluginCharacteristics (const File& destFile, Project& project, OutputStream& out) | |||
{ | |||
String headerGuard ("__PLUGINCHARACTERISTICS_" + String::toHexString (pluginCharacteristicsFile.hashCode()).toUpperCase() + "__"); | |||
String headerGuard ("__PLUGINCHARACTERISTICS_" + String::toHexString (destFile.hashCode()).toUpperCase() + "__"); | |||
writeJucerComment (out); | |||
out << " This header file contains configuration options for the plug-in. If you need to change any of" << newLine | |||
@@ -349,7 +345,7 @@ private: | |||
<< "#define JucePlugin_SilenceInProducesSilenceOut " << ((bool) project.getPluginSilenceInProducesSilenceOut().getValue() ? 1 : 0) << newLine | |||
<< "#define JucePlugin_TailLengthSeconds " << (double) project.getPluginTailLengthSeconds().getValue() << newLine | |||
<< "#define JucePlugin_EditorRequiresKeyboardFocus " << ((bool) project.getPluginEditorNeedsKeyFocus().getValue() ? 1 : 0) << newLine | |||
<< "#define JucePlugin_VersionCode " << createVersionCode (project.getVersion().toString()) << newLine | |||
<< "#define JucePlugin_VersionCode " << project.getVersionAsHex() << newLine | |||
<< "#define JucePlugin_VersionString " << project.getVersion().toString().quoted() << newLine | |||
<< "#define JucePlugin_VSTUniqueID JucePlugin_PluginCode" << newLine | |||
<< "#define JucePlugin_VSTCategory " << ((bool) project.getPluginIsSynth().getValue() ? "kPlugCategSynth" : "kPlugCategEffect") << newLine | |||
@@ -380,24 +376,24 @@ private: | |||
return true; | |||
} | |||
void writeJuceSourceWrappers() | |||
void writeAppConfigFile() | |||
{ | |||
const File wrapperFolder (project.getWrapperFolder()); | |||
appConfigFile = project.getGeneratedCodeFolder().getChildFile (project.getAppConfigFilename()); | |||
appConfigFile = wrapperFolder.getChildFile (project.getAppConfigFilename()); | |||
pluginCharacteristicsFile = wrapperFolder.getChildFile (project.getPluginCharacteristicsFilename()); | |||
MemoryOutputStream mem; | |||
if (writeAppConfig (mem)) | |||
replaceFileIfDifferent (appConfigFile, mem); | |||
else | |||
appConfigFile.deleteFile(); | |||
} | |||
void writeJuceSourceWrappers() | |||
{ | |||
juceHeaderFile = project.getAppIncludeFile(); | |||
binaryDataCpp = wrapperFolder.getChildFile ("BinaryData.cpp"); | |||
binaryDataCpp = generatedCodeFolder.getChildFile ("BinaryData.cpp"); | |||
if (resourceFile.getNumFiles() > 0) | |||
{ | |||
if (! wrapperFolder.createDirectory()) | |||
{ | |||
errors.add ("Couldn't create folder: " + wrapperFolder.getFullPathName()); | |||
return; | |||
} | |||
//resourceFile.setJuceHeaderToInclude (juceHeaderFile); | |||
resourceFile.setClassName ("BinaryData"); | |||
@@ -413,27 +409,11 @@ private: | |||
if (project.getProjectType().isLibrary()) | |||
return; | |||
if (! wrapperFolder.createDirectory()) | |||
{ | |||
errors.add ("Couldn't create folder: " + wrapperFolder.getFullPathName()); | |||
return; | |||
} | |||
if (hasAppConfigFile) | |||
{ | |||
MemoryOutputStream mem; | |||
writeAppConfig (mem); | |||
replaceFileIfDifferent (appConfigFile, mem); | |||
} | |||
else | |||
{ | |||
appConfigFile.deleteFile(); | |||
} | |||
if (project.getProjectType().isAudioPlugin()) | |||
{ | |||
MemoryOutputStream mem; | |||
writePluginCharacteristics (mem); | |||
pluginCharacteristicsFile = generatedCodeFolder.getChildFile (project.getPluginCharacteristicsFilename()); | |||
writePluginCharacteristics (pluginCharacteristicsFile, project, mem); | |||
replaceFileIfDifferent (pluginCharacteristicsFile, mem); | |||
} | |||
@@ -469,6 +449,46 @@ private: | |||
} | |||
} | |||
Project::Item createLibraryFilesGroup (ProjectExporter& exporter) | |||
{ | |||
Project::Item libraryFiles (Project::Item::createGroup (project, project.getJuceCodeGroupName())); | |||
if (appConfigFile.exists()) | |||
libraryFiles.addFile (appConfigFile, -1); | |||
if (hasAppHeaderFile) | |||
libraryFiles.addFile (juceHeaderFile, -1); | |||
if (hasResources) | |||
{ | |||
libraryFiles.addFile (binaryDataCpp, -1); | |||
libraryFiles.addFile (binaryDataCpp.withFileExtension (".h"), -1); | |||
} | |||
if (numJuceSourceFiles > 0) | |||
{ | |||
for (int j = 0; j <= project.getNumSeparateAmalgamatedFiles(); ++j) | |||
{ | |||
const File sourceWrapperCpp (getSourceWrapperCpp (j)); | |||
const File sourceWrapperMM (sourceWrapperCpp.withFileExtension (".mm")); | |||
if ((j == 0 && numJuceSourceFiles == 1) || (j != 0 && numJuceSourceFiles > 1)) | |||
{ | |||
if (exporter.usesMMFiles()) | |||
libraryFiles.addFile (sourceWrapperMM, -1); | |||
else | |||
libraryFiles.addFile (sourceWrapperCpp, -1); | |||
} | |||
} | |||
} | |||
if (project.getProjectType().isAudioPlugin()) | |||
libraryFiles.addFile (pluginCharacteristicsFile, -1); | |||
libraryFiles.setID ("__jucelibfiles"); | |||
return libraryFiles; | |||
} | |||
void writeProjects() | |||
{ | |||
for (int i = project.getNumExporters(); --i >= 0;) | |||
@@ -480,39 +500,10 @@ private: | |||
if (targetFolder.createDirectory()) | |||
{ | |||
Project::Item& libraryFiles = exporter->libraryFilesGroup; | |||
if (hasAppConfigFile) | |||
libraryFiles.addFile (appConfigFile, -1); | |||
if (hasAppHeaderFile) | |||
libraryFiles.addFile (juceHeaderFile, -1); | |||
if (hasResources) | |||
{ | |||
libraryFiles.addFile (binaryDataCpp, -1); | |||
libraryFiles.addFile (binaryDataCpp.withFileExtension (".h"), -1); | |||
} | |||
if (numJuceSourceFiles > 0) | |||
{ | |||
for (int j = 0; j <= project.getNumSeparateAmalgamatedFiles(); ++j) | |||
{ | |||
const File sourceWrapperCpp (getSourceWrapperCpp (j)); | |||
const File sourceWrapperMM (sourceWrapperCpp.withFileExtension (".mm")); | |||
if ((j == 0 && numJuceSourceFiles == 1) || (j != 0 && numJuceSourceFiles > 1)) | |||
{ | |||
if (exporter->usesMMFiles()) | |||
libraryFiles.addFile (sourceWrapperMM, -1); | |||
else | |||
libraryFiles.addFile (sourceWrapperCpp, -1); | |||
} | |||
} | |||
} | |||
exporter->generatedGroups.add (createLibraryFilesGroup (*exporter)); | |||
if (project.getProjectType().isAudioPlugin()) | |||
libraryFiles.addFile (pluginCharacteristicsFile, -1); | |||
for (int j = 0; j < exporter->libraryModules.size(); ++j) | |||
exporter->libraryModules.getUnchecked(j)->addExtraCodeGroups (*exporter, exporter->generatedGroups); | |||
try | |||
{ | |||
@@ -532,8 +523,9 @@ private: | |||
File getSourceWrapperCpp (int fileIndex) const | |||
{ | |||
return project.getWrapperFolder().getChildFile (project.getJuceSourceFilenameRoot() + (fileIndex != 0 ? String (fileIndex) : String::empty)) | |||
.withFileExtension (".cpp"); | |||
return project.getGeneratedCodeFolder() | |||
.getChildFile (project.getJuceSourceFilenameRoot() + (fileIndex != 0 ? String (fileIndex) : String::empty)) | |||
.withFileExtension (".cpp"); | |||
} | |||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ProjectSaver); | |||
@@ -27,48 +27,11 @@ | |||
#include "jucer_ProjectExporter.h" | |||
//============================================================================== | |||
static ProjectType_GUIApp guiType; | |||
static ProjectType_ConsoleApp consoleType; | |||
static ProjectType_StaticLibrary staticLibType; | |||
static ProjectType_AudioPlugin audioPluginType; | |||
//============================================================================== | |||
ProjectType::ProjectType (const String& type_, const String& desc_) | |||
: type (type_), desc (desc_) | |||
LibraryModule::LibraryModule() | |||
{ | |||
getAllTypes().add (this); | |||
} | |||
ProjectType::~ProjectType() | |||
{ | |||
getAllTypes().removeValue (this); | |||
} | |||
Array<ProjectType*>& ProjectType::getAllTypes() | |||
{ | |||
static Array<ProjectType*> types; | |||
return types; | |||
} | |||
const ProjectType* ProjectType::findType (const String& typeCode) | |||
{ | |||
const Array<ProjectType*>& types = getAllTypes(); | |||
for (int i = types.size(); --i >= 0;) | |||
if (types.getUnchecked(i)->getType() == typeCode) | |||
return types.getUnchecked(i); | |||
jassertfalse; | |||
return nullptr; | |||
} | |||
//============================================================================== | |||
Result ProjectType::createRequiredFiles (Project::Item& projectRoot, | |||
Array<File>& filesCreated) const | |||
{ | |||
return Result::ok(); | |||
} | |||
namespace | |||
{ | |||
void addVSTFolderToPath (const ProjectExporter& exporter, StringArray& searchPaths) | |||
@@ -93,143 +56,463 @@ namespace | |||
} | |||
} | |||
void ProjectType::addExtraSearchPaths (const ProjectExporter& exporter, StringArray& paths) const | |||
//============================================================================== | |||
class JuceLibraryModule : public LibraryModule | |||
{ | |||
if (exporter.getProject().isJuceConfigFlagEnabled ("JUCE_PLUGINHOST_VST")) | |||
addVSTFolderToPath (exporter, paths); | |||
} | |||
public: | |||
JuceLibraryModule() {} | |||
void addExtraCodeGroups (const ProjectExporter& exporter, Array<Project::Item>& groups) const | |||
{ | |||
} | |||
void addExtraSearchPaths (const ProjectExporter& exporter, StringArray& paths) const | |||
{ | |||
if (exporter.getProject().isConfigFlagEnabled ("JUCE_PLUGINHOST_VST")) | |||
addVSTFolderToPath (exporter, paths); | |||
} | |||
void createPropertyEditors (const ProjectExporter& exporter, Array <PropertyComponent*>& props) const | |||
{ | |||
if (exporter.getProject().isConfigFlagEnabled ("JUCE_PLUGINHOST_VST")) | |||
createVSTPathEditor (exporter, props); | |||
} | |||
void getConfigFlags (Project& project, OwnedArray<Project::ConfigFlag>& flags) | |||
{ | |||
if (project.getJuceLinkageMode() == Project::notLinkedToJuce) | |||
return; | |||
StringArray lines; | |||
project.getLocalJuceFolder().getChildFile ("juce_Config.h").readLines (lines); | |||
for (int i = 0; i < lines.size(); ++i) | |||
{ | |||
String line (lines[i].trim()); | |||
if (line.startsWith ("/** ") && line.containsChar (':')) | |||
{ | |||
ScopedPointer <Project::ConfigFlag> config (new Project::ConfigFlag()); | |||
config->symbol = line.substring (4).upToFirstOccurrenceOf (":", false, false).trim(); | |||
if (config->symbol.length() > 4) | |||
{ | |||
config->description = line.fromFirstOccurrenceOf (":", false, false).trimStart(); | |||
++i; | |||
while (! (lines[i].contains ("*/") || lines[i].contains ("@see"))) | |||
{ | |||
if (lines[i].trim().isNotEmpty()) | |||
config->description = config->description.trim() + " " + lines[i].trim(); | |||
++i; | |||
} | |||
config->description = config->description.upToFirstOccurrenceOf ("*/", false, false); | |||
flags.add (config.release()); | |||
} | |||
} | |||
} | |||
} | |||
}; | |||
void ProjectType::createPropertyEditors (const ProjectExporter& exporter, Array <PropertyComponent*>& props) const | |||
//============================================================================== | |||
class VSTLibraryModule : public LibraryModule | |||
{ | |||
if (exporter.getProject().isJuceConfigFlagEnabled ("JUCE_PLUGINHOST_VST")) | |||
public: | |||
VSTLibraryModule() {} | |||
void addExtraCodeGroups (const ProjectExporter& exporter, Array<Project::Item>& groups) const | |||
{ | |||
Project::Item group (Project::Item::createGroup (const_cast<ProjectExporter&> (exporter).getProject(), "Juce VST Wrapper")); | |||
group.setID ("__jucevstfiles"); | |||
const char* osxFiles[] = { JUCE_PLUGINS_PATH_VST "juce_VST_Wrapper.cpp", | |||
JUCE_PLUGINS_PATH_VST "juce_VST_Wrapper.mm", 0 }; | |||
const char* winFiles[] = { JUCE_PLUGINS_PATH_VST "juce_VST_Wrapper.cpp", 0}; | |||
for (const char** f = (exporter.isXcode() ? osxFiles : winFiles); *f != 0; ++f) | |||
group.addRelativeFile (exporter.getJucePathFromProjectFolder().getChildFile (*f), -1, true); | |||
groups.add (group); | |||
} | |||
void addExtraSearchPaths (const ProjectExporter& exporter, StringArray& paths) const | |||
{ | |||
RelativePath juceWrapperFolder (exporter.getProject().getGeneratedCodeFolder(), | |||
exporter.getTargetFolder(), RelativePath::buildTargetFolder); | |||
addVSTFolderToPath (exporter, paths); | |||
if (exporter.isVisualStudio()) | |||
paths.add (juceWrapperFolder.toWindowsStyle()); | |||
else if (exporter.isLinux()) | |||
paths.add (juceWrapperFolder.toUnixStyle()); | |||
} | |||
void createPropertyEditors (const ProjectExporter& exporter, Array <PropertyComponent*>& props) const | |||
{ | |||
createVSTPathEditor (exporter, props); | |||
} | |||
} | |||
void getConfigFlags (Project& project, OwnedArray<Project::ConfigFlag>& flags) | |||
{ | |||
} | |||
}; | |||
//============================================================================== | |||
Result ProjectType_GUIApp::createRequiredFiles (Project::Item& projectRoot, Array<File>& filesCreated) const | |||
class RTASLibraryModule : public LibraryModule | |||
{ | |||
return ProjectType::createRequiredFiles (projectRoot, filesCreated); | |||
} | |||
public: | |||
RTASLibraryModule() {} | |||
void addExtraCodeGroups (const ProjectExporter& exporter, Array<Project::Item>& groups) const | |||
{ | |||
if (exporter.isXcode() || exporter.isVisualStudio()) | |||
{ | |||
Project::Item group (Project::Item::createGroup (const_cast<ProjectExporter&> (exporter).getProject(), "Juce RTAS Wrapper")); | |||
group.setID ("__jucertasfiles"); | |||
const char* osxFiles[] = { JUCE_PLUGINS_PATH_RTAS "juce_RTAS_DigiCode1.cpp", | |||
JUCE_PLUGINS_PATH_RTAS "juce_RTAS_DigiCode2.cpp", | |||
JUCE_PLUGINS_PATH_RTAS "juce_RTAS_DigiCode3.cpp", | |||
JUCE_PLUGINS_PATH_RTAS "juce_RTAS_DigiCode_Header.h", | |||
JUCE_PLUGINS_PATH_RTAS "juce_RTAS_MacResources.r", | |||
JUCE_PLUGINS_PATH_RTAS "juce_RTAS_MacUtilities.mm", | |||
JUCE_PLUGINS_PATH_RTAS "juce_RTAS_Wrapper.cpp", 0 }; | |||
const char* winFiles[] = { JUCE_PLUGINS_PATH_RTAS "juce_RTAS_DigiCode1.cpp", | |||
JUCE_PLUGINS_PATH_RTAS "juce_RTAS_DigiCode2.cpp", | |||
JUCE_PLUGINS_PATH_RTAS "juce_RTAS_DigiCode3.cpp", | |||
JUCE_PLUGINS_PATH_RTAS "juce_RTAS_DigiCode_Header.h", | |||
JUCE_PLUGINS_PATH_RTAS "juce_RTAS_WinUtilities.cpp", | |||
JUCE_PLUGINS_PATH_RTAS "juce_RTAS_Wrapper.cpp" , 0}; | |||
for (const char** f = (exporter.isXcode() ? osxFiles : winFiles); *f != 0; ++f) | |||
{ | |||
const RelativePath file (exporter.getJucePathFromProjectFolder().getChildFile (*f)); | |||
group.addRelativeFile (file, -1, file.hasFileExtension ("cpp;mm;r")); | |||
} | |||
groups.add (group); | |||
} | |||
} | |||
void addExtraSearchPaths (const ProjectExporter& exporter, StringArray& paths) const | |||
{ | |||
RelativePath sdkFolder (exporter.getRTASFolder().toString(), RelativePath::projectFolder); | |||
if (exporter.isVisualStudio()) | |||
{ | |||
RelativePath juceWrapperFolder (exporter.getProject().getGeneratedCodeFolder(), | |||
exporter.getTargetFolder(), RelativePath::buildTargetFolder); | |||
paths.add (juceWrapperFolder.toWindowsStyle()); | |||
const char* p[] = { "AlturaPorts/TDMPlugins/PluginLibrary/EffectClasses", | |||
"AlturaPorts/TDMPlugins/PluginLibrary/ProcessClasses", | |||
"AlturaPorts/TDMPlugins/PluginLibrary/ProcessClasses/Interfaces", | |||
"AlturaPorts/TDMPlugins/PluginLibrary/Utilities", | |||
"AlturaPorts/TDMPlugins/PluginLibrary/RTASP_Adapt", | |||
"AlturaPorts/TDMPlugins/PluginLibrary/CoreClasses", | |||
"AlturaPorts/TDMPlugins/PluginLibrary/Controls", | |||
"AlturaPorts/TDMPlugins/PluginLibrary/Meters", | |||
"AlturaPorts/TDMPlugins/PluginLibrary/ViewClasses", | |||
"AlturaPorts/TDMPlugins/PluginLibrary/DSPClasses", | |||
"AlturaPorts/TDMPlugins/PluginLibrary/Interfaces", | |||
"AlturaPorts/TDMPlugins/common", | |||
"AlturaPorts/TDMPlugins/common/Platform", | |||
"AlturaPorts/TDMPlugins/SignalProcessing/Public", | |||
"AlturaPorts/TDMPlugIns/DSPManager/Interfaces", | |||
"AlturaPorts/SADriver/Interfaces", | |||
"AlturaPorts/DigiPublic/Interfaces", | |||
"AlturaPorts/Fic/Interfaces/DAEClient", | |||
"AlturaPorts/NewFileLibs/Cmn", | |||
"AlturaPorts/NewFileLibs/DOA", | |||
"AlturaPorts/AlturaSource/PPC_H", | |||
"AlturaPorts/AlturaSource/AppSupport", | |||
"AvidCode/AVX2sdk/AVX/avx2/avx2sdk/inc", | |||
"xplat/AVX/avx2/avx2sdk/inc" }; | |||
for (int i = 0; i < numElementsInArray (p); ++i) | |||
paths.add (exporter.rebaseFromProjectFolderToBuildTarget (sdkFolder.getChildFile (p[i])).toWindowsStyle()); | |||
} | |||
else if (exporter.isXcode()) | |||
{ | |||
paths.add ("/Developer/Headers/FlatCarbon"); | |||
const char* p[] = { "AlturaPorts/TDMPlugIns/PlugInLibrary/Controls", | |||
"AlturaPorts/TDMPlugIns/PlugInLibrary/CoreClasses", | |||
"AlturaPorts/TDMPlugIns/PlugInLibrary/DSPClasses", | |||
"AlturaPorts/TDMPlugIns/PlugInLibrary/EffectClasses", | |||
"AlturaPorts/TDMPlugIns/PlugInLibrary/MacBuild", | |||
"AlturaPorts/TDMPlugIns/PlugInLibrary/Meters", | |||
"AlturaPorts/TDMPlugIns/PlugInLibrary/ProcessClasses", | |||
"AlturaPorts/TDMPlugIns/PlugInLibrary/ProcessClasses/Interfaces", | |||
"AlturaPorts/TDMPlugIns/PlugInLibrary/RTASP_Adapt", | |||
"AlturaPorts/TDMPlugIns/PlugInLibrary/Utilities", | |||
"AlturaPorts/TDMPlugIns/PlugInLibrary/ViewClasses", | |||
"AlturaPorts/TDMPlugIns/DSPManager/**", | |||
"AlturaPorts/TDMPlugIns/SupplementalPlugInLib/Encryption", | |||
"AlturaPorts/TDMPlugIns/SupplementalPlugInLib/GraphicsExtensions", | |||
"AlturaPorts/TDMPlugIns/common", | |||
"AlturaPorts/TDMPlugIns/common/PI_LibInterface", | |||
"AlturaPorts/TDMPlugIns/PACEProtection/**", | |||
"AlturaPorts/TDMPlugIns/SignalProcessing/**", | |||
"AlturaPorts/OMS/Headers", | |||
"AlturaPorts/Fic/Interfaces/**", | |||
"AlturaPorts/Fic/Source/SignalNets", | |||
"AlturaPorts/DSIPublicInterface/PublicHeaders", | |||
"DAEWin/Include", | |||
"AlturaPorts/DigiPublic/Interfaces", | |||
"AlturaPorts/DigiPublic", | |||
"AlturaPorts/NewFileLibs/DOA", | |||
"AlturaPorts/NewFileLibs/Cmn", | |||
"xplat/AVX/avx2/avx2sdk/inc", | |||
"xplat/AVX/avx2/avx2sdk/utils" }; | |||
for (int i = 0; i < numElementsInArray (p); ++i) | |||
paths.add (exporter.rebaseFromProjectFolderToBuildTarget (sdkFolder.getChildFile (p[i])).toUnixStyle()); | |||
} | |||
} | |||
void createPropertyEditors (const ProjectExporter& exporter, Array <PropertyComponent*>& props) const | |||
{ | |||
if (exporter.isXcode() || exporter.isVisualStudio()) | |||
{ | |||
props.add (new TextPropertyComponent (exporter.getRTASFolder(), "RTAS Folder", 1024, false)); | |||
props.getLast()->setTooltip ("If you're building an RTAS, this must be the folder containing the RTAS SDK. This should be an absolute path."); | |||
} | |||
} | |||
void getConfigFlags (Project& project, OwnedArray<Project::ConfigFlag>& flags) | |||
{ | |||
} | |||
}; | |||
//============================================================================== | |||
Result ProjectType_ConsoleApp::createRequiredFiles (Project::Item& projectRoot, Array<File>& filesCreated) const | |||
class AULibraryModule : public LibraryModule | |||
{ | |||
return ProjectType::createRequiredFiles (projectRoot, filesCreated); | |||
} | |||
public: | |||
AULibraryModule() {} | |||
void addExtraCodeGroups (const ProjectExporter& exporter, Array<Project::Item>& groups) const | |||
{ | |||
if (exporter.isXcode()) | |||
{ | |||
Project::Item group (Project::Item::createGroup (const_cast<ProjectExporter&> (exporter).getProject(), "Juce AU Wrapper")); | |||
group.setID ("__juceaufiles"); | |||
{ | |||
const char* files[] = { JUCE_PLUGINS_PATH_AU "juce_AU_Resources.r", | |||
JUCE_PLUGINS_PATH_AU "juce_AU_Wrapper.mm", 0 }; | |||
for (const char** f = files; *f != 0; ++f) | |||
group.addRelativeFile (exporter.getJucePathFromProjectFolder().getChildFile (*f), -1, true); | |||
} | |||
Project::Item subGroup (group.addNewSubGroup ("Apple AU Files", -1)); | |||
subGroup.setID ("__juceappleaufiles"); | |||
{ | |||
#define JUCE_AU_PUBLICUTILITY "${DEVELOPER_DIR}/Extras/CoreAudio/PublicUtility/" | |||
#define JUCE_AU_PUBLIC "${DEVELOPER_DIR}/Extras/CoreAudio/AudioUnits/AUPublic/" | |||
const char* appleAUFiles[] = { JUCE_AU_PUBLICUTILITY "CADebugMacros.h", | |||
JUCE_AU_PUBLICUTILITY "CAAUParameter.cpp", | |||
JUCE_AU_PUBLICUTILITY "CAAUParameter.h", | |||
JUCE_AU_PUBLICUTILITY "CAAudioChannelLayout.cpp", | |||
JUCE_AU_PUBLICUTILITY "CAAudioChannelLayout.h", | |||
JUCE_AU_PUBLICUTILITY "CAMutex.cpp", | |||
JUCE_AU_PUBLICUTILITY "CAMutex.h", | |||
JUCE_AU_PUBLICUTILITY "CAStreamBasicDescription.cpp", | |||
JUCE_AU_PUBLICUTILITY "CAStreamBasicDescription.h", | |||
JUCE_AU_PUBLICUTILITY "CAVectorUnitTypes.h", | |||
JUCE_AU_PUBLICUTILITY "CAVectorUnit.cpp", | |||
JUCE_AU_PUBLICUTILITY "CAVectorUnit.h", | |||
JUCE_AU_PUBLIC "AUViewBase/AUViewLocalizedStringKeys.h", | |||
JUCE_AU_PUBLIC "AUCarbonViewBase/AUCarbonViewDispatch.cpp", | |||
JUCE_AU_PUBLIC "AUCarbonViewBase/AUCarbonViewControl.cpp", | |||
JUCE_AU_PUBLIC "AUCarbonViewBase/AUCarbonViewControl.h", | |||
JUCE_AU_PUBLIC "AUCarbonViewBase/CarbonEventHandler.cpp", | |||
JUCE_AU_PUBLIC "AUCarbonViewBase/CarbonEventHandler.h", | |||
JUCE_AU_PUBLIC "AUCarbonViewBase/AUCarbonViewBase.cpp", | |||
JUCE_AU_PUBLIC "AUCarbonViewBase/AUCarbonViewBase.h", | |||
JUCE_AU_PUBLIC "AUBase/AUBase.cpp", | |||
JUCE_AU_PUBLIC "AUBase/AUBase.h", | |||
JUCE_AU_PUBLIC "AUBase/AUDispatch.cpp", | |||
JUCE_AU_PUBLIC "AUBase/AUDispatch.h", | |||
JUCE_AU_PUBLIC "AUBase/AUInputElement.cpp", | |||
JUCE_AU_PUBLIC "AUBase/AUInputElement.h", | |||
JUCE_AU_PUBLIC "AUBase/AUOutputElement.cpp", | |||
JUCE_AU_PUBLIC "AUBase/AUOutputElement.h", | |||
JUCE_AU_PUBLIC "AUBase/AUResources.r", | |||
JUCE_AU_PUBLIC "AUBase/AUScopeElement.cpp", | |||
JUCE_AU_PUBLIC "AUBase/AUScopeElement.h", | |||
JUCE_AU_PUBLIC "AUBase/ComponentBase.cpp", | |||
JUCE_AU_PUBLIC "AUBase/ComponentBase.h", | |||
JUCE_AU_PUBLIC "OtherBases/AUMIDIBase.cpp", | |||
JUCE_AU_PUBLIC "OtherBases/AUMIDIBase.h", | |||
JUCE_AU_PUBLIC "OtherBases/AUMIDIEffectBase.cpp", | |||
JUCE_AU_PUBLIC "OtherBases/AUMIDIEffectBase.h", | |||
JUCE_AU_PUBLIC "OtherBases/AUOutputBase.cpp", | |||
JUCE_AU_PUBLIC "OtherBases/AUOutputBase.h", | |||
JUCE_AU_PUBLIC "OtherBases/MusicDeviceBase.cpp", | |||
JUCE_AU_PUBLIC "OtherBases/MusicDeviceBase.h", | |||
JUCE_AU_PUBLIC "OtherBases/AUEffectBase.cpp", | |||
JUCE_AU_PUBLIC "OtherBases/AUEffectBase.h", | |||
JUCE_AU_PUBLIC "Utility/AUBuffer.cpp", | |||
JUCE_AU_PUBLIC "Utility/AUBuffer.h", | |||
JUCE_AU_PUBLIC "Utility/AUDebugDispatcher.cpp", | |||
JUCE_AU_PUBLIC "Utility/AUDebugDispatcher.h", | |||
JUCE_AU_PUBLIC "Utility/AUInputFormatConverter.h", | |||
JUCE_AU_PUBLIC "Utility/AUSilentTimeout.h", | |||
JUCE_AU_PUBLIC "Utility/AUTimestampGenerator.h", 0 }; | |||
for (const char** f = appleAUFiles; *f != 0; ++f) | |||
{ | |||
const RelativePath file (*f, RelativePath::projectFolder); | |||
subGroup.addRelativeFile (file, -1, file.hasFileExtension ("cpp;mm")); | |||
subGroup.getChild (subGroup.getNumChildren() - 1).getShouldInhibitWarningsValue() = true; | |||
} | |||
} | |||
groups.add (group); | |||
} | |||
} | |||
void addExtraSearchPaths (const ProjectExporter& exporter, StringArray& paths) const | |||
{ | |||
if (exporter.isXcode()) | |||
{ | |||
paths.add ("$(DEVELOPER_DIR)/Extras/CoreAudio/PublicUtility"); | |||
paths.add ("$(DEVELOPER_DIR)/Extras/CoreAudio/AudioUnits/AUPublic/Utility"); | |||
} | |||
} | |||
void createPropertyEditors (const ProjectExporter& exporter, Array <PropertyComponent*>& props) const | |||
{ | |||
} | |||
void getConfigFlags (Project& project, OwnedArray<Project::ConfigFlag>& flags) | |||
{ | |||
} | |||
}; | |||
//============================================================================== | |||
Result ProjectType_StaticLibrary::createRequiredFiles (Project::Item& projectRoot, Array<File>& filesCreated) const | |||
//============================================================================== | |||
ProjectType::ProjectType (const String& type_, const String& desc_) | |||
: type (type_), desc (desc_) | |||
{ | |||
return ProjectType::createRequiredFiles (projectRoot, filesCreated); | |||
getAllTypes().add (this); | |||
} | |||
//============================================================================== | |||
Result ProjectType_AudioPlugin::createRequiredFiles (Project::Item& projectRoot, Array<File>& filesCreated) const | |||
ProjectType::~ProjectType() | |||
{ | |||
return ProjectType::createRequiredFiles (projectRoot, filesCreated); | |||
getAllTypes().removeValue (this); | |||
} | |||
void ProjectType_AudioPlugin::createPropertyEditors (const ProjectExporter& exporter, Array <PropertyComponent*>& props) const | |||
Array<ProjectType*>& ProjectType::getAllTypes() | |||
{ | |||
if (exporter.isVST()) | |||
createVSTPathEditor (exporter, props); | |||
static Array<ProjectType*> types; | |||
return types; | |||
} | |||
const ProjectType* ProjectType::findType (const String& typeCode) | |||
{ | |||
const Array<ProjectType*>& types = getAllTypes(); | |||
if (exporter.isRTAS()) | |||
for (int i = types.size(); --i >= 0;) | |||
if (types.getUnchecked(i)->getType() == typeCode) | |||
return types.getUnchecked(i); | |||
jassertfalse; | |||
return nullptr; | |||
} | |||
void ProjectType::createRequiredModules (Project& project, OwnedArray<LibraryModule>& modules) const | |||
{ | |||
modules.add (new JuceLibraryModule()); | |||
} | |||
//============================================================================== | |||
class ProjectType_GUIApp : public ProjectType | |||
{ | |||
public: | |||
ProjectType_GUIApp() : ProjectType (getTypeName(), "Application (GUI)") {} | |||
static const char* getTypeName() noexcept { return "guiapp"; } | |||
bool isGUIApplication() const { return true; } | |||
void createRequiredModules (Project& project, OwnedArray<LibraryModule>& modules) const | |||
{ | |||
props.add (new TextPropertyComponent (exporter.getRTASFolder(), "RTAS Folder", 1024, false)); | |||
props.getLast()->setTooltip ("If you're building an RTAS, this must be the folder containing the RTAS SDK. This should be an absolute path."); | |||
ProjectType::createRequiredModules (project, modules); | |||
} | |||
} | |||
}; | |||
void ProjectType_AudioPlugin::addExtraSearchPaths (const ProjectExporter& exporter, StringArray& searchPaths) const | |||
//============================================================================== | |||
class ProjectType_ConsoleApp : public ProjectType | |||
{ | |||
const Project& project = exporter.getProject(); | |||
RelativePath juceWrapperFolder (project.getWrapperFolder(), exporter.getTargetFolder(), RelativePath::buildTargetFolder); | |||
public: | |||
ProjectType_ConsoleApp() : ProjectType (getTypeName(), "Application (Non-GUI)") {} | |||
if (exporter.isVST()) | |||
addVSTFolderToPath (exporter, searchPaths); | |||
static const char* getTypeName() noexcept { return "consoleapp"; } | |||
bool isCommandLineApp() const { return true; } | |||
void createRequiredModules (Project& project, OwnedArray<LibraryModule>& modules) const | |||
{ | |||
ProjectType::createRequiredModules (project, modules); | |||
} | |||
}; | |||
//============================================================================== | |||
class ProjectType_Library : public ProjectType | |||
{ | |||
public: | |||
ProjectType_Library() : ProjectType (getTypeName(), "Static Library") {} | |||
if (exporter.isVisualStudio()) | |||
searchPaths.add (juceWrapperFolder.toWindowsStyle()); | |||
else if (exporter.isLinux() && exporter.isVST()) | |||
searchPaths.insert (0, juceWrapperFolder.toUnixStyle()); | |||
static const char* getTypeName() noexcept { return "library"; } | |||
bool isLibrary() const { return true; } | |||
if (exporter.isAU() && exporter.isXcode()) | |||
void createRequiredModules (Project& project, OwnedArray<LibraryModule>& modules) const | |||
{ | |||
searchPaths.add ("$(DEVELOPER_DIR)/Extras/CoreAudio/PublicUtility"); | |||
searchPaths.add ("$(DEVELOPER_DIR)/Extras/CoreAudio/AudioUnits/AUPublic/Utility"); | |||
ProjectType::createRequiredModules (project, modules); | |||
} | |||
}; | |||
//============================================================================== | |||
class ProjectType_AudioPlugin : public ProjectType | |||
{ | |||
public: | |||
ProjectType_AudioPlugin() : ProjectType (getTypeName(), "Audio Plug-in") {} | |||
static const char* getTypeName() noexcept { return "audioplug"; } | |||
bool isAudioPlugin() const { return true; } | |||
if (exporter.isRTAS()) | |||
void createRequiredModules (Project& project, OwnedArray<LibraryModule>& modules) const | |||
{ | |||
RelativePath sdkFolder (exporter.getRTASFolder().toString(), RelativePath::projectFolder); | |||
ProjectType::createRequiredModules (project, modules); | |||
if (exporter.isVisualStudio()) | |||
{ | |||
const char* paths[] = { "AlturaPorts/TDMPlugins/PluginLibrary/EffectClasses", | |||
"AlturaPorts/TDMPlugins/PluginLibrary/ProcessClasses", | |||
"AlturaPorts/TDMPlugins/PluginLibrary/ProcessClasses/Interfaces", | |||
"AlturaPorts/TDMPlugins/PluginLibrary/Utilities", | |||
"AlturaPorts/TDMPlugins/PluginLibrary/RTASP_Adapt", | |||
"AlturaPorts/TDMPlugins/PluginLibrary/CoreClasses", | |||
"AlturaPorts/TDMPlugins/PluginLibrary/Controls", | |||
"AlturaPorts/TDMPlugins/PluginLibrary/Meters", | |||
"AlturaPorts/TDMPlugins/PluginLibrary/ViewClasses", | |||
"AlturaPorts/TDMPlugins/PluginLibrary/DSPClasses", | |||
"AlturaPorts/TDMPlugins/PluginLibrary/Interfaces", | |||
"AlturaPorts/TDMPlugins/common", | |||
"AlturaPorts/TDMPlugins/common/Platform", | |||
"AlturaPorts/TDMPlugins/SignalProcessing/Public", | |||
"AlturaPorts/TDMPlugIns/DSPManager/Interfaces", | |||
"AlturaPorts/SADriver/Interfaces", | |||
"AlturaPorts/DigiPublic/Interfaces", | |||
"AlturaPorts/Fic/Interfaces/DAEClient", | |||
"AlturaPorts/NewFileLibs/Cmn", | |||
"AlturaPorts/NewFileLibs/DOA", | |||
"AlturaPorts/AlturaSource/PPC_H", | |||
"AlturaPorts/AlturaSource/AppSupport", | |||
"AvidCode/AVX2sdk/AVX/avx2/avx2sdk/inc", | |||
"xplat/AVX/avx2/avx2sdk/inc" }; | |||
for (int i = 0; i < numElementsInArray (paths); ++i) | |||
searchPaths.add (exporter.rebaseFromProjectFolderToBuildTarget (sdkFolder.getChildFile (paths[i])).toWindowsStyle()); | |||
} | |||
else if (exporter.isXcode()) | |||
{ | |||
searchPaths.add ("/Developer/Headers/FlatCarbon"); | |||
const char* paths[] = { "AlturaPorts/TDMPlugIns/PlugInLibrary/Controls", | |||
"AlturaPorts/TDMPlugIns/PlugInLibrary/CoreClasses", | |||
"AlturaPorts/TDMPlugIns/PlugInLibrary/DSPClasses", | |||
"AlturaPorts/TDMPlugIns/PlugInLibrary/EffectClasses", | |||
"AlturaPorts/TDMPlugIns/PlugInLibrary/MacBuild", | |||
"AlturaPorts/TDMPlugIns/PlugInLibrary/Meters", | |||
"AlturaPorts/TDMPlugIns/PlugInLibrary/ProcessClasses", | |||
"AlturaPorts/TDMPlugIns/PlugInLibrary/ProcessClasses/Interfaces", | |||
"AlturaPorts/TDMPlugIns/PlugInLibrary/RTASP_Adapt", | |||
"AlturaPorts/TDMPlugIns/PlugInLibrary/Utilities", | |||
"AlturaPorts/TDMPlugIns/PlugInLibrary/ViewClasses", | |||
"AlturaPorts/TDMPlugIns/DSPManager/**", | |||
"AlturaPorts/TDMPlugIns/SupplementalPlugInLib/Encryption", | |||
"AlturaPorts/TDMPlugIns/SupplementalPlugInLib/GraphicsExtensions", | |||
"AlturaPorts/TDMPlugIns/common", | |||
"AlturaPorts/TDMPlugIns/common/PI_LibInterface", | |||
"AlturaPorts/TDMPlugIns/PACEProtection/**", | |||
"AlturaPorts/TDMPlugIns/SignalProcessing/**", | |||
"AlturaPorts/OMS/Headers", | |||
"AlturaPorts/Fic/Interfaces/**", | |||
"AlturaPorts/Fic/Source/SignalNets", | |||
"AlturaPorts/DSIPublicInterface/PublicHeaders", | |||
"DAEWin/Include", | |||
"AlturaPorts/DigiPublic/Interfaces", | |||
"AlturaPorts/DigiPublic", | |||
"AlturaPorts/NewFileLibs/DOA", | |||
"AlturaPorts/NewFileLibs/Cmn", | |||
"xplat/AVX/avx2/avx2sdk/inc", | |||
"xplat/AVX/avx2/avx2sdk/utils" }; | |||
for (int i = 0; i < numElementsInArray (paths); ++i) | |||
searchPaths.add (exporter.rebaseFromProjectFolderToBuildTarget (sdkFolder.getChildFile (paths[i])).toUnixStyle()); | |||
} | |||
if (project.shouldBuildVST().getValue()) | |||
modules.add (new VSTLibraryModule()); | |||
if (project.shouldBuildRTAS().getValue()) | |||
modules.add (new RTASLibraryModule()); | |||
if (project.shouldBuildAU().getValue()) | |||
modules.add (new AULibraryModule()); | |||
} | |||
} | |||
}; | |||
//============================================================================== | |||
static ProjectType_GUIApp guiType; | |||
static ProjectType_ConsoleApp consoleType; | |||
static ProjectType_Library staticLibType; | |||
static ProjectType_AudioPlugin audioPluginType; | |||
//============================================================================== | |||
const char* ProjectType::getGUIAppTypeName() { return ProjectType_GUIApp::getTypeName(); } | |||
const char* ProjectType::getConsoleAppTypeName() { return ProjectType_ConsoleApp::getTypeName(); } | |||
const char* ProjectType::getAudioPluginTypeName() { return ProjectType_AudioPlugin::getTypeName(); } |
@@ -30,6 +30,19 @@ | |||
#include "jucer_Project.h" | |||
class ProjectExporter; | |||
//============================================================================== | |||
class LibraryModule | |||
{ | |||
public: | |||
LibraryModule(); | |||
virtual ~LibraryModule() {} | |||
virtual void addExtraCodeGroups (const ProjectExporter& exporter, Array<Project::Item>& groups) const = 0; | |||
virtual void addExtraSearchPaths (const ProjectExporter& exporter, StringArray& paths) const = 0; | |||
virtual void createPropertyEditors (const ProjectExporter& exporter, Array <PropertyComponent*>& props) const = 0; | |||
virtual void getConfigFlags (Project& project, OwnedArray<Project::ConfigFlag>& flags) = 0; | |||
}; | |||
//============================================================================== | |||
class ProjectType | |||
@@ -52,9 +65,11 @@ public: | |||
virtual bool isAudioPlugin() const { return false; } | |||
virtual bool isBrowserPlugin() const { return false; } | |||
virtual Result createRequiredFiles (Project::Item& projectRoot, Array<File>& filesCreated) const; | |||
virtual void addExtraSearchPaths (const ProjectExporter& exporter, StringArray& paths) const; | |||
virtual void createPropertyEditors (const ProjectExporter& exporter, Array <PropertyComponent*>& props) const; | |||
static const char* getGUIAppTypeName(); | |||
static const char* getConsoleAppTypeName(); | |||
static const char* getAudioPluginTypeName(); | |||
virtual void createRequiredModules (Project& project, OwnedArray<LibraryModule>& modules) const; | |||
protected: | |||
ProjectType (const String& type, const String& desc); | |||
@@ -65,51 +80,5 @@ private: | |||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ProjectType); | |||
}; | |||
//============================================================================== | |||
class ProjectType_GUIApp : public ProjectType | |||
{ | |||
public: | |||
static const char* getTypeName() noexcept { return "guiapp"; } | |||
ProjectType_GUIApp() : ProjectType (getTypeName(), "Application (GUI)") {} | |||
bool isGUIApplication() const { return true; } | |||
Result createRequiredFiles (Project::Item& projectRoot, Array<File>& filesCreated) const; | |||
}; | |||
//============================================================================== | |||
class ProjectType_ConsoleApp : public ProjectType | |||
{ | |||
public: | |||
static const char* getTypeName() noexcept { return "consoleapp"; } | |||
ProjectType_ConsoleApp() : ProjectType (getTypeName(), "Application (Non-GUI)") {} | |||
Result createRequiredFiles (Project::Item& projectRoot, Array<File>& filesCreated) const; | |||
bool isCommandLineApp() const { return true; } | |||
}; | |||
//============================================================================== | |||
class ProjectType_StaticLibrary : public ProjectType | |||
{ | |||
public: | |||
static const char* getTypeName() noexcept { return "library"; } | |||
ProjectType_StaticLibrary() : ProjectType (getTypeName(), "Static Library") {} | |||
bool isLibrary() const { return true; } | |||
Result createRequiredFiles (Project::Item& projectRoot, Array<File>& filesCreated) const; | |||
}; | |||
//============================================================================== | |||
class ProjectType_AudioPlugin : public ProjectType | |||
{ | |||
public: | |||
static const char* getTypeName() noexcept { return "audioplug"; } | |||
ProjectType_AudioPlugin() : ProjectType (getTypeName(), "Audio Plug-in") {} | |||
bool isAudioPlugin() const { return true; } | |||
Result createRequiredFiles (Project::Item& projectRoot, Array<File>& filesCreated) const; | |||
void addExtraSearchPaths (const ProjectExporter& exporter, StringArray& paths) const; | |||
void createPropertyEditors (const ProjectExporter& exporter, Array <PropertyComponent*>& props) const; | |||
}; | |||
#endif // __JUCE_PROJECTTYPE_H_C1C6BC3E__ |
@@ -36,7 +36,7 @@ String createAlphaNumericUID() | |||
{ | |||
String uid; | |||
static const char chars[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; | |||
Random r (Random::getSystemRandom().nextInt64()); | |||
Random r; | |||
uid << chars [r.nextInt (52)]; // make sure the first character is always a letter | |||
@@ -55,7 +55,7 @@ String randomHexString (Random& random, int numChars) | |||
const char hexChars[] = "0123456789ABCDEF"; | |||
while (--numChars >= 0) | |||
s << hexChars [random.nextInt (16)]; | |||
s << hexChars [random.nextInt() & 15]; | |||
return s; | |||
} | |||
@@ -98,6 +98,7 @@ namespace Ids | |||
DECLARE_ID (buildVST); | |||
DECLARE_ID (bundleIdentifier); | |||
DECLARE_ID (compile); | |||
DECLARE_ID (noWarnings); | |||
DECLARE_ID (resource); | |||
DECLARE_ID (className); | |||
DECLARE_ID (classDesc); | |||
@@ -1,9 +1,9 @@ | |||
/* | |||
IMPORTANT! This file is auto-generated by the Jucer each time you save your | |||
IMPORTANT! This file is auto-generated each time you save your | |||
project - if you alter its contents, your changes may be overwritten! | |||
If you want to change any of these values, use the Jucer to do so, rather than | |||
If you want to change any of these values, use the Introjucer to do so, rather than | |||
editing this file directly! | |||
Any commented-out settings will fall back to using the default values that | |||
@@ -1,6 +1,6 @@ | |||
/* | |||
IMPORTANT! This file is auto-generated by the Jucer each time you save your | |||
IMPORTANT! This file is auto-generated each time you save your | |||
project - if you alter its contents, your changes may be overwritten! | |||
This is the header file that your files should include in order to get all the | |||
@@ -1,6 +1,6 @@ | |||
/* | |||
IMPORTANT! This file is auto-generated by the Jucer each time you save your | |||
IMPORTANT! This file is auto-generated each time you save your | |||
project - if you alter its contents, your changes may be overwritten! | |||
This file pulls in all the Juce source code, and builds it using the settings | |||
@@ -1,6 +1,6 @@ | |||
/* | |||
IMPORTANT! This file is auto-generated by the Jucer each time you save your | |||
IMPORTANT! This file is auto-generated each time you save your | |||
project - if you alter its contents, your changes may be overwritten! | |||
This file pulls in all the Juce source code, and builds it using the settings | |||
@@ -1,6 +1,6 @@ | |||
/* | |||
IMPORTANT! This file is auto-generated by the Jucer each time you save your | |||
IMPORTANT! This file is auto-generated each time you save your | |||
project - if you alter its contents, your changes may be overwritten! | |||
This file pulls in all the Juce source code, and builds it using the settings | |||
@@ -1,6 +1,6 @@ | |||
/* | |||
IMPORTANT! This file is auto-generated by the Jucer each time you save your | |||
IMPORTANT! This file is auto-generated each time you save your | |||
project - if you alter its contents, your changes may be overwritten! | |||
This file pulls in all the Juce source code, and builds it using the settings | |||
@@ -1,6 +1,6 @@ | |||
/* | |||
IMPORTANT! This file is auto-generated by the Jucer each time you save your | |||
IMPORTANT! This file is auto-generated each time you save your | |||
project - if you alter its contents, your changes may be overwritten! | |||
This file pulls in all the Juce source code, and builds it using the settings | |||
@@ -1,6 +1,6 @@ | |||
/* | |||
IMPORTANT! This file is auto-generated by the Jucer each time you save your | |||
IMPORTANT! This file is auto-generated each time you save your | |||
project - if you alter its contents, your changes may be overwritten! | |||
This file pulls in all the Juce source code, and builds it using the settings | |||
@@ -1,6 +1,6 @@ | |||
/* | |||
IMPORTANT! This file is auto-generated by the Jucer each time you save your | |||
IMPORTANT! This file is auto-generated each time you save your | |||
project - if you alter its contents, your changes may be overwritten! | |||
This file pulls in all the Juce source code, and builds it using the settings | |||
@@ -1,6 +1,6 @@ | |||
/* | |||
IMPORTANT! This file is auto-generated by the Jucer each time you save your | |||
IMPORTANT! This file is auto-generated each time you save your | |||
project - if you alter its contents, your changes may be overwritten! | |||
This file pulls in all the Juce source code, and builds it using the settings | |||
@@ -1,9 +1,9 @@ | |||
/* | |||
IMPORTANT! This file is auto-generated by the Jucer each time you save your | |||
IMPORTANT! This file is auto-generated each time you save your | |||
project - if you alter its contents, your changes may be overwritten! | |||
If you want to change any of these values, use the Jucer to do so, rather than | |||
If you want to change any of these values, use the Introjucer to do so, rather than | |||
editing this file directly! | |||
Any commented-out settings will fall back to using the default values that | |||
@@ -1,6 +1,6 @@ | |||
/* | |||
IMPORTANT! This file is auto-generated by the Jucer each time you save your | |||
IMPORTANT! This file is auto-generated each time you save your | |||
project - if you alter its contents, your changes may be overwritten! | |||
This is the header file that your files should include in order to get all the | |||
@@ -1,6 +1,6 @@ | |||
/* | |||
IMPORTANT! This file is auto-generated by the Jucer each time you save your | |||
IMPORTANT! This file is auto-generated each time you save your | |||
project - if you alter its contents, your changes may be overwritten! | |||
This file pulls in all the Juce source code, and builds it using the settings | |||
@@ -1,6 +1,6 @@ | |||
/* | |||
IMPORTANT! This file is auto-generated by the Jucer each time you save your | |||
IMPORTANT! This file is auto-generated each time you save your | |||
project - if you alter its contents, your changes may be overwritten! | |||
This file pulls in all the Juce source code, and builds it using the settings | |||
@@ -1,9 +1,9 @@ | |||
/* | |||
IMPORTANT! This file is auto-generated by the Jucer each time you save your | |||
IMPORTANT! This file is auto-generated each time you save your | |||
project - if you alter its contents, your changes may be overwritten! | |||
If you want to change any of these values, use the Jucer to do so, rather than | |||
If you want to change any of these values, use the Introjucer to do so, rather than | |||
editing this file directly! | |||
Any commented-out settings will fall back to using the default values that | |||
@@ -1,6 +1,6 @@ | |||
/* | |||
IMPORTANT! This file is auto-generated by the Jucer each time you save your | |||
IMPORTANT! This file is auto-generated each time you save your | |||
project - if you alter its contents, your changes may be overwritten! | |||
This is the header file that your files should include in order to get all the | |||
@@ -1,6 +1,6 @@ | |||
/* | |||
IMPORTANT! This file is auto-generated by the Jucer each time you save your | |||
IMPORTANT! This file is auto-generated each time you save your | |||
project - if you alter its contents, your changes may be overwritten! | |||
This file pulls in all the Juce source code, and builds it using the settings | |||
@@ -1,6 +1,6 @@ | |||
/* | |||
IMPORTANT! This file is auto-generated by the Jucer each time you save your | |||
IMPORTANT! This file is auto-generated each time you save your | |||
project - if you alter its contents, your changes may be overwritten! | |||
This file pulls in all the Juce source code, and builds it using the settings | |||
@@ -1,6 +1,6 @@ | |||
/* | |||
IMPORTANT! This file is auto-generated by the Jucer each time you save your | |||
IMPORTANT! This file is auto-generated each time you save your | |||
project - if you alter its contents, your changes may be overwritten! | |||
This file pulls in all the Juce source code, and builds it using the settings | |||
@@ -1,6 +1,6 @@ | |||
/* | |||
IMPORTANT! This file is auto-generated by the Jucer each time you save your | |||
IMPORTANT! This file is auto-generated each time you save your | |||
project - if you alter its contents, your changes may be overwritten! | |||
This file pulls in all the Juce source code, and builds it using the settings | |||
@@ -1,6 +1,6 @@ | |||
/* | |||
IMPORTANT! This file is auto-generated by the Jucer each time you save your | |||
IMPORTANT! This file is auto-generated each time you save your | |||
project - if you alter its contents, your changes may be overwritten! | |||
This file pulls in all the Juce source code, and builds it using the settings | |||
@@ -1,6 +1,6 @@ | |||
/* | |||
IMPORTANT! This file is auto-generated by the Jucer each time you save your | |||
IMPORTANT! This file is auto-generated each time you save your | |||
project - if you alter its contents, your changes may be overwritten! | |||
This file pulls in all the Juce source code, and builds it using the settings | |||
@@ -1,6 +1,6 @@ | |||
/* | |||
IMPORTANT! This file is auto-generated by the Jucer each time you save your | |||
IMPORTANT! This file is auto-generated each time you save your | |||
project - if you alter its contents, your changes may be overwritten! | |||
This file pulls in all the Juce source code, and builds it using the settings | |||
@@ -1,6 +1,6 @@ | |||
/* | |||
IMPORTANT! This file is auto-generated by the Jucer each time you save your | |||
IMPORTANT! This file is auto-generated each time you save your | |||
project - if you alter its contents, your changes may be overwritten! | |||
This file pulls in all the Juce source code, and builds it using the settings | |||
@@ -17,12 +17,12 @@ ifeq ($(CONFIG),Debug) | |||
LIBDIR := build | |||
OBJDIR := build/intermediate/Debug | |||
OUTDIR := build | |||
CPPFLAGS := $(DEPFLAGS) -D "LINUX=1" -D "DEBUG=1" -D "_DEBUG=1" -D "JUCER_LINUX_MAKE_7346DA2A=1" -I "../../JuceLibraryCode" -I "~/SDKs/vstsdk2.4" -I "/usr/include" -I "/usr/include/freetype2" | |||
CPPFLAGS := $(DEPFLAGS) -D "LINUX=1" -D "DEBUG=1" -D "_DEBUG=1" -D "JUCER_LINUX_MAKE_7346DA2A=1" -I "~/SDKs/vstsdk2.4" -I "/usr/include" -I "/usr/include/freetype2" -I "../../JuceLibraryCode" | |||
CFLAGS += $(CPPFLAGS) $(TARGET_ARCH) -g -ggdb -fPIC -O0 | |||
CXXFLAGS += $(CFLAGS) | |||
LDFLAGS += -L$(BINDIR) -L$(LIBDIR) -shared -L"/usr/X11R6/lib/" -L"../../../../../../juce/bin" -lfreetype -lpthread -lrt -lX11 -lGL -lGLU -lXinerama -lasound | |||
LDDEPS := | |||
RESFLAGS := -D "LINUX=1" -D "DEBUG=1" -D "_DEBUG=1" -D "JUCER_LINUX_MAKE_7346DA2A=1" -I "../../JuceLibraryCode" -I "~/SDKs/vstsdk2.4" -I "/usr/include" -I "/usr/include/freetype2" | |||
RESFLAGS := -D "LINUX=1" -D "DEBUG=1" -D "_DEBUG=1" -D "JUCER_LINUX_MAKE_7346DA2A=1" -I "~/SDKs/vstsdk2.4" -I "/usr/include" -I "/usr/include/freetype2" -I "../../JuceLibraryCode" | |||
TARGET := JuceDemoPlugin.so | |||
BLDCMD = $(CXX) -o $(OUTDIR)/$(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(TARGET_ARCH) | |||
endif | |||
@@ -32,12 +32,12 @@ ifeq ($(CONFIG),Release) | |||
LIBDIR := build | |||
OBJDIR := build/intermediate/Release | |||
OUTDIR := build | |||
CPPFLAGS := $(DEPFLAGS) -D "LINUX=1" -D "NDEBUG=1" -D "JUCER_LINUX_MAKE_7346DA2A=1" -I "../../JuceLibraryCode" -I "~/SDKs/vstsdk2.4" -I "/usr/include" -I "/usr/include/freetype2" | |||
CPPFLAGS := $(DEPFLAGS) -D "LINUX=1" -D "NDEBUG=1" -D "JUCER_LINUX_MAKE_7346DA2A=1" -I "~/SDKs/vstsdk2.4" -I "/usr/include" -I "/usr/include/freetype2" -I "../../JuceLibraryCode" | |||
CFLAGS += $(CPPFLAGS) $(TARGET_ARCH) -fPIC -Os | |||
CXXFLAGS += $(CFLAGS) | |||
LDFLAGS += -L$(BINDIR) -L$(LIBDIR) -shared -L"/usr/X11R6/lib/" -L"../../../../../../juce/bin" -lfreetype -lpthread -lrt -lX11 -lGL -lGLU -lXinerama -lasound | |||
LDDEPS := | |||
RESFLAGS := -D "LINUX=1" -D "NDEBUG=1" -D "JUCER_LINUX_MAKE_7346DA2A=1" -I "../../JuceLibraryCode" -I "~/SDKs/vstsdk2.4" -I "/usr/include" -I "/usr/include/freetype2" | |||
RESFLAGS := -D "LINUX=1" -D "NDEBUG=1" -D "JUCER_LINUX_MAKE_7346DA2A=1" -I "~/SDKs/vstsdk2.4" -I "/usr/include" -I "/usr/include/freetype2" -I "../../JuceLibraryCode" | |||
TARGET := JuceDemoPlugin.so | |||
BLDCMD = $(CXX) -o $(OUTDIR)/$(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(TARGET_ARCH) | |||
endif | |||
@@ -28,8 +28,8 @@ | |||
BD7E5458BE2F33DBBF5AF834 = { isa = PBXBuildFile; fileRef = FD33B687C6FBA3ABC581AFD7; }; | |||
3DFA294CC79D06F066723396 = { isa = PBXBuildFile; fileRef = 94A977DEE6BE2081CA0213FE; }; | |||
7C5B1DFA35A2EA8DFB2A40C9 = { isa = PBXBuildFile; fileRef = 00E2C89A148A2491288DF242; }; | |||
37A5CEF9F9B523B2580D3C1E = { isa = PBXBuildFile; fileRef = A2C6C4FD1DCE5EFAA2163E5C; }; | |||
EB107FBF3FCD101D37454F1E = { isa = PBXBuildFile; fileRef = 7BA88B94922B5480855DD012; }; | |||
6FC7ABF9C15FE51D4073E3D2 = { isa = PBXBuildFile; fileRef = 4751785A8DF8E6DA39550E63; }; | |||
CC35AB7C8D157D7211320179 = { isa = PBXBuildFile; fileRef = 3EF0D861DF9DE96DDAAE0951; }; | |||
B7D2D2868983939B35532885 = { isa = PBXBuildFile; fileRef = 6C254919C15224D13FE6D174; settings = {COMPILER_FLAGS = "-w"; }; }; | |||
3723101DD64447FE9A530323 = { isa = PBXBuildFile; fileRef = 38E2002644D5BBC2E88ACB70; settings = {COMPILER_FLAGS = "-w"; }; }; | |||
EBBDC594F4DF0EF42E017C64 = { isa = PBXBuildFile; fileRef = 616DF8861CA45D7FFE92CA35; settings = {COMPILER_FLAGS = "-w"; }; }; | |||
@@ -81,8 +81,8 @@ | |||
DF8AD10F6B21858C3378B63F = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = JucePluginCharacteristics.h; path = ../../JuceLibraryCode/JucePluginCharacteristics.h; sourceTree = "SOURCE_ROOT"; }; | |||
94A977DEE6BE2081CA0213FE = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_VST_Wrapper.cpp"; path = "../../../../../src/audio/plugin_client/VST/juce_VST_Wrapper.cpp"; sourceTree = "SOURCE_ROOT"; }; | |||
00E2C89A148A2491288DF242 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = "juce_VST_Wrapper.mm"; path = "../../../../../src/audio/plugin_client/VST/juce_VST_Wrapper.mm"; sourceTree = "SOURCE_ROOT"; }; | |||
A2C6C4FD1DCE5EFAA2163E5C = { isa = PBXFileReference; lastKnownFileType = file.r; name = "juce_AU_Resources.r"; path = "../../../../../../juce/src/audio/plugin_client/AU/juce_AU_Resources.r"; sourceTree = "SOURCE_ROOT"; }; | |||
7BA88B94922B5480855DD012 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = "juce_AU_Wrapper.mm"; path = "../../../../../../juce/src/audio/plugin_client/AU/juce_AU_Wrapper.mm"; sourceTree = "SOURCE_ROOT"; }; | |||
4751785A8DF8E6DA39550E63 = { isa = PBXFileReference; lastKnownFileType = file.r; name = "juce_AU_Resources.r"; path = "../../../../../src/audio/plugin_client/AU/juce_AU_Resources.r"; sourceTree = "SOURCE_ROOT"; }; | |||
3EF0D861DF9DE96DDAAE0951 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = "juce_AU_Wrapper.mm"; path = "../../../../../src/audio/plugin_client/AU/juce_AU_Wrapper.mm"; sourceTree = "SOURCE_ROOT"; }; | |||
70DC3C63DDDFB1C5A22A8C36 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CADebugMacros.h; path = Extras/CoreAudio/PublicUtility/CADebugMacros.h; sourceTree = "DEVELOPER_DIR"; }; | |||
6C254919C15224D13FE6D174 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = CAAUParameter.cpp; path = Extras/CoreAudio/PublicUtility/CAAUParameter.cpp; sourceTree = "DEVELOPER_DIR"; }; | |||
AEDBCF2FF9E1FBD5B9958FB4 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CAAUParameter.h; path = Extras/CoreAudio/PublicUtility/CAAUParameter.h; sourceTree = "DEVELOPER_DIR"; }; | |||
@@ -201,8 +201,8 @@ | |||
B50242715BF944E7711A5939, | |||
F2595F2DC0235F848F9474E8 ); name = "Apple AU Files"; sourceTree = "<group>"; }; | |||
5180919A8096CFD082284336 = { isa = PBXGroup; children = ( | |||
A2C6C4FD1DCE5EFAA2163E5C, | |||
7BA88B94922B5480855DD012, | |||
4751785A8DF8E6DA39550E63, | |||
3EF0D861DF9DE96DDAAE0951, | |||
17A9711DC035377B969B90C2 ); name = "Juce AU Wrapper"; sourceTree = "<group>"; }; | |||
7756687B5FD0903C5F83BB9E = { isa = PBXGroup; children = ( | |||
81567EBA449466A95492511B ); name = Resources; sourceTree = "<group>"; }; | |||
@@ -309,7 +309,7 @@ | |||
F4B05B483343A2F3C923C6B4 ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Debug; }; | |||
145D936BBD5425D74172B206 = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; | |||
A79C4026C596A99BB0ADC224 = { isa = PBXRezBuildPhase; buildActionMask = 2147483647; files = ( | |||
37A5CEF9F9B523B2580D3C1E ); runOnlyForDeploymentPostprocessing = 0; }; | |||
6FC7ABF9C15FE51D4073E3D2 ); runOnlyForDeploymentPostprocessing = 0; }; | |||
F0F39FCA8C402F34BB74F6B3 = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( | |||
5AF66C048A4815F5A8ECDDCD, | |||
209FB8C7F7BE85A70E5D98D7, | |||
@@ -319,7 +319,7 @@ | |||
BD7E5458BE2F33DBBF5AF834, | |||
3DFA294CC79D06F066723396, | |||
7C5B1DFA35A2EA8DFB2A40C9, | |||
EB107FBF3FCD101D37454F1E, | |||
CC35AB7C8D157D7211320179, | |||
B7D2D2868983939B35532885, | |||
3723101DD64447FE9A530323, | |||
EBBDC594F4DF0EF42E017C64, | |||
@@ -1,9 +1,9 @@ | |||
/* | |||
IMPORTANT! This file is auto-generated by the Jucer each time you save your | |||
IMPORTANT! This file is auto-generated each time you save your | |||
project - if you alter its contents, your changes may be overwritten! | |||
If you want to change any of these values, use the Jucer to do so, rather than | |||
If you want to change any of these values, use the Introjucer to do so, rather than | |||
editing this file directly! | |||
Any commented-out settings will fall back to using the default values that | |||
@@ -1,6 +1,6 @@ | |||
/* | |||
IMPORTANT! This file is auto-generated by the Jucer each time you save your | |||
IMPORTANT! This file is auto-generated each time you save your | |||
project - if you alter its contents, your changes may be overwritten! | |||
This is the header file that your files should include in order to get all the | |||
@@ -1,6 +1,6 @@ | |||
/* | |||
IMPORTANT! This file is auto-generated by the Jucer each time you save your | |||
IMPORTANT! This file is auto-generated each time you save your | |||
project - if you alter its contents, your changes may be overwritten! | |||
This file pulls in all the Juce source code, and builds it using the settings | |||
@@ -1,6 +1,6 @@ | |||
/* | |||
IMPORTANT! This file is auto-generated by the Jucer each time you save your | |||
IMPORTANT! This file is auto-generated each time you save your | |||
project - if you alter its contents, your changes may be overwritten! | |||
This file pulls in all the Juce source code, and builds it using the settings | |||
@@ -1,6 +1,6 @@ | |||
/* | |||
IMPORTANT! This file is auto-generated by the Jucer each time you save your | |||
IMPORTANT! This file is auto-generated each time you save your | |||
project - if you alter its contents, your changes may be overwritten! | |||
This file pulls in all the Juce source code, and builds it using the settings | |||
@@ -1,6 +1,6 @@ | |||
/* | |||
IMPORTANT! This file is auto-generated by the Jucer each time you save your | |||
IMPORTANT! This file is auto-generated each time you save your | |||
project - if you alter its contents, your changes may be overwritten! | |||
This file pulls in all the Juce source code, and builds it using the settings | |||
@@ -1,6 +1,6 @@ | |||
/* | |||
IMPORTANT! This file is auto-generated by the Jucer each time you save your | |||
IMPORTANT! This file is auto-generated each time you save your | |||
project - if you alter its contents, your changes may be overwritten! | |||
This file pulls in all the Juce source code, and builds it using the settings | |||
@@ -1,6 +1,6 @@ | |||
/* | |||
IMPORTANT! This file is auto-generated by the Jucer each time you save your | |||
IMPORTANT! This file is auto-generated each time you save your | |||
project - if you alter its contents, your changes may be overwritten! | |||
This file pulls in all the Juce source code, and builds it using the settings | |||
@@ -1,6 +1,6 @@ | |||
/* | |||
IMPORTANT! This file is auto-generated by the Jucer each time you save your | |||
IMPORTANT! This file is auto-generated each time you save your | |||
project - if you alter its contents, your changes may be overwritten! | |||
This file pulls in all the Juce source code, and builds it using the settings | |||
@@ -1,6 +1,6 @@ | |||
/* | |||
IMPORTANT! This file is auto-generated by the Jucer each time you save your | |||
IMPORTANT! This file is auto-generated each time you save your | |||
project - if you alter its contents, your changes may be overwritten! | |||
This file pulls in all the Juce source code, and builds it using the settings | |||
@@ -1,6 +1,6 @@ | |||
/* | |||
IMPORTANT! This file is auto-generated by the Jucer each time you save your | |||
IMPORTANT! This file is auto-generated each time you save your | |||
project - if you alter its contents, your changes may be overwritten! | |||
This header file contains configuration options for the plug-in. If you need to change any of | |||
@@ -1,9 +1,9 @@ | |||
/* | |||
IMPORTANT! This file is auto-generated by the Jucer each time you save your | |||
IMPORTANT! This file is auto-generated each time you save your | |||
project - if you alter its contents, your changes may be overwritten! | |||
If you want to change any of these values, use the Jucer to do so, rather than | |||
If you want to change any of these values, use the Introjucer to do so, rather than | |||
editing this file directly! | |||
Any commented-out settings will fall back to using the default values that | |||
@@ -1,6 +1,6 @@ | |||
/* | |||
IMPORTANT! This file is auto-generated by the Jucer each time you save your | |||
IMPORTANT! This file is auto-generated each time you save your | |||
project - if you alter its contents, your changes may be overwritten! | |||
This is the header file that your files should include in order to get all the | |||
@@ -1,6 +1,6 @@ | |||
/* | |||
IMPORTANT! This file is auto-generated by the Jucer each time you save your | |||
IMPORTANT! This file is auto-generated each time you save your | |||
project - if you alter its contents, your changes may be overwritten! | |||
This file pulls in all the Juce source code, and builds it using the settings | |||
@@ -1,6 +1,6 @@ | |||
/* | |||
IMPORTANT! This file is auto-generated by the Jucer each time you save your | |||
IMPORTANT! This file is auto-generated each time you save your | |||
project - if you alter its contents, your changes may be overwritten! | |||
This file pulls in all the Juce source code, and builds it using the settings | |||
@@ -1,9 +1,9 @@ | |||
/* | |||
IMPORTANT! This file is auto-generated by the Jucer each time you save your | |||
IMPORTANT! This file is auto-generated each time you save your | |||
project - if you alter its contents, your changes may be overwritten! | |||
If you want to change any of these values, use the Jucer to do so, rather than | |||
If you want to change any of these values, use the Introjucer to do so, rather than | |||
editing this file directly! | |||
Any commented-out settings will fall back to using the default values that | |||
@@ -1,6 +1,6 @@ | |||
/* | |||
IMPORTANT! This file is auto-generated by the Jucer each time you save your | |||
IMPORTANT! This file is auto-generated each time you save your | |||
project - if you alter its contents, your changes may be overwritten! | |||
This is the header file that your files should include in order to get all the | |||
@@ -1,6 +1,6 @@ | |||
/* | |||
IMPORTANT! This file is auto-generated by the Jucer each time you save your | |||
IMPORTANT! This file is auto-generated each time you save your | |||
project - if you alter its contents, your changes may be overwritten! | |||
This file pulls in all the Juce source code, and builds it using the settings | |||
@@ -1,6 +1,6 @@ | |||
/* | |||
IMPORTANT! This file is auto-generated by the Jucer each time you save your | |||
IMPORTANT! This file is auto-generated each time you save your | |||
project - if you alter its contents, your changes may be overwritten! | |||
This file pulls in all the Juce source code, and builds it using the settings | |||
@@ -1,6 +1,6 @@ | |||
/* | |||
IMPORTANT! This file is auto-generated by the Jucer each time you save your | |||
IMPORTANT! This file is auto-generated each time you save your | |||
project - if you alter its contents, your changes may be overwritten! | |||
This file pulls in all the Juce source code, and builds it using the settings | |||
@@ -1,6 +1,6 @@ | |||
/* | |||
IMPORTANT! This file is auto-generated by the Jucer each time you save your | |||
IMPORTANT! This file is auto-generated each time you save your | |||
project - if you alter its contents, your changes may be overwritten! | |||
This file pulls in all the Juce source code, and builds it using the settings | |||
@@ -1,6 +1,6 @@ | |||
/* | |||
IMPORTANT! This file is auto-generated by the Jucer each time you save your | |||
IMPORTANT! This file is auto-generated each time you save your | |||
project - if you alter its contents, your changes may be overwritten! | |||
This file pulls in all the Juce source code, and builds it using the settings | |||
@@ -1,6 +1,6 @@ | |||
/* | |||
IMPORTANT! This file is auto-generated by the Jucer each time you save your | |||
IMPORTANT! This file is auto-generated each time you save your | |||
project - if you alter its contents, your changes may be overwritten! | |||
This file pulls in all the Juce source code, and builds it using the settings | |||
@@ -1,6 +1,6 @@ | |||
/* | |||
IMPORTANT! This file is auto-generated by the Jucer each time you save your | |||
IMPORTANT! This file is auto-generated each time you save your | |||
project - if you alter its contents, your changes may be overwritten! | |||
This file pulls in all the Juce source code, and builds it using the settings | |||
@@ -1,6 +1,6 @@ | |||
/* | |||
IMPORTANT! This file is auto-generated by the Jucer each time you save your | |||
IMPORTANT! This file is auto-generated each time you save your | |||
project - if you alter its contents, your changes may be overwritten! | |||
This file pulls in all the Juce source code, and builds it using the settings | |||
@@ -1513,11 +1513,14 @@ void Random::combineSeed (const int64 seedValue) noexcept | |||
void Random::setSeedRandomly() | |||
{ | |||
combineSeed ((int64) (pointer_sized_int) this); | |||
static int64 globalSeed = 0; | |||
combineSeed (globalSeed ^ (int64) (pointer_sized_int) this); | |||
combineSeed (Time::getMillisecondCounter()); | |||
combineSeed (Time::getHighResolutionTicks()); | |||
combineSeed (Time::getHighResolutionTicksPerSecond()); | |||
combineSeed (Time::currentTimeMillis()); | |||
globalSeed ^= seed; | |||
} | |||
Random& Random::getSystemRandom() noexcept | |||
@@ -1536,7 +1539,7 @@ int Random::nextInt() noexcept | |||
int Random::nextInt (const int maxValue) noexcept | |||
{ | |||
jassert (maxValue > 0); | |||
return (nextInt() & 0x7fffffff) % maxValue; | |||
return (((unsigned int) nextInt()) * (uint64) maxValue) >> 32; | |||
} | |||
int64 Random::nextInt64() noexcept | |||
@@ -2444,10 +2447,11 @@ public: | |||
void run() | |||
{ | |||
int n = 0; | |||
Random r; | |||
while (! threadShouldExit()) | |||
{ | |||
int num = Random::getSystemRandom().nextInt (2000) + 1; | |||
int num = r.nextInt (2000) + 1; | |||
int start1, size1, start2, size2; | |||
fifo.prepareToWrite (num, start1, size1, start2, size2); | |||
@@ -2482,10 +2486,11 @@ public: | |||
WriteThread writer (fifo, buffer); | |||
int n = 0; | |||
Random r; | |||
for (int count = 1000000; --count >= 0;) | |||
{ | |||
int num = Random::getSystemRandom().nextInt (6000) + 1; | |||
int num = r.nextInt (6000) + 1; | |||
int start1, size1, start2, size2; | |||
fifo.prepareToRead (num, start1, size1, start2, size2); | |||
@@ -6747,14 +6752,14 @@ BigInteger Primes::createProbablePrime (const int bitLength, | |||
{ | |||
randomSeeds = defaultSeeds; | |||
numRandomSeeds = numElementsInArray (defaultSeeds); | |||
Random r; | |||
Random r1, r2; | |||
for (int j = 10; --j >= 0;) | |||
{ | |||
r.setSeedRandomly(); | |||
r1.setSeedRandomly(); | |||
for (int i = numRandomSeeds; --i >= 0;) | |||
defaultSeeds[i] ^= r.nextInt() ^ Random::getSystemRandom().nextInt(); | |||
defaultSeeds[i] ^= r1.nextInt() ^ r2.nextInt(); | |||
} | |||
} | |||
@@ -8393,7 +8398,7 @@ String File::getRelativePathFrom (const File& dir) const | |||
File File::createTempFile (const String& fileNameEnding) | |||
{ | |||
const File tempFile (getSpecialLocation (tempDirectory) | |||
.getChildFile ("temp_" + String (Random::getSystemRandom().nextInt())) | |||
.getChildFile ("temp_" + String::toHexString (Random::getSystemRandom().nextInt())) | |||
.withFileExtension (fileNameEnding)); | |||
if (tempFile.exists()) | |||
@@ -8962,7 +8967,7 @@ BEGIN_JUCE_NAMESPACE | |||
TemporaryFile::TemporaryFile (const String& suffix, const int optionFlags) | |||
{ | |||
createTempFile (File::getSpecialLocation (File::tempDirectory), | |||
"temp_" + String (Random::getSystemRandom().nextInt()), | |||
"temp_" + String::toHexString (Random::getSystemRandom().nextInt()), | |||
suffix, | |||
optionFlags); | |||
} | |||
@@ -8974,7 +8979,8 @@ TemporaryFile::TemporaryFile (const File& targetFile_, const int optionFlags) | |||
jassert (targetFile != File::nonexistent); | |||
createTempFile (targetFile.getParentDirectory(), | |||
targetFile.getFileNameWithoutExtension() + "_temp" + String (Random::getSystemRandom().nextInt()), | |||
targetFile.getFileNameWithoutExtension() | |||
+ "_temp" + String::toHexString (Random::getSystemRandom().nextInt()), | |||
targetFile.getFileExtension(), | |||
optionFlags); | |||
} | |||
@@ -10396,10 +10402,11 @@ public: | |||
void runTest() | |||
{ | |||
beginTest ("Basics"); | |||
Random r; | |||
int randomInt = Random::getSystemRandom().nextInt(); | |||
int64 randomInt64 = Random::getSystemRandom().nextInt64(); | |||
double randomDouble = Random::getSystemRandom().nextDouble(); | |||
int randomInt = r.nextInt(); | |||
int64 randomInt64 = r.nextInt64(); | |||
double randomDouble = r.nextDouble(); | |||
String randomString (createRandomWideCharString()); | |||
MemoryOutputStream mo; | |||
@@ -10429,16 +10436,16 @@ public: | |||
for (int i = 0; i < numElementsInArray (buffer) - 1; ++i) | |||
{ | |||
if (Random::getSystemRandom().nextBool()) | |||
if (r.nextBool()) | |||
{ | |||
do | |||
{ | |||
buffer[i] = (juce_wchar) (1 + Random::getSystemRandom().nextInt (0x10ffff - 1)); | |||
buffer[i] = (juce_wchar) (1 + r.nextInt (0x10ffff - 1)); | |||
} | |||
while (! CharPointer_UTF16::canRepresent (buffer[i])); | |||
} | |||
else | |||
buffer[i] = (juce_wchar) (1 + Random::getSystemRandom().nextInt (0xff)); | |||
buffer[i] = (juce_wchar) (1 + r.nextInt (0xff)); | |||
} | |||
return CharPointer_UTF32 (buffer); | |||
@@ -10742,40 +10749,35 @@ END_JUCE_NAMESPACE | |||
/*** Start of inlined file: juce_Uuid.cpp ***/ | |||
BEGIN_JUCE_NAMESPACE | |||
Uuid::Uuid() | |||
namespace | |||
{ | |||
// Mix up any available MAC addresses with some time-based pseudo-random numbers | |||
// to make it very very unlikely that two UUIDs will ever be the same.. | |||
static int64 macAddresses[2]; | |||
static bool hasCheckedMacAddresses = false; | |||
if (! hasCheckedMacAddresses) | |||
int64 getRandomSeedFromMACAddresses() | |||
{ | |||
hasCheckedMacAddresses = true; | |||
Array<MACAddress> result; | |||
MACAddress::findAllAddresses (result); | |||
for (int i = 0; i < numElementsInArray (macAddresses); ++i) | |||
macAddresses[i] = result[i].toInt64(); | |||
Random r; | |||
for (int i = 0; i < result.size(); ++i) | |||
r.combineSeed (result[i].toInt64()); | |||
return r.nextInt64(); | |||
} | |||
} | |||
Uuid::Uuid() | |||
{ | |||
// The normal random seeding is pretty good, but we'll throw some MAC addresses | |||
// into the mix too, to make it very very unlikely that two UUIDs will ever be the same.. | |||
value.asInt64[0] = macAddresses[0]; | |||
value.asInt64[1] = macAddresses[1]; | |||
static Random r1 (getRandomSeedFromMACAddresses()); | |||
// We'll use both a local RNG that is re-seeded, plus the shared RNG, | |||
// whose seed will carry over between calls to this method. | |||
value.asInt64[0] = r1.nextInt64(); | |||
value.asInt64[1] = r1.nextInt64(); | |||
Random r (macAddresses[0] ^ macAddresses[1] | |||
^ Random::getSystemRandom().nextInt64()); | |||
Random r2; | |||
for (int i = 4; --i >= 0;) | |||
{ | |||
r.setSeedRandomly(); // calling this repeatedly improves randomness | |||
value.asInt[i] ^= r.nextInt(); | |||
value.asInt[i] ^= Random::getSystemRandom().nextInt(); | |||
} | |||
value.asInt[i] ^= r2.nextInt(); | |||
} | |||
Uuid::~Uuid() noexcept | |||
@@ -13769,19 +13771,20 @@ public: | |||
static String createRandomWideCharString() | |||
{ | |||
juce_wchar buffer[50] = { 0 }; | |||
Random r; | |||
for (int i = 0; i < numElementsInArray (buffer) - 1; ++i) | |||
{ | |||
if (Random::getSystemRandom().nextBool()) | |||
if (r.nextBool()) | |||
{ | |||
do | |||
{ | |||
buffer[i] = (juce_wchar) (1 + Random::getSystemRandom().nextInt (0x10ffff - 1)); | |||
buffer[i] = (juce_wchar) (1 + r.nextInt (0x10ffff - 1)); | |||
} | |||
while (! CharPointer_UTF16::canRepresent (buffer[i])); | |||
} | |||
else | |||
buffer[i] = (juce_wchar) (1 + Random::getSystemRandom().nextInt (0xff)); | |||
buffer[i] = (juce_wchar) (1 + r.nextInt (0xff)); | |||
} | |||
return CharPointer_UTF32 (buffer); | |||
@@ -28157,6 +28160,7 @@ public: | |||
{ | |||
const int numSamples = 2048; | |||
int32 original [numSamples], converted [numSamples], reversed [numSamples]; | |||
Random r; | |||
{ | |||
AudioData::Pointer<F1, E1, AudioData::NonInterleaved, AudioData::NonConst> d (original); | |||
@@ -28164,13 +28168,13 @@ public: | |||
for (int i = 0; i < numSamples / 2; ++i) | |||
{ | |||
d.setAsFloat (Random::getSystemRandom().nextFloat() * 2.2f - 1.1f); | |||
d.setAsFloat (r.nextFloat() * 2.2f - 1.1f); | |||
if (! d.isFloatingPoint()) | |||
clippingFailed = d.getAsFloat() > 1.0f || d.getAsFloat() < -1.0f || clippingFailed; | |||
++d; | |||
d.setAsInt32 (Random::getSystemRandom().nextInt()); | |||
d.setAsInt32 (r.nextInt()); | |||
++d; | |||
} | |||
@@ -73141,6 +73145,7 @@ void DragAndDropContainer::startDragging (const var& sourceDescription, | |||
Point<int> relPos (sourceComponent->getLocalPoint (nullptr, lastMouseDown)); | |||
Point<int> clipped (dragImage.getBounds().getConstrainedPoint (relPos)); | |||
Random random; | |||
for (int y = dragImage.getHeight(); --y >= 0;) | |||
{ | |||
@@ -73155,7 +73160,7 @@ void DragAndDropContainer::startDragging (const var& sourceDescription, | |||
{ | |||
const float alpha = (distance > hi) ? 0 | |||
: (hi - distance) / (float) (hi - lo) | |||
+ Random::getSystemRandom().nextFloat() * 0.008f; | |||
+ random.nextFloat() * 0.008f; | |||
dragImage.multiplyAlphaAt (x, y, alpha); | |||
} | |||
@@ -79553,9 +79558,11 @@ void ComponentPeer::handlePaint (LowLevelGraphicsContext& contextToPaintTo) | |||
// clearly when things are being repainted. | |||
g.restoreState(); | |||
g.fillAll (Colour ((uint8) Random::getSystemRandom().nextInt (255), | |||
(uint8) Random::getSystemRandom().nextInt (255), | |||
(uint8) Random::getSystemRandom().nextInt (255), | |||
static Random rng; | |||
g.fillAll (Colour ((uint8) rng.nextInt (255), | |||
(uint8) rng.nextInt (255), | |||
(uint8) rng.nextInt (255), | |||
(uint8) 0x50)); | |||
#endif | |||
@@ -73,7 +73,7 @@ namespace JuceDummyNamespace {} | |||
*/ | |||
#define JUCE_MAJOR_VERSION 1 | |||
#define JUCE_MINOR_VERSION 54 | |||
#define JUCE_BUILDNUMBER 16 | |||
#define JUCE_BUILDNUMBER 17 | |||
/** Current Juce version number. | |||
@@ -21339,9 +21339,6 @@ private: | |||
A random number generator. | |||
You can create a Random object and use it to generate a sequence of random numbers. | |||
As a handy shortcut to avoid having to create and seed one yourself, you can call | |||
Random::getSystemRandom() to return a global RNG that is seeded randomly when the | |||
app launches. | |||
*/ | |||
class JUCE_API Random | |||
{ | |||
@@ -21372,7 +21369,7 @@ public: | |||
int nextInt() noexcept; | |||
/** Returns the next random number, limited to a given range. | |||
The maxValue parameter may not be negative, or zero. | |||
@returns a random integer between 0 (inclusive) and maxValue (exclusive). | |||
*/ | |||
int nextInt (int maxValue) noexcept; | |||
@@ -21408,14 +21405,6 @@ public: | |||
/** Sets a range of bits in a BigInteger to random values. */ | |||
void fillBitsRandomly (BigInteger& arrayToChange, int startBit, int numBits); | |||
/** To avoid the overhead of having to create a new Random object whenever | |||
you need a number, this is a shared application-wide object that | |||
can be used. | |||
It's not thread-safe though, so threads should use their own Random object. | |||
*/ | |||
static Random& getSystemRandom() noexcept; | |||
/** Resets this Random object to a given seed value. */ | |||
void setSeed (int64 newSeed) noexcept; | |||
@@ -21433,6 +21422,14 @@ public: | |||
*/ | |||
void setSeedRandomly(); | |||
/** The overhead of creating a new Random object is fairly small, but if you want to avoid | |||
it, you can call this method to get a global shared Random object. | |||
It's not thread-safe though, so threads should use their own Random object, otherwise | |||
you run the risk of your random numbers becoming.. erm.. randomly corrupted.. | |||
*/ | |||
static Random& getSystemRandom() noexcept; | |||
private: | |||
int64 seed; | |||
@@ -33,7 +33,7 @@ | |||
*/ | |||
#define JUCE_MAJOR_VERSION 1 | |||
#define JUCE_MINOR_VERSION 54 | |||
#define JUCE_BUILDNUMBER 16 | |||
#define JUCE_BUILDNUMBER 17 | |||
/** Current Juce version number. | |||