diff --git a/juce_amalgamated.cpp b/juce_amalgamated.cpp index c9fe6be1a6..8ae7c293c6 100644 --- a/juce_amalgamated.cpp +++ b/juce_amalgamated.cpp @@ -44648,9 +44648,9 @@ public: { String::CharPointerType t (text.getCharPointer()); int charNumInFile = 0; - bool finished = t.isEmpty(); + bool finished = false; - while (! finished) + while (! (finished || t.isEmpty())) { String::CharPointerType startOfLine (t); int startOfLineInFile = charNumInFile; @@ -44711,12 +44711,15 @@ public: String::CharPointerType t (line.getCharPointer()); - while (! t.isEmpty()) + for (;;) { - ++lineLength; - const juce_wchar c = t.getAndAdvance(); + if (c == 0) + break; + + ++lineLength; + if (c != '\n' && c != '\r') lineLengthWithoutNewLines = lineLength; } @@ -268808,17 +268811,15 @@ namespace FileHelpers return [[NSURL fileURLWithPath: juceStringToNS (path)] getResourceValue: &hidden forKey: NSURLIsHiddenKey error: &err] && [hidden boolValue]; - #else - #if JUCE_IOS + #elif JUCE_IOS return File (path).getFileName().startsWithChar ('.'); - #else + #else FSRef ref; LSItemInfoRecord info; return FSPathMakeRefWithOptions ((const UInt8*) path.toUTF8().getAddress(), kFSPathMakeRefDoNotFollowLeafSymlink, &ref, 0) == noErr && LSCopyItemInfoForRef (&ref, kLSRequestBasicFlagsOnly, &info) == noErr && (info.flags & kLSItemInfoIsInvisible) != 0; - #endif #endif } @@ -283439,6 +283440,8 @@ BEGIN_JUCE_NAMESPACE JAVACLASS (matrixClass, "android/graphics/Matrix") \ JAVACLASS (rectClass, "android/graphics/Rect") \ JAVACLASS (typefaceClass, "android/graphics/Typeface") \ + JAVACLASS (audioTrackClass, "android/media/AudioTrack") \ + JAVACLASS (audioRecordClass, "android/media/AudioRecord") \ // List of extra classes needed when USE_ANDROID_CANVAS is enabled #if ! USE_ANDROID_CANVAS @@ -283513,6 +283516,14 @@ BEGIN_JUCE_NAMESPACE FIELD (rectClass, rectRight, "right", "I") \ FIELD (rectClass, rectTop, "top", "I") \ FIELD (rectClass, rectBottom, "bottom", "I") \ +\ + METHOD (audioTrackClass, audioTrackConstructor, "", "(IIIIII)V") \ + METHOD (audioTrackClass, audioTrackPlay, "play", "()V") \ + METHOD (audioTrackClass, audioTrackStop, "stop", "()V") \ + METHOD (audioTrackClass, audioTrackRelease, "release", "()V") \ + METHOD (audioTrackClass, audioTrackFlush, "flush", "()V") \ + METHOD (audioTrackClass, audioTrackWrite, "write", "([SII)I") \ + STATICMETHOD (audioTrackClass, getMinBufferSize, "getMinBufferSize", "(III)I") \ // List of extra methods needed when USE_ANDROID_CANVAS is enabled #if ! USE_ANDROID_CANVAS diff --git a/src/gui/components/code_editor/juce_CodeDocument.cpp b/src/gui/components/code_editor/juce_CodeDocument.cpp index 9678b7d8d0..2c3f68ad26 100644 --- a/src/gui/components/code_editor/juce_CodeDocument.cpp +++ b/src/gui/components/code_editor/juce_CodeDocument.cpp @@ -50,9 +50,9 @@ public: { String::CharPointerType t (text.getCharPointer()); int charNumInFile = 0; - bool finished = t.isEmpty(); + bool finished = false; - while (! finished) + while (! (finished || t.isEmpty())) { String::CharPointerType startOfLine (t); int startOfLineInFile = charNumInFile; @@ -113,12 +113,15 @@ public: String::CharPointerType t (line.getCharPointer()); - while (! t.isEmpty()) + for (;;) { - ++lineLength; - const juce_wchar c = t.getAndAdvance(); + if (c == 0) + break; + + ++lineLength; + if (c != '\n' && c != '\r') lineLengthWithoutNewLines = lineLength; } diff --git a/src/native/android/juce_android_NativeCode.cpp b/src/native/android/juce_android_NativeCode.cpp index f00e7edb6c..861c8ec916 100644 --- a/src/native/android/juce_android_NativeCode.cpp +++ b/src/native/android/juce_android_NativeCode.cpp @@ -109,6 +109,8 @@ BEGIN_JUCE_NAMESPACE JAVACLASS (matrixClass, "android/graphics/Matrix") \ JAVACLASS (rectClass, "android/graphics/Rect") \ JAVACLASS (typefaceClass, "android/graphics/Typeface") \ + JAVACLASS (audioTrackClass, "android/media/AudioTrack") \ + JAVACLASS (audioRecordClass, "android/media/AudioRecord") \ //============================================================================== // List of extra classes needed when USE_ANDROID_CANVAS is enabled @@ -186,6 +188,14 @@ BEGIN_JUCE_NAMESPACE FIELD (rectClass, rectRight, "right", "I") \ FIELD (rectClass, rectTop, "top", "I") \ FIELD (rectClass, rectBottom, "bottom", "I") \ +\ + METHOD (audioTrackClass, audioTrackConstructor, "", "(IIIIII)V") \ + METHOD (audioTrackClass, audioTrackPlay, "play", "()V") \ + METHOD (audioTrackClass, audioTrackStop, "stop", "()V") \ + METHOD (audioTrackClass, audioTrackRelease, "release", "()V") \ + METHOD (audioTrackClass, audioTrackFlush, "flush", "()V") \ + METHOD (audioTrackClass, audioTrackWrite, "write", "([SII)I") \ + STATICMETHOD (audioTrackClass, getMinBufferSize, "getMinBufferSize", "(III)I") \ //============================================================================== diff --git a/src/native/mac/juce_mac_Files.mm b/src/native/mac/juce_mac_Files.mm index 7651bacb66..e9444dcb60 100644 --- a/src/native/mac/juce_mac_Files.mm +++ b/src/native/mac/juce_mac_Files.mm @@ -85,17 +85,15 @@ namespace FileHelpers return [[NSURL fileURLWithPath: juceStringToNS (path)] getResourceValue: &hidden forKey: NSURLIsHiddenKey error: &err] && [hidden boolValue]; - #else - #if JUCE_IOS + #elif JUCE_IOS return File (path).getFileName().startsWithChar ('.'); - #else + #else FSRef ref; LSItemInfoRecord info; return FSPathMakeRefWithOptions ((const UInt8*) path.toUTF8().getAddress(), kFSPathMakeRefDoNotFollowLeafSymlink, &ref, 0) == noErr && LSCopyItemInfoForRef (&ref, kLSRequestBasicFlagsOnly, &info) == noErr && (info.flags & kLSItemInfoIsInvisible) != 0; - #endif #endif }