From 355f022f6b4f9b331314697075a3ddf6b5d0131c Mon Sep 17 00:00:00 2001 From: jules Date: Wed, 24 Jun 2015 12:31:29 +0100 Subject: [PATCH 1/5] Spelling fixes. --- examples/AudioAppExample/Source/MainComponent.cpp | 2 +- examples/BouncingBallWavetableDemo/Source/MainComponent.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/AudioAppExample/Source/MainComponent.cpp b/examples/AudioAppExample/Source/MainComponent.cpp index 0ef6ea3ba2..91d734c09c 100644 --- a/examples/AudioAppExample/Source/MainComponent.cpp +++ b/examples/AudioAppExample/Source/MainComponent.cpp @@ -70,7 +70,7 @@ public: void releaseResources() override { - // This gets automatically called when audio device paramters change + // This gets automatically called when audio device parameters change // or device is restarted. } diff --git a/examples/BouncingBallWavetableDemo/Source/MainComponent.cpp b/examples/BouncingBallWavetableDemo/Source/MainComponent.cpp index 859ee7ff34..b016d4a766 100644 --- a/examples/BouncingBallWavetableDemo/Source/MainComponent.cpp +++ b/examples/BouncingBallWavetableDemo/Source/MainComponent.cpp @@ -77,7 +77,7 @@ public: void releaseResources() override { - // This gets automatically called when audio device paramters change + // This gets automatically called when audio device parameters change // or device is restarted. stopTimer(); } From 6cbab98ab2d9b9c0b724557aca25546389855262 Mon Sep 17 00:00:00 2001 From: jules Date: Wed, 24 Jun 2015 17:20:31 +0100 Subject: [PATCH 2/5] Introjucer: update to the format of iOS icons. --- .../jucer_ProjectExport_XCode.h | 99 ++++++++++++++----- 1 file changed, 75 insertions(+), 24 deletions(-) diff --git a/extras/Introjucer/Source/Project Saving/jucer_ProjectExport_XCode.h b/extras/Introjucer/Source/Project Saving/jucer_ProjectExport_XCode.h index 2414627a36..d21affc42a 100644 --- a/extras/Introjucer/Source/Project Saving/jucer_ProjectExport_XCode.h +++ b/extras/Introjucer/Source/Project Saving/jucer_ProjectExport_XCode.h @@ -530,10 +530,8 @@ private: out << data; } - void createIconFile() const + void getIconImages (OwnedArray& images) const { - OwnedArray images; - ScopedPointer bigIcon (getBigIcon()); if (bigIcon != nullptr) images.add (bigIcon.release()); @@ -541,6 +539,35 @@ private: ScopedPointer smallIcon (getSmallIcon()); if (smallIcon != nullptr) images.add (smallIcon.release()); + } + + void createiOSIconFiles (File appIconSet) const + { + const Array types (getiOSAppIconTypes()); + + OwnedArray images; + getIconImages (images); + + if (images.size() > 0) + { + for (int i = 0; i < types.size(); ++i) + { + const AppIconType type = types.getUnchecked(i); + const Image image (rescaleImageForIcon (*images.getFirst(), type.size)); + + MemoryOutputStream pngData; + PNGImageFormat pngFormat; + pngFormat.writeImageToStream (image, pngData); + + overwriteFileIfDifferentOrThrow (appIconSet.getChildFile (type.filename), pngData); + } + } + } + + void createIconFile() const + { + OwnedArray images; + getIconImages (images); if (images.size() > 0) { @@ -1322,33 +1349,55 @@ private: return JSON::toString (var (v)); } + struct AppIconType + { + const char* idiom; + const char* sizeString; + const char* filename; + const char* scale; + const int size; + }; + + Array getiOSAppIconTypes() const + { + Array types; + + types.add ({ "iphone", "29x29", "Icon-Small.png", "1x", 29 }); + types.add ({ "iphone", "29x29", "Icon-Small@2x.png", "2x", 58 }); + types.add ({ "iphone", "40x40", "Icon-Spotlight-40@2x.png", "2x", 80 }); + types.add ({ "iphone", "57x57", "Icon.png", "1x", 57 }); + types.add ({ "iphone", "57x57", "Icon@2x.png", "2x", 114 }); + types.add ({ "iphone", "60x60", "Icon-60@2x.png", "2x", 120 }); + types.add ({ "iphone", "60x60", "Icon-@3x.png", "3x", 180 }); + types.add ({ "ipad", "29x29", "Icon-Small-1.png", "1x", 29 }); + types.add ({ "ipad", "29x29", "Icon-Small@2x-1.png", "2x", 58 }); + types.add ({ "ipad", "40x40", "Icon-Spotlight-40.png", "1x", 40 }); + types.add ({ "ipad", "40x40", "Icon-Spotlight-40@2x-1.png", "2x", 80 }); + types.add ({ "ipad", "50x50", "Icon-Small-50.png", "1x", 50 }); + types.add ({ "ipad", "50x50", "Icon-Small-50@2x.png", "2x", 100 }); + types.add ({ "ipad", "72x72", "Icon-72.png", "1x", 72 }); + types.add ({ "ipad", "72x72", "Icon-72@2x.png", "2x", 144 }); + types.add ({ "ipad", "76x76", "Icon-76.png", "1x", 76 }); + types.add ({ "ipad", "76x76", "Icon-76@2x.png", "2x", 152 }); + + return types; + } + String getiOSAppIconContents() const { - struct ImageType - { - const char* idiom; - const char* size; - const char* scale; - }; + const Array types = getiOSAppIconTypes(); - const ImageType types[] = { { "iphone", "29x29", "2x" }, - { "iphone", "40x40", "2x" }, - { "iphone", "60x60", "2x" }, - { "iphone", "60x60", "3x" }, - { "ipad", "29x29", "1x" }, - { "ipad", "29x29", "2x" }, - { "ipad", "40x40", "1x" }, - { "ipad", "40x40", "2x" }, - { "ipad", "76x76", "1x" }, - { "ipad", "76x76", "2x" } }; var images; - for (size_t i = 0; i < sizeof (types) / sizeof (types[0]); ++i) + for (int i = 0; i < types.size(); ++i) { + AppIconType type = types.getUnchecked(i); + DynamicObject::Ptr d = new DynamicObject(); - d->setProperty ("idiom", types[i].idiom); - d->setProperty ("size", types[i].size); - d->setProperty ("scale", types[i].scale); + d->setProperty ("idiom", type.idiom); + d->setProperty ("size", type.sizeString); + d->setProperty ("filename", type.filename); + d->setProperty ("scale", type.scale); images.append (var (d)); } @@ -1391,7 +1440,9 @@ private: { File assets (getTargetFolder().getChildFile (project.getProjectFilenameRoot()).getChildFile ("Images.xcassets")); - overwriteFileIfDifferentOrThrow (assets.getChildFile ("AppIcon.appiconset") .getChildFile ("Contents.json"), getiOSAppIconContents()); + overwriteFileIfDifferentOrThrow (assets.getChildFile ("AppIcon.appiconset").getChildFile ("Contents.json"), getiOSAppIconContents()); + createiOSIconFiles (assets.getChildFile ("AppIcon.appiconset")); + overwriteFileIfDifferentOrThrow (assets.getChildFile ("LaunchImage.launchimage").getChildFile ("Contents.json"), getiOSLaunchImageContents()); RelativePath assetsPath (assets, getTargetFolder(), RelativePath::buildTargetFolder); From 512d0baf67987f67cedf5c3ed9aab89cf38d29af Mon Sep 17 00:00:00 2001 From: hogliux Date: Thu, 25 Jun 2015 09:34:57 +0100 Subject: [PATCH 3/5] Fix audio channel allocation issue on ALSA/linux --- .../juce_audio_devices/native/juce_linux_ALSA.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/modules/juce_audio_devices/native/juce_linux_ALSA.cpp b/modules/juce_audio_devices/native/juce_linux_ALSA.cpp index 241127a952..dbde72ed4e 100644 --- a/modules/juce_audio_devices/native/juce_linux_ALSA.cpp +++ b/modules/juce_audio_devices/native/juce_linux_ALSA.cpp @@ -486,14 +486,17 @@ public: sampleRate = newSampleRate; bufferSize = newBufferSize; - inputChannelBuffer.setSize (jmax ((int) minChansIn, inputChannels.getHighestBit()) + 1, bufferSize); + int maxInputsRequested = inputChannels.getHighestBit() + 1; + maxInputsRequested = jmax ((int) minChansIn, jmin ((int) maxChansIn, maxInputsRequested)); + + inputChannelBuffer.setSize (maxInputsRequested, bufferSize); inputChannelBuffer.clear(); inputChannelDataForCallback.clear(); currentInputChans.clear(); if (inputChannels.getHighestBit() >= 0) { - for (int i = 0; i <= jmax (inputChannels.getHighestBit(), (int) minChansIn); ++i) + for (int i = 0; i < maxInputsRequested; ++i) { if (inputChannels[i]) { @@ -505,14 +508,17 @@ public: ensureMinimumNumBitsSet (outputChannels, (int) minChansOut); - outputChannelBuffer.setSize (jmax ((int) minChansOut, outputChannels.getHighestBit()) + 1, bufferSize); + int maxOutputsRequested = outputChannels.getHighestBit() + 1; + maxOutputsRequested = jmax ((int) minChansOut, jmin ((int) maxChansOut, maxOutputsRequested)); + + outputChannelBuffer.setSize (maxOutputsRequested, bufferSize); outputChannelBuffer.clear(); outputChannelDataForCallback.clear(); currentOutputChans.clear(); if (outputChannels.getHighestBit() >= 0) { - for (int i = 0; i <= jmax (outputChannels.getHighestBit(), (int) minChansOut); ++i) + for (int i = 0; i < maxOutputsRequested; ++i) { if (outputChannels[i]) { From 2860f66953e646ffd49919e06fb0d45f5978dadf Mon Sep 17 00:00:00 2001 From: hogliux Date: Thu, 25 Jun 2015 09:44:17 +0100 Subject: [PATCH 4/5] Fix alignment edge cases of cue points in AIFF files --- modules/juce_audio_formats/codecs/juce_AiffAudioFormat.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/juce_audio_formats/codecs/juce_AiffAudioFormat.cpp b/modules/juce_audio_formats/codecs/juce_AiffAudioFormat.cpp index aac2633c75..9fb45ad228 100644 --- a/modules/juce_audio_formats/codecs/juce_AiffAudioFormat.cpp +++ b/modules/juce_audio_formats/codecs/juce_AiffAudioFormat.cpp @@ -341,10 +341,10 @@ namespace AiffFileHelpers out.writeByte ((char) labelLength + 1); out.write (label.toUTF8(), labelLength); out.writeByte (0); - } - if ((out.getDataSize() & 1) != 0) - out.writeByte (0); + if ((out.getDataSize() & 1) != 0) + out.writeByte (0); + } } } } From 9efbd199a6f09512d2154eb0b92bff4cb90b9002 Mon Sep 17 00:00:00 2001 From: jules Date: Thu, 25 Jun 2015 10:07:19 +0100 Subject: [PATCH 5/5] Fixes for file-filter separator token parsing on linux zenity and win32. --- modules/juce_gui_basics/native/juce_linux_FileChooser.cpp | 8 ++++---- modules/juce_gui_basics/native/juce_win32_FileChooser.cpp | 8 +++++++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/modules/juce_gui_basics/native/juce_linux_FileChooser.cpp b/modules/juce_gui_basics/native/juce_linux_FileChooser.cpp index 8ac190b535..d8f931facd 100644 --- a/modules/juce_gui_basics/native/juce_linux_FileChooser.cpp +++ b/modules/juce_gui_basics/native/juce_linux_FileChooser.cpp @@ -131,11 +131,11 @@ static void addZenityArgs (StringArray& args, String& separator, if (filters.isNotEmpty() && filters != "*" && filters != "*.*") { - args.add ("--file-filter"); - args.add (filters.replaceCharacter (';', ' ')); + StringArray tokens; + tokens.addTokens (filters, ";,|", "\""); - args.add ("--file-filter"); - args.add ("All files | *"); + for (int i = 0; i < tokens.size(); ++i) + args.add ("--file-filter='" + tokens[i] + "'"); } if (file.isDirectory()) diff --git a/modules/juce_gui_basics/native/juce_win32_FileChooser.cpp b/modules/juce_gui_basics/native/juce_win32_FileChooser.cpp index 2f7044ab50..2d3a2cee05 100644 --- a/modules/juce_gui_basics/native/juce_win32_FileChooser.cpp +++ b/modules/juce_gui_basics/native/juce_win32_FileChooser.cpp @@ -218,6 +218,8 @@ void FileChooser::showPlatformDialog (Array& results, const String& title_ info.customComponent->enterModalState(); } + const StringRef separatorTokens (";,|"); + const size_t filterSpaceNumChars = 2048; HeapBlock filters; filters.calloc (filterSpaceNumChars); @@ -225,6 +227,10 @@ void FileChooser::showPlatformDialog (Array& results, const String& title_ filter.copyToUTF16 (filters + (bytesWritten / sizeof (WCHAR)), ((filterSpaceNumChars - 1) * sizeof (WCHAR) - bytesWritten)); + for (int i = 0; i < filterSpaceNumChars; ++i) + if (separatorTokens.text.indexOf ((juce_wchar) filters[i]) >= 0) + filters[i] = 0; + OPENFILENAMEW of = { 0 }; String localPath (info.initialPath); @@ -249,7 +255,7 @@ void FileChooser::showPlatformDialog (Array& results, const String& title_ if (isSaveDialogue) { StringArray tokens; - tokens.addTokens (filter, ";,", "\"'"); + tokens.addTokens (filter, separatorTokens, "\"'"); tokens.trim(); tokens.removeEmptyStrings();