mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Introjucer: new plist format for AU plugins.
This commit is contained in:
parent
56b1ddc873
commit
ddb6b969ea
7 changed files with 111 additions and 11 deletions
|
|
@ -704,17 +704,17 @@ private:
|
|||
if (xcodeOtherRezFlags.isNotEmpty())
|
||||
s.add ("OTHER_REZFLAGS = \"" + xcodeOtherRezFlags + "\"");
|
||||
|
||||
if (config.getTargetBinaryRelativePathString().isNotEmpty())
|
||||
{
|
||||
RelativePath binaryPath (config.getTargetBinaryRelativePathString(), RelativePath::projectFolder);
|
||||
binaryPath = binaryPath.rebased (projectFolder, getTargetFolder(), RelativePath::buildTargetFolder);
|
||||
|
||||
s.add ("DSTROOT = " + sanitisePath (binaryPath.toUnixStyle()));
|
||||
s.add ("SYMROOT = " + sanitisePath (binaryPath.toUnixStyle()));
|
||||
}
|
||||
|
||||
if (projectType.isLibrary())
|
||||
{
|
||||
if (config.getTargetBinaryRelativePathString().isNotEmpty())
|
||||
{
|
||||
RelativePath binaryPath (config.getTargetBinaryRelativePathString(), RelativePath::projectFolder);
|
||||
binaryPath = binaryPath.rebased (projectFolder, getTargetFolder(), RelativePath::buildTargetFolder);
|
||||
|
||||
s.add ("DSTROOT = " + sanitisePath (binaryPath.toUnixStyle()));
|
||||
s.add ("SYMROOT = " + sanitisePath (binaryPath.toUnixStyle()));
|
||||
}
|
||||
|
||||
s.add ("CONFIGURATION_BUILD_DIR = \"$(BUILD_DIR)\"");
|
||||
s.add ("DEPLOYMENT_LOCATION = YES");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -82,6 +82,20 @@ namespace
|
|||
return s;
|
||||
}
|
||||
|
||||
String getAUMainTypeCode (Project& project)
|
||||
{
|
||||
String s (getPluginAUMainType (project).toString());
|
||||
|
||||
if (s.isEmpty())
|
||||
{
|
||||
if (getPluginIsSynth (project).getValue()) s = "aumu";
|
||||
else if (getPluginWantsMidiInput (project).getValue()) s = "aumf";
|
||||
else s = "aufx";
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
int countMaxPluginChannels (const String& configString, bool isInput)
|
||||
{
|
||||
StringArray configs;
|
||||
|
|
@ -496,6 +510,28 @@ namespace AUHelpers
|
|||
subGroup.getChild (subGroup.getNumChildren() - 1).getShouldInhibitWarningsValue() = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (exporter.isXcode())
|
||||
{
|
||||
XmlElement plistKey ("key");
|
||||
plistKey.addTextElement ("AudioComponents");
|
||||
|
||||
XmlElement plistEntry ("array");
|
||||
XmlElement* dict = plistEntry.createNewChildElement ("dict");
|
||||
|
||||
Project& project = exporter.getProject();
|
||||
|
||||
addPlistDictionaryKey (dict, "name", getPluginName (project).toString());
|
||||
addPlistDictionaryKey (dict, "description", getPluginDesc (project).toString());
|
||||
addPlistDictionaryKey (dict, "factoryFunction", getPluginAUExportPrefix (project).toString() + "Factory");
|
||||
addPlistDictionaryKey (dict, "manufacturer", getPluginManufacturerCode (project).toString().trim().substring (0, 4));
|
||||
addPlistDictionaryKey (dict, "type", getAUMainTypeCode (project));
|
||||
addPlistDictionaryKey (dict, "subtype", getPluginCode (project).toString().trim().substring (0, 4));
|
||||
addPlistDictionaryKeyInt (dict, "version", project.getVersionAsHexInteger());
|
||||
|
||||
exporter.xcodeExtraPListEntries.add (plistKey);
|
||||
exporter.xcodeExtraPListEntries.add (plistEntry);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -387,7 +387,7 @@ static StringArray getConfigs (const Project& p)
|
|||
return configs;
|
||||
}
|
||||
|
||||
String Project::getVersionAsHex() const
|
||||
int Project::getVersionAsHexInteger() const
|
||||
{
|
||||
const StringArray configs (getConfigs (*this));
|
||||
|
||||
|
|
@ -396,7 +396,12 @@ String Project::getVersionAsHex() const
|
|||
if (configs.size() >= 4)
|
||||
value = (value << 8) + configs[3].getIntValue();
|
||||
|
||||
return "0x" + String::toHexString (value);
|
||||
return value;
|
||||
}
|
||||
|
||||
String Project::getVersionAsHex() const
|
||||
{
|
||||
return "0x" + String::toHexString (getVersionAsHexInteger());
|
||||
}
|
||||
|
||||
StringPairArray Project::getPreprocessorDefs() const
|
||||
|
|
|
|||
|
|
@ -83,6 +83,7 @@ public:
|
|||
Value getVersionValue() { return getProjectValue (Ids::version); }
|
||||
String getVersionString() const { return projectRoot [Ids::version]; }
|
||||
String getVersionAsHex() const;
|
||||
int getVersionAsHexInteger() const;
|
||||
|
||||
Value getBundleIdentifier() { return getProjectValue (Ids::bundleIdentifier); }
|
||||
String getDefaultBundleIdentifier() { return "com.yourcompany." + CodeHelpers::makeValidIdentifier (getTitle(), false, true, false); }
|
||||
|
|
|
|||
|
|
@ -172,6 +172,41 @@ StringArray getSearchPathsFromString (const String& searchPath)
|
|||
return s;
|
||||
}
|
||||
|
||||
void addPlistDictionaryKey (XmlElement* xml, const String& key, const String& value)
|
||||
{
|
||||
forEachXmlChildElementWithTagName (*xml, e, "key")
|
||||
{
|
||||
if (e->getAllSubText().trim().equalsIgnoreCase (key))
|
||||
{
|
||||
if (e->getNextElement() != nullptr && e->getNextElement()->hasTagName ("key"))
|
||||
{
|
||||
// try to fix broken plist format..
|
||||
xml->removeChildElement (e, true);
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
return; // (value already exists)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
xml->createNewChildElement ("key") ->addTextElement (key);
|
||||
xml->createNewChildElement ("string")->addTextElement (value);
|
||||
}
|
||||
|
||||
void addPlistDictionaryKeyBool (XmlElement* xml, const String& key, const bool value)
|
||||
{
|
||||
xml->createNewChildElement ("key")->addTextElement (key);
|
||||
xml->createNewChildElement (value ? "true" : "false");
|
||||
}
|
||||
|
||||
void addPlistDictionaryKeyInt (XmlElement* xml, const String& key, int value)
|
||||
{
|
||||
xml->createNewChildElement ("key")->addTextElement (key);
|
||||
xml->createNewChildElement ("integer")->addTextElement (String (value));
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void autoScrollForMouseEvent (const MouseEvent& e, bool scrollX, bool scrollY)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -41,6 +41,10 @@ StringArray getSearchPathsFromString (const String& searchPath);
|
|||
|
||||
void setValueIfVoid (Value value, const var& defaultValue);
|
||||
|
||||
void addPlistDictionaryKey (XmlElement* xml, const String& key, const String& value);
|
||||
void addPlistDictionaryKeyBool (XmlElement* xml, const String& key, bool value);
|
||||
void addPlistDictionaryKeyInt (XmlElement* xml, const String& key, int value);
|
||||
|
||||
//==============================================================================
|
||||
int indexOfLineStartingWith (const StringArray& lines, const String& text, int startIndex);
|
||||
|
||||
|
|
|
|||
|
|
@ -23,5 +23,24 @@
|
|||
<string>Raw Material Software Ltd.</string>
|
||||
<key>NSHighResolutionCapable</key>
|
||||
<true/>
|
||||
<key>AudioComponents</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Juce Demo Plugin</string>
|
||||
<key>description</key>
|
||||
<string>Juce Demo Plugin</string>
|
||||
<key>factoryFunction</key>
|
||||
<string>JuceDemoProjectAUFactory</string>
|
||||
<key>manufacturer</key>
|
||||
<string>RawM</string>
|
||||
<key>type</key>
|
||||
<string>aumf</string>
|
||||
<key>subtype</key>
|
||||
<string>Jcdm</string>
|
||||
<key>version</key>
|
||||
<integer>65536</integer>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue