From ec524a437d0565fba51143fa254872af8da4b6e2 Mon Sep 17 00:00:00 2001 From: jules Date: Mon, 9 Sep 2013 21:43:57 +0100 Subject: [PATCH] Fixed VC warning. Tweak to mouse cursor snap-back in sliders. Added an introjucer option to avoid adding the BinaryData.h header to AppConfig.h --- .../ComponentEditor/jucer_JucerDocument.cpp | 2 +- .../Project Saving/jucer_ProjectSaver.h | 2 +- .../Source/Project/jucer_Project.cpp | 6 ++ .../Introjucer/Source/Project/jucer_Project.h | 1 + .../Source/Utility/jucer_PresetIDs.h | 1 + extras/JuceDemo/Juce Demo.jucer | 2 +- .../Source/demos/AudioDemoLatencyPage.cpp | 2 +- .../Source/demos/AudioDemoPlaybackPage.cpp | 2 +- .../Source/demos/AudioDemoRecordPage.cpp | 2 +- .../Source/demos/AudioDemoSetupPage.cpp | 2 +- .../Source/demos/AudioDemoSynthPage.cpp | 2 +- .../Source/demos/AudioDemoTabComponent.cpp | 2 +- .../Source/demos/RenderingTestComponent.cpp | 64 ++++++++++--------- modules/juce_core/text/juce_StringRef.h | 2 +- .../juce_gui_basics/widgets/juce_Slider.cpp | 2 +- 15 files changed, 53 insertions(+), 41 deletions(-) diff --git a/extras/Introjucer/Source/ComponentEditor/jucer_JucerDocument.cpp b/extras/Introjucer/Source/ComponentEditor/jucer_JucerDocument.cpp index f25e670928..b2da3ddfc1 100644 --- a/extras/Introjucer/Source/ComponentEditor/jucer_JucerDocument.cpp +++ b/extras/Introjucer/Source/ComponentEditor/jucer_JucerDocument.cpp @@ -348,7 +348,7 @@ XmlElement* JucerDocument::createXml() const doc->setAttribute ("snapPixels", snapGridPixels); doc->setAttribute ("snapActive", snapActive); doc->setAttribute ("snapShown", snapShown); - doc->setAttribute ("overlayOpacity", (double) componentOverlayOpacity); + doc->setAttribute ("overlayOpacity", String (componentOverlayOpacity, 3)); doc->setAttribute ("fixedSize", fixedSize); doc->setAttribute ("initialWidth", initialWidth); doc->setAttribute ("initialHeight", initialHeight); diff --git a/extras/Introjucer/Source/Project Saving/jucer_ProjectSaver.h b/extras/Introjucer/Source/Project Saving/jucer_ProjectSaver.h index 343676f48c..81c11e6b26 100644 --- a/extras/Introjucer/Source/Project Saving/jucer_ProjectSaver.h +++ b/extras/Introjucer/Source/Project Saving/jucer_ProjectSaver.h @@ -432,7 +432,7 @@ private: for (int i = 0; i < modules.size(); ++i) modules.getUnchecked(i)->writeIncludes (*this, out); - if (hasBinaryData) + if (hasBinaryData && project.shouldIncludeBinaryInAppConfig().getValue()) out << CodeHelpers::createIncludeStatement (project.getBinaryDataHeaderFile(), appConfigFile) << newLine; out << newLine diff --git a/extras/Introjucer/Source/Project/jucer_Project.cpp b/extras/Introjucer/Source/Project/jucer_Project.cpp index 0039d36f0f..8c3684d440 100644 --- a/extras/Introjucer/Source/Project/jucer_Project.cpp +++ b/extras/Introjucer/Source/Project/jucer_Project.cpp @@ -127,6 +127,9 @@ void Project::setMissingDefaultValues() if (getBundleIdentifier().toString().isEmpty()) getBundleIdentifier() = getDefaultBundleIdentifier(); + if (shouldIncludeBinaryInAppConfig() == var::null) + shouldIncludeBinaryInAppConfig() = true; + IntrojucerApp::getApp().updateNewlyOpenedProject (*this); } @@ -405,6 +408,9 @@ void Project::createPropertyEditors (PropertyListBuilder& props) "(Note that individual resource files which are larger than this size cannot be split across multiple cpp files)."); } + props.add (new BooleanPropertyComponent (shouldIncludeBinaryInAppConfig(), "Include Binary", + "Include BinaryData.h in the AppConfig.h file")); + props.add (new TextPropertyComponent (getProjectPreprocessorDefs(), "Preprocessor definitions", 32768, true), "Global preprocessor definitions. Use the form \"NAME1=value NAME2=value\", using whitespace, commas, or " "new-lines to separate the items - to include a space or comma in a definition, precede it with a backslash."); diff --git a/extras/Introjucer/Source/Project/jucer_Project.h b/extras/Introjucer/Source/Project/jucer_Project.h index 60dc7a1093..d995154ab9 100644 --- a/extras/Introjucer/Source/Project/jucer_Project.h +++ b/extras/Introjucer/Source/Project/jucer_Project.h @@ -107,6 +107,7 @@ public: File getBinaryDataCppFile (int index) const; File getBinaryDataHeaderFile() const { return getBinaryDataCppFile (0).withFileExtension (".h"); } Value getMaxBinaryFileSize() { return getProjectValue (Ids::maxBinaryFileSize); } + Value shouldIncludeBinaryInAppConfig() { return getProjectValue (Ids::includeBinaryInAppConfig); } //============================================================================== String getAmalgamatedHeaderFileName() const { return "juce_amalgamated.h"; } diff --git a/extras/Introjucer/Source/Utility/jucer_PresetIDs.h b/extras/Introjucer/Source/Utility/jucer_PresetIDs.h index 02096186b4..49c611f75a 100644 --- a/extras/Introjucer/Source/Utility/jucer_PresetIDs.h +++ b/extras/Introjucer/Source/Utility/jucer_PresetIDs.h @@ -134,6 +134,7 @@ namespace Ids DECLARE_ID (colour); DECLARE_ID (userNotes); DECLARE_ID (maxBinaryFileSize); + DECLARE_ID (includeBinaryInAppConfig); DECLARE_ID (characterSet); const Identifier ID ("id"); const Identifier class_ ("class"); diff --git a/extras/JuceDemo/Juce Demo.jucer b/extras/JuceDemo/Juce Demo.jucer index 60de0dc1a9..d3dd07a061 100644 --- a/extras/JuceDemo/Juce Demo.jucer +++ b/extras/JuceDemo/Juce Demo.jucer @@ -8,7 +8,7 @@ pluginWantsMidiIn="0" pluginProducesMidiOut="0" pluginSilenceInIsSilenceOut="0" pluginTailLength="0" pluginEditorRequiresKeys="0" pluginAUExportPrefix="JuceDemoAU" pluginAUViewClass="JuceDemoAU_V1" pluginRTASCategory="" icon="Duj062Top" - companyName="Raw Material Software Ltd."> + companyName="Raw Material Software Ltd." includeBinaryInAppConfig="1">