diff --git a/extras/Introjucer/Source/Project/jucer_AudioPluginModule.h b/extras/Introjucer/Source/Project/jucer_AudioPluginModule.h index b1466fcd30..fb840e9da3 100644 --- a/extras/Introjucer/Source/Project/jucer_AudioPluginModule.h +++ b/extras/Introjucer/Source/Project/jucer_AudioPluginModule.h @@ -123,7 +123,7 @@ namespace flags.set ("JucePlugin_TailLengthSeconds", String (static_cast (getPluginTailLengthSeconds (project).getValue()))); flags.set ("JucePlugin_EditorRequiresKeyboardFocus", valueToBool (getPluginEditorNeedsKeyFocus (project))); flags.set ("JucePlugin_Version", project.getVersionString()); - flags.set ("JucePlugin_VersionCode", project.getVersionAsDecimal()); + flags.set ("JucePlugin_VersionCode", project.getVersionAsHex()); flags.set ("JucePlugin_VersionString", project.getVersionString().quoted()); flags.set ("JucePlugin_VSTUniqueID", "JucePlugin_PluginCode"); flags.set ("JucePlugin_VSTCategory", static_cast (getPluginIsSynth (project).getValue()) ? "kPlugCategSynth" : "kPlugCategEffect"); diff --git a/extras/Introjucer/Source/Project/jucer_Project.cpp b/extras/Introjucer/Source/Project/jucer_Project.cpp index a6e4fad344..043f700ed4 100644 --- a/extras/Introjucer/Source/Project/jucer_Project.cpp +++ b/extras/Introjucer/Source/Project/jucer_Project.cpp @@ -403,18 +403,6 @@ String Project::getVersionAsHex() const 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 { return parsePreprocessorDefs (projectRoot [Ids::defines]); diff --git a/extras/Introjucer/Source/Project/jucer_Project.h b/extras/Introjucer/Source/Project/jucer_Project.h index 415b299bf2..3963a30895 100644 --- a/extras/Introjucer/Source/Project/jucer_Project.h +++ b/extras/Introjucer/Source/Project/jucer_Project.h @@ -83,7 +83,6 @@ public: Value getVersionValue() { return getProjectValue (Ids::version); } String getVersionString() const { return projectRoot [Ids::version]; } String getVersionAsHex() const; - String getVersionAsDecimal() const; Value getBundleIdentifier() { return getProjectValue (Ids::bundleIdentifier); } String getDefaultBundleIdentifier() { return "com.yourcompany." + CodeHelpers::makeValidIdentifier (getTitle(), false, true, false); } diff --git a/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp b/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp index 7afd979305..66ee4dd658 100644 --- a/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp +++ b/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp @@ -281,7 +281,7 @@ public: filter->addListener (this); cEffect.flags |= effFlagsHasEditor; - cEffect.version = (long) (JucePlugin_VersionCode); + cEffect.version = convertHexVersionToDecimal (JucePlugin_VersionCode); setUniqueID ((int) (JucePlugin_VSTUniqueID)); @@ -1381,6 +1381,14 @@ private: HWND hostWindow; #endif + static inline long convertHexVersionToDecimal (const unsigned int hexVersion) + { + return (long) (((hexVersion >> 24) & 0xff) * 1000 + + ((hexVersion >> 16) & 0xff) * 100 + + ((hexVersion >> 8) & 0xff) * 10 + + (hexVersion & 0xff)); + } + //============================================================================== #if JUCE_WINDOWS // Workarounds for Wavelab's happy-go-lucky use of threads.