| @@ -123,7 +123,7 @@ namespace | |||||
| flags.set ("JucePlugin_TailLengthSeconds", String (static_cast <double> (getPluginTailLengthSeconds (project).getValue()))); | flags.set ("JucePlugin_TailLengthSeconds", String (static_cast <double> (getPluginTailLengthSeconds (project).getValue()))); | ||||
| flags.set ("JucePlugin_EditorRequiresKeyboardFocus", valueToBool (getPluginEditorNeedsKeyFocus (project))); | flags.set ("JucePlugin_EditorRequiresKeyboardFocus", valueToBool (getPluginEditorNeedsKeyFocus (project))); | ||||
| flags.set ("JucePlugin_Version", project.getVersionString()); | flags.set ("JucePlugin_Version", project.getVersionString()); | ||||
| flags.set ("JucePlugin_VersionCode", project.getVersionAsHex()); | |||||
| flags.set ("JucePlugin_VersionCode", project.getVersionAsDecimal()); | |||||
| flags.set ("JucePlugin_VersionString", project.getVersionString().quoted()); | flags.set ("JucePlugin_VersionString", project.getVersionString().quoted()); | ||||
| flags.set ("JucePlugin_VSTUniqueID", "JucePlugin_PluginCode"); | flags.set ("JucePlugin_VSTUniqueID", "JucePlugin_PluginCode"); | ||||
| flags.set ("JucePlugin_VSTCategory", static_cast <bool> (getPluginIsSynth (project).getValue()) ? "kPlugCategSynth" : "kPlugCategEffect"); | flags.set ("JucePlugin_VSTCategory", static_cast <bool> (getPluginIsSynth (project).getValue()) ? "kPlugCategSynth" : "kPlugCategEffect"); | ||||
| @@ -382,12 +382,18 @@ void Project::createPropertyEditors (PropertyListBuilder& props) | |||||
| "Extra comments: This field is not used for code or project generation, it's just a space where you can express your thoughts."); | "Extra comments: This field is not used for code or project generation, it's just a space where you can express your thoughts."); | ||||
| } | } | ||||
| String Project::getVersionAsHex() const | |||||
| static StringArray getConfigs (const Project& p) | |||||
| { | { | ||||
| StringArray configs; | StringArray configs; | ||||
| configs.addTokens (getVersionString(), ",.", String::empty); | |||||
| configs.addTokens (p.getVersionString(), ",.", String::empty); | |||||
| configs.trim(); | configs.trim(); | ||||
| configs.removeEmptyStrings(); | configs.removeEmptyStrings(); | ||||
| return configs; | |||||
| } | |||||
| String Project::getVersionAsHex() const | |||||
| { | |||||
| const StringArray configs (getConfigs (*this)); | |||||
| int value = (configs[0].getIntValue() << 16) + (configs[1].getIntValue() << 8) + configs[2].getIntValue(); | int value = (configs[0].getIntValue() << 16) + (configs[1].getIntValue() << 8) + configs[2].getIntValue(); | ||||
| @@ -397,6 +403,18 @@ String Project::getVersionAsHex() const | |||||
| return "0x" + String::toHexString (value); | return "0x" + String::toHexString (value); | ||||
| } | } | ||||
| String Project::getVersionAsDecimal() const | |||||
| { | |||||
| const StringArray configs (getConfigs (*this)); | |||||
| int value = (configs[0].getIntValue() * 100) + (configs[1].getIntValue() * 10) + configs[2].getIntValue(); | |||||
| if (configs.size() >= 4) | |||||
| value = (value * 10) + configs[3].getIntValue(); | |||||
| return String (value); | |||||
| } | |||||
| StringPairArray Project::getPreprocessorDefs() const | StringPairArray Project::getPreprocessorDefs() const | ||||
| { | { | ||||
| return parsePreprocessorDefs (projectRoot [Ids::defines]); | return parsePreprocessorDefs (projectRoot [Ids::defines]); | ||||
| @@ -83,6 +83,7 @@ public: | |||||
| Value getVersionValue() { return getProjectValue (Ids::version); } | Value getVersionValue() { return getProjectValue (Ids::version); } | ||||
| String getVersionString() const { return projectRoot [Ids::version]; } | String getVersionString() const { return projectRoot [Ids::version]; } | ||||
| String getVersionAsHex() const; | String getVersionAsHex() const; | ||||
| String getVersionAsDecimal() const; | |||||
| Value getBundleIdentifier() { return getProjectValue (Ids::bundleIdentifier); } | Value getBundleIdentifier() { return getProjectValue (Ids::bundleIdentifier); } | ||||
| String getDefaultBundleIdentifier() { return "com.yourcompany." + CodeHelpers::makeValidIdentifier (getTitle(), false, true, false); } | String getDefaultBundleIdentifier() { return "com.yourcompany." + CodeHelpers::makeValidIdentifier (getTitle(), false, true, false); } | ||||
| @@ -1862,8 +1862,8 @@ private: | |||||
| while (v != 0) | while (v != 0) | ||||
| { | { | ||||
| versionBits [n++] = (v & 0xff); | |||||
| v >>= 8; | |||||
| versionBits [n++] = v % 10; | |||||
| v /= 10; | |||||
| } | } | ||||
| s << 'V'; | s << 'V'; | ||||