From fb2a5fc8573cf272529148b2299fc421b3a7c064 Mon Sep 17 00:00:00 2001 From: jules Date: Tue, 4 Feb 2014 15:54:15 +0000 Subject: [PATCH] Updates to introjucer for VST3 targets. --- .../Introjucer/JuceLibraryCode/BinaryData.cpp | 17 ++++++++++-- .../Introjucer/JuceLibraryCode/BinaryData.h | 2 +- .../BinaryData/AudioPluginXCodeScript.txt | 15 ++++++++++- .../Source/Project/jucer_AudioPluginModule.h | 26 +++++++++++++++++++ .../Source/Project/jucer_Project.cpp | 6 +++++ .../Introjucer/Source/Project/jucer_Project.h | 2 ++ .../Source/Project/jucer_ProjectType.cpp | 7 +++++ .../Source/Utility/jucer_PresetIDs.h | 2 ++ 8 files changed, 73 insertions(+), 4 deletions(-) diff --git a/extras/Introjucer/JuceLibraryCode/BinaryData.cpp b/extras/Introjucer/JuceLibraryCode/BinaryData.cpp index 2aad9aa38e..4accd3cf9b 100644 --- a/extras/Introjucer/JuceLibraryCode/BinaryData.cpp +++ b/extras/Introjucer/JuceLibraryCode/BinaryData.cpp @@ -10,7 +10,7 @@ namespace BinaryData //================== AudioPluginXCodeScript.txt ================== static const unsigned char temp_binary_data_0[] = "\r\n" -"# This script takes the build product and copies it to the AU, VST, and RTAS folders, depending on \r\n" +"# This script takes the build product and copies it to the AU, VST, VST3, RTAS and AAX folders, depending on \r\n" "# which plugin types you've built\r\n" "\r\n" "original=$CONFIGURATION_BUILD_DIR/$FULL_PRODUCT_NAME\r\n" @@ -18,6 +18,7 @@ static const unsigned char temp_binary_data_0[] = "# this looks inside the binary to detect which platforms are needed.. \r\n" "copyAU=`nm -g \"$CONFIGURATION_BUILD_DIR/$EXECUTABLE_PATH\" | grep -i 'AudioUnit' | wc -l`\r\n" "copyVST=`nm -g \"$CONFIGURATION_BUILD_DIR/$EXECUTABLE_PATH\" | grep -i 'VSTPlugin' | wc -l`\r\n" +"copyVST3=`nm -g \"$CONFIGURATION_BUILD_DIR/$EXECUTABLE_PATH\" | grep -i 'VST3Plugin' | wc -l`\r\n" "copyRTAS=`nm -g \"$CONFIGURATION_BUILD_DIR/$EXECUTABLE_PATH\" | grep -i 'CProcess' | wc -l`\r\n" "copyAAX=`nm -g \"$CONFIGURATION_BUILD_DIR/$EXECUTABLE_PATH\" | grep -i 'ACFStartup' | wc -l`\r\n" "\r\n" @@ -53,6 +54,18 @@ static const unsigned char temp_binary_data_0[] = " sed -i \"\" -e 's/TDMw/BNDL/g' \"$VST/Contents/$INFOPLIST_FILE\"\r\n" "fi\r\n" "\r\n" +"if [ $copyVST3 -gt 0 ]; then\r\n" +" echo \"Copying to VST3 folder...\"\r\n" +" VST3=~/Library/Audio/Plug-Ins/VST3/$PRODUCT_NAME.vst3\r\n" +" if [ -d \"$VST3\" ]; then \r\n" +" rm -r \"$VST3\"\r\n" +" fi\r\n" +"\r\n" +" cp -r \"$original\" \"$VST3\"\r\n" +" sed -i \"\" -e 's/TDMwPTul/BNDLPTul/g' \"$VST3/Contents/PkgInfo\"\r\n" +" sed -i \"\" -e 's/TDMw/BNDL/g' \"$VST3/Contents/$INFOPLIST_FILE\"\r\n" +"fi\r\n" +"\r\n" "if [ $copyRTAS -gt 0 ]; then\r\n" " echo \"Copying to RTAS folder...\"\r\n" " RTAS=/Library/Application\\ Support/Digidesign/Plug-Ins/$PRODUCT_NAME.dpm\r\n" @@ -1215,7 +1228,7 @@ const char* getNamedResource (const char* resourceNameUTF8, int& numBytes) throw switch (hash) { - case 0x44be9398: numBytes = 2464; return AudioPluginXCodeScript_txt; + case 0x44be9398: numBytes = 2910; return AudioPluginXCodeScript_txt; case 0x4a0cfd09: numBytes = 151; return background_tile_png; case 0x763d39dc: numBytes = 1050; return colourscheme_dark_xml; case 0xe8b08520: numBytes = 1050; return colourscheme_light_xml; diff --git a/extras/Introjucer/JuceLibraryCode/BinaryData.h b/extras/Introjucer/JuceLibraryCode/BinaryData.h index e38ca4eb4f..644a262113 100644 --- a/extras/Introjucer/JuceLibraryCode/BinaryData.h +++ b/extras/Introjucer/JuceLibraryCode/BinaryData.h @@ -10,7 +10,7 @@ namespace BinaryData { extern const char* AudioPluginXCodeScript_txt; - const int AudioPluginXCodeScript_txtSize = 2464; + const int AudioPluginXCodeScript_txtSize = 2910; extern const char* background_tile_png; const int background_tile_pngSize = 151; diff --git a/extras/Introjucer/Source/BinaryData/AudioPluginXCodeScript.txt b/extras/Introjucer/Source/BinaryData/AudioPluginXCodeScript.txt index 1757cedafa..4fb934c9ee 100644 --- a/extras/Introjucer/Source/BinaryData/AudioPluginXCodeScript.txt +++ b/extras/Introjucer/Source/BinaryData/AudioPluginXCodeScript.txt @@ -1,5 +1,5 @@ -# This script takes the build product and copies it to the AU, VST, and RTAS folders, depending on +# This script takes the build product and copies it to the AU, VST, VST3, RTAS and AAX folders, depending on # which plugin types you've built original=$CONFIGURATION_BUILD_DIR/$FULL_PRODUCT_NAME @@ -7,6 +7,7 @@ original=$CONFIGURATION_BUILD_DIR/$FULL_PRODUCT_NAME # this looks inside the binary to detect which platforms are needed.. copyAU=`nm -g "$CONFIGURATION_BUILD_DIR/$EXECUTABLE_PATH" | grep -i 'AudioUnit' | wc -l` copyVST=`nm -g "$CONFIGURATION_BUILD_DIR/$EXECUTABLE_PATH" | grep -i 'VSTPlugin' | wc -l` +copyVST3=`nm -g "$CONFIGURATION_BUILD_DIR/$EXECUTABLE_PATH" | grep -i 'VST3Plugin' | wc -l` copyRTAS=`nm -g "$CONFIGURATION_BUILD_DIR/$EXECUTABLE_PATH" | grep -i 'CProcess' | wc -l` copyAAX=`nm -g "$CONFIGURATION_BUILD_DIR/$EXECUTABLE_PATH" | grep -i 'ACFStartup' | wc -l` @@ -42,6 +43,18 @@ if [ $copyVST -gt 0 ]; then sed -i "" -e 's/TDMw/BNDL/g' "$VST/Contents/$INFOPLIST_FILE" fi +if [ $copyVST3 -gt 0 ]; then + echo "Copying to VST3 folder..." + VST3=~/Library/Audio/Plug-Ins/VST3/$PRODUCT_NAME.vst3 + if [ -d "$VST3" ]; then + rm -r "$VST3" + fi + + cp -r "$original" "$VST3" + sed -i "" -e 's/TDMwPTul/BNDLPTul/g' "$VST3/Contents/PkgInfo" + sed -i "" -e 's/TDMw/BNDL/g' "$VST3/Contents/$INFOPLIST_FILE" +fi + if [ $copyRTAS -gt 0 ]; then echo "Copying to RTAS folder..." RTAS=/Library/Application\ Support/Digidesign/Plug-Ins/$PRODUCT_NAME.dpm diff --git a/extras/Introjucer/Source/Project/jucer_AudioPluginModule.h b/extras/Introjucer/Source/Project/jucer_AudioPluginModule.h index ae6832e604..35b6777bed 100644 --- a/extras/Introjucer/Source/Project/jucer_AudioPluginModule.h +++ b/extras/Introjucer/Source/Project/jucer_AudioPluginModule.h @@ -38,6 +38,8 @@ namespace Value getPluginName (Project& project) { return project.getProjectValue ("pluginName"); } Value getPluginDesc (Project& project) { return project.getProjectValue ("pluginDesc"); } Value getPluginManufacturer (Project& project) { return project.getProjectValue ("pluginManufacturer"); } + Value getPluginManufacturerWebsite (Project& project) { return project.getProjectValue ("pluginManufacturerWebsite"); } + Value getPluginManufacturerEmail (Project& project) { return project.getProjectValue ("pluginManufacturerEmail"); } Value getPluginManufacturerCode (Project& project) { return project.getProjectValue ("pluginManufacturerCode"); } Value getPluginCode (Project& project) { return project.getProjectValue ("pluginCode"); } Value getPluginChannelConfigs (Project& project) { return project.getProjectValue ("pluginChannelConfigs"); } @@ -128,6 +130,8 @@ namespace flags.set ("JucePlugin_Name", getPluginName (project).toString().quoted()); flags.set ("JucePlugin_Desc", getPluginDesc (project).toString().quoted()); flags.set ("JucePlugin_Manufacturer", getPluginManufacturer (project).toString().quoted()); + flags.set ("JucePlugin_ManufacturerWebsite", getPluginManufacturerWebsite (project).toString().quoted()); + flags.set ("JucePlugin_ManufacturerEmail", getPluginManufacturerEmail (project).toString().quoted()); flags.set ("JucePlugin_ManufacturerCode", getPluginManufacturerCode (project).toString().trim().substring (0, 4).quoted ('\'')); flags.set ("JucePlugin_PluginCode", getPluginCode (project).toString().trim().substring (0, 4).quoted ('\'')); flags.set ("JucePlugin_MaxNumInputChannels", String (countMaxPluginChannels (getPluginChannelConfigs (project).toString(), true))); @@ -260,6 +264,28 @@ namespace VSTHelpers exporter.extraSearchPaths.add (juceWrapperFolder.toWindowsStyle()); else if (exporter.isLinux()) exporter.extraSearchPaths.add (juceWrapperFolder.toUnixStyle()); + + if (exporter.isVisualStudio()) + { + if (! exporter.getExtraLinkerFlagsString().contains ("/FORCE:multiple")) + exporter.getExtraLinkerFlags() = exporter.getExtraLinkerFlags().toString() + " /FORCE:multiple"; + + RelativePath modulePath (exporter.rebaseFromProjectFolderToBuildTarget (RelativePath (exporter.getPathForModuleString ("juce_audio_plugin_client"), + RelativePath::projectFolder) + .getChildFile ("juce_audio_plugin_client") + .getChildFile ("VST3"))); + + for (ProjectExporter::ConfigIterator config (exporter); config.next();) + { + config->getValue (Ids::msvcModuleDefinitionFile) = modulePath.getChildFile ("juce_VST3_WinExports.def").toWindowsStyle(); + + if (config->getValue (Ids::useRuntimeLibDLL).getValue().isVoid()) + config->getValue (Ids::useRuntimeLibDLL) = true; + + if (config->getValue (Ids::postbuildCommand).toString().isEmpty()) + config->getValue (Ids::postbuildCommand) = "copy /Y $(OutDir)$(TargetFileName) $(OutDir)$(TargetName).vst3"; + } + } } static inline void createPropertyEditors (ProjectExporter& exporter, PropertyListBuilder& props, bool isVST3) diff --git a/extras/Introjucer/Source/Project/jucer_Project.cpp b/extras/Introjucer/Source/Project/jucer_Project.cpp index 5186c8ba87..0b04f694a8 100644 --- a/extras/Introjucer/Source/Project/jucer_Project.cpp +++ b/extras/Introjucer/Source/Project/jucer_Project.cpp @@ -376,6 +376,12 @@ void Project::createPropertyEditors (PropertyListBuilder& props) props.add (new TextPropertyComponent (getCompanyName(), "Company Name", 256, false), "Your company name, which will be added to the properties of the binary where possible"); + props.add (new TextPropertyComponent (getCompanyWebsite(), "Company Website", 256, false), + "Your company website, which will be added to the properties of the binary where possible"); + + props.add (new TextPropertyComponent (getCompanyEmail(), "Company E-mail", 256, false), + "Your company e-mail, which will be added to the properties of the binary where possible"); + { StringArray projectTypeNames; Array projectTypeCodes; diff --git a/extras/Introjucer/Source/Project/jucer_Project.h b/extras/Introjucer/Source/Project/jucer_Project.h index b52093331c..5aaf31ecc7 100644 --- a/extras/Introjucer/Source/Project/jucer_Project.h +++ b/extras/Introjucer/Source/Project/jucer_Project.h @@ -92,6 +92,8 @@ public: String getDefaultAAXIdentifier() { return getDefaultBundleIdentifier(); } Value getCompanyName() { return getProjectValue (Ids::companyName); } + Value getCompanyWebsite() { return getProjectValue (Ids::companyWebsite); } + Value getCompanyEmail() { return getProjectValue (Ids::companyEmail); } //============================================================================== Value getProjectValue (const Identifier& name) { return projectRoot.getPropertyAsValue (name, getUndoManagerFor (projectRoot)); } diff --git a/extras/Introjucer/Source/Project/jucer_ProjectType.cpp b/extras/Introjucer/Source/Project/jucer_ProjectType.cpp index 67470b710c..0e96bdde0f 100644 --- a/extras/Introjucer/Source/Project/jucer_ProjectType.cpp +++ b/extras/Introjucer/Source/Project/jucer_ProjectType.cpp @@ -194,11 +194,16 @@ public: const String sanitisedProjectName (CodeHelpers::makeValidIdentifier (project.getTitle(), false, true, false)); setValueIfVoid (shouldBuildVST (project), true); + setValueIfVoid (shouldBuildVST3 (project), false); setValueIfVoid (shouldBuildAU (project), true); + setValueIfVoid (shouldBuildRTAS (project), false); + setValueIfVoid (shouldBuildAAX (project), false); setValueIfVoid (getPluginName (project), project.getTitle()); setValueIfVoid (getPluginDesc (project), project.getTitle()); setValueIfVoid (getPluginManufacturer (project), "yourcompany"); + setValueIfVoid (getPluginManufacturerWebsite (project), "www.yourcompany.com"); + setValueIfVoid (getPluginManufacturerEmail (project), "support@yourcompany.com"); setValueIfVoid (getPluginManufacturerCode (project), "Manu"); setValueIfVoid (getPluginCode (project), "Plug"); setValueIfVoid (getPluginChannelConfigs (project), "{1, 1}, {2, 2}"); @@ -218,6 +223,8 @@ public: { props.add (new BooleanPropertyComponent (shouldBuildVST (project), "Build VST", "Enabled"), "Whether the project should produce a VST plugin."); + props.add (new BooleanPropertyComponent (shouldBuildVST3 (project), "Build VST3", "Enabled"), + "Whether the project should produce a VST3 plugin."); props.add (new BooleanPropertyComponent (shouldBuildAU (project), "Build AudioUnit", "Enabled"), "Whether the project should produce an AudioUnit plugin."); props.add (new BooleanPropertyComponent (shouldBuildRTAS (project), "Build RTAS", "Enabled"), diff --git a/extras/Introjucer/Source/Utility/jucer_PresetIDs.h b/extras/Introjucer/Source/Utility/jucer_PresetIDs.h index b588027809..e916b67e79 100644 --- a/extras/Introjucer/Source/Utility/jucer_PresetIDs.h +++ b/extras/Introjucer/Source/Utility/jucer_PresetIDs.h @@ -41,6 +41,8 @@ namespace Ids DECLARE_ID (info); DECLARE_ID (description); DECLARE_ID (companyName); + DECLARE_ID (companyWebsite); + DECLARE_ID (companyEmail); DECLARE_ID (position); DECLARE_ID (source); DECLARE_ID (width);