Browse Source

Merge branch 'master' of github.com:julianstorer/JUCE

pull/4/head
falkTX 10 years ago
parent
commit
ee306859eb
7 changed files with 101 additions and 38 deletions
  1. +1
    -1
      examples/AudioAppExample/Source/MainComponent.cpp
  2. +1
    -1
      examples/BouncingBallWavetableDemo/Source/MainComponent.cpp
  3. +75
    -24
      extras/Introjucer/Source/Project Saving/jucer_ProjectExport_XCode.h
  4. +10
    -4
      modules/juce_audio_devices/native/juce_linux_ALSA.cpp
  5. +3
    -3
      modules/juce_audio_formats/codecs/juce_AiffAudioFormat.cpp
  6. +4
    -4
      modules/juce_gui_basics/native/juce_linux_FileChooser.cpp
  7. +7
    -1
      modules/juce_gui_basics/native/juce_win32_FileChooser.cpp

+ 1
- 1
examples/AudioAppExample/Source/MainComponent.cpp View File

@@ -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.
}


+ 1
- 1
examples/BouncingBallWavetableDemo/Source/MainComponent.cpp View File

@@ -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();
}


+ 75
- 24
extras/Introjucer/Source/Project Saving/jucer_ProjectExport_XCode.h View File

@@ -530,10 +530,8 @@ private:
out << data;
}
void createIconFile() const
void getIconImages (OwnedArray<Drawable>& images) const
{
OwnedArray<Drawable> images;
ScopedPointer<Drawable> bigIcon (getBigIcon());
if (bigIcon != nullptr)
images.add (bigIcon.release());
@@ -541,6 +539,35 @@ private:
ScopedPointer<Drawable> smallIcon (getSmallIcon());
if (smallIcon != nullptr)
images.add (smallIcon.release());
}
void createiOSIconFiles (File appIconSet) const
{
const Array<AppIconType> types (getiOSAppIconTypes());
OwnedArray<Drawable> 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<Drawable> 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<AppIconType> getiOSAppIconTypes() const
{
Array<AppIconType> 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<AppIconType> 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);


+ 10
- 4
modules/juce_audio_devices/native/juce_linux_ALSA.cpp View File

@@ -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])
{


+ 3
- 3
modules/juce_audio_formats/codecs/juce_AiffAudioFormat.cpp View File

@@ -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);
}
}
}
}


+ 4
- 4
modules/juce_gui_basics/native/juce_linux_FileChooser.cpp View File

@@ -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())


+ 7
- 1
modules/juce_gui_basics/native/juce_win32_FileChooser.cpp View File

@@ -218,6 +218,8 @@ void FileChooser::showPlatformDialog (Array<File>& results, const String& title_
info.customComponent->enterModalState();
}
const StringRef separatorTokens (";,|");
const size_t filterSpaceNumChars = 2048;
HeapBlock<WCHAR> filters;
filters.calloc (filterSpaceNumChars);
@@ -225,6 +227,10 @@ void FileChooser::showPlatformDialog (Array<File>& 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<File>& results, const String& title_
if (isSaveDialogue)
{
StringArray tokens;
tokens.addTokens (filter, ";,", "\"'");
tokens.addTokens (filter, separatorTokens, "\"'");
tokens.trim();
tokens.removeEmptyStrings();


Loading…
Cancel
Save