diff --git a/examples/DemoRunner/Builds/Android/app/build.gradle b/examples/DemoRunner/Builds/Android/app/build.gradle index 318db5511a..c384afbb24 100644 --- a/examples/DemoRunner/Builds/Android/app/build.gradle +++ b/examples/DemoRunner/Builds/Android/app/build.gradle @@ -25,8 +25,8 @@ android { externalNativeBuild { cmake { arguments "-DANDROID_TOOLCHAIN=clang", "-DANDROID_PLATFORM=android-23", "-DANDROID_STL=c++_static", "-DANDROID_CPP_FEATURES=exceptions rtti", "-DANDROID_ARM_MODE=arm", "-DANDROID_ARM_NEON=TRUE" - cFlags "-fsigned-char" - cppFlags "-fsigned-char", "-std=c++14" + cFlags "-fsigned-char", "-Wall", "-Wno-missing-field-initializers", "-Wshadow-all", "-Wstrict-aliasing", "-Wuninitialized", "-Wunused-parameter", "-Wsign-compare", "-Wint-conversion", "-Wconditional-uninitialized", "-Woverloaded-virtual", "-Wreorder", "-Wconstant-conversion", "-Wunused-private-field", "-Wbool-conversion", "-Wextra-semi", "-Wno-ignored-qualifiers", "-Wunreachable-code" + cppFlags "-fsigned-char", "-std=c++14", "-Wall", "-Wno-missing-field-initializers", "-Wshadow-all", "-Wstrict-aliasing", "-Wuninitialized", "-Wunused-parameter", "-Wsign-compare", "-Wint-conversion", "-Wconditional-uninitialized", "-Woverloaded-virtual", "-Wreorder", "-Wconstant-conversion", "-Wunused-private-field", "-Wbool-conversion", "-Wextra-semi", "-Wno-ignored-qualifiers", "-Wunreachable-code" } } } diff --git a/examples/DemoRunner/DemoRunner.jucer b/examples/DemoRunner/DemoRunner.jucer index e51f59c355..9a532a54c0 100644 --- a/examples/DemoRunner/DemoRunner.jucer +++ b/examples/DemoRunner/DemoRunner.jucer @@ -92,7 +92,8 @@ androidMinimumSDK="23" microphonePermissionNeeded="1" androidBluetoothNeeded="1" androidExternalReadNeeded="1" androidExternalWriteNeeded="1" androidEnableContentSharing="1" androidExtraAssetsFolder="../Assets" - smallIcon="YyqWd2" bigIcon="YyqWd2" cameraPermissionNeeded="1"> + smallIcon="YyqWd2" bigIcon="YyqWd2" cameraPermissionNeeded="1" + extraCompilerFlags="-Wall -Wno-missing-field-initializers -Wshadow-all -Wstrict-aliasing -Wuninitialized -Wunused-parameter -Wsign-compare -Wint-conversion -Wconditional-uninitialized -Woverloaded-virtual -Wreorder -Wconstant-conversion -Wunused-private-field -Wbool-conversion -Wextra-semi -Wno-ignored-qualifiers -Wunreachable-code"> diff --git a/examples/GUI/CameraDemo.h b/examples/GUI/CameraDemo.h index 6bf79a2d7b..dab3911fe3 100644 --- a/examples/GUI/CameraDemo.h +++ b/examples/GUI/CameraDemo.h @@ -245,7 +245,7 @@ private: { #if JUCE_ANDROID SafePointer safeThis (this); - cameraDevice->onErrorOccurred = [safeThis] (const String& error) mutable { if (safeThis) safeThis->errorOccurred (error); }; + cameraDevice->onErrorOccurred = [safeThis] (const String& cameraError) mutable { if (safeThis) safeThis->errorOccurred (cameraError); }; #endif cameraPreviewComp.reset (cameraDevice->createViewerComponent()); addAndMakeVisible (cameraPreviewComp.get()); diff --git a/modules/juce_audio_devices/native/juce_android_Audio.cpp b/modules/juce_audio_devices/native/juce_android_Audio.cpp index 7a58d65bf7..fe995ae433 100644 --- a/modules/juce_audio_devices/native/juce_android_Audio.cpp +++ b/modules/juce_audio_devices/native/juce_android_Audio.cpp @@ -34,7 +34,7 @@ namespace juce METHOD (flush, "flush", "()V") \ METHOD (write, "write", "([SII)I") \ -DECLARE_JNI_CLASS (AudioTrack, "android/media/AudioTrack"); +DECLARE_JNI_CLASS (AudioTrack, "android/media/AudioTrack") #undef JNI_CLASS_MEMBERS //============================================================================== @@ -47,14 +47,14 @@ DECLARE_JNI_CLASS (AudioTrack, "android/media/AudioTrack"); METHOD (read, "read", "([SII)I") \ METHOD (release, "release", "()V") \ -DECLARE_JNI_CLASS (AudioRecord, "android/media/AudioRecord"); +DECLARE_JNI_CLASS (AudioRecord, "android/media/AudioRecord") #undef JNI_CLASS_MEMBERS //============================================================================== #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ STATICFIELD (SDK_INT, "SDK_INT", "I") \ - DECLARE_JNI_CLASS (AndroidBuildVersion, "android/os/Build$VERSION"); + DECLARE_JNI_CLASS (AndroidBuildVersion, "android/os/Build$VERSION") #undef JNI_CLASS_MEMBERS //============================================================================== diff --git a/modules/juce_audio_devices/native/juce_android_OpenSL.cpp b/modules/juce_audio_devices/native/juce_android_OpenSL.cpp index 748fe6ff8d..d24b5b0285 100644 --- a/modules/juce_audio_devices/native/juce_android_OpenSL.cpp +++ b/modules/juce_audio_devices/native/juce_android_OpenSL.cpp @@ -872,10 +872,7 @@ public: lastError.clear(); - if (requestedSampleRate > 0) - sampleRate = (int) requestedSampleRate; - else - sampleRate = getNativeSampleRate(); + sampleRate = (int) (requestedSampleRate > 0 ? requestedSampleRate : getNativeSampleRate()); auto totalPreferredBufferSize = (bufferSize <= 0) ? getDefaultBufferSize() : bufferSize; auto nativeBufferSize = getNativeBufferSize(); diff --git a/modules/juce_audio_utils/native/juce_android_BluetoothMidiDevicePairingDialogue.cpp b/modules/juce_audio_utils/native/juce_android_BluetoothMidiDevicePairingDialogue.cpp index 0353e8412b..1911e83abc 100644 --- a/modules/juce_audio_utils/native/juce_android_BluetoothMidiDevicePairingDialogue.cpp +++ b/modules/juce_audio_utils/native/juce_android_BluetoothMidiDevicePairingDialogue.cpp @@ -35,7 +35,7 @@ namespace juce METHOD (getBluetoothDeviceStatus, "getBluetoothDeviceStatus", "(Ljava/lang/String;)I") \ METHOD (startStopScan, "startStopScan", "(Z)V") -DECLARE_JNI_CLASS (AndroidBluetoothManager, JUCE_ANDROID_ACTIVITY_CLASSPATH "$BluetoothManager"); +DECLARE_JNI_CLASS (AndroidBluetoothManager, JUCE_ANDROID_ACTIVITY_CLASSPATH "$BluetoothManager") #undef JNI_CLASS_MEMBERS //============================================================================== diff --git a/modules/juce_core/native/juce_android_Files.cpp b/modules/juce_core/native/juce_android_Files.cpp index 2b2c6457eb..180935429a 100644 --- a/modules/juce_core/native/juce_android_Files.cpp +++ b/modules/juce_core/native/juce_android_Files.cpp @@ -29,7 +29,7 @@ namespace juce METHOD (disconnect, "disconnect", "()V") \ METHOD (scanFile, "scanFile", "(Ljava/lang/String;Ljava/lang/String;)V") \ -DECLARE_JNI_CLASS (MediaScannerConnection, "android/media/MediaScannerConnection"); +DECLARE_JNI_CLASS (MediaScannerConnection, "android/media/MediaScannerConnection") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ @@ -37,7 +37,7 @@ DECLARE_JNI_CLASS (MediaScannerConnection, "android/media/MediaScannerConnection METHOD (openInputStream, "openInputStream", "(Landroid/net/Uri;)Ljava/io/InputStream;") \ METHOD (openOutputStream, "openOutputStream", "(Landroid/net/Uri;)Ljava/io/OutputStream;") -DECLARE_JNI_CLASS (ContentResolver, "android/content/ContentResolver"); +DECLARE_JNI_CLASS (ContentResolver, "android/content/ContentResolver") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ @@ -46,14 +46,14 @@ DECLARE_JNI_CLASS (ContentResolver, "android/content/ContentResolver"); METHOD (getString, "getString", "(I)Ljava/lang/String;") \ METHOD (close, "close", "()V") \ -DECLARE_JNI_CLASS (AndroidCursor, "android/database/Cursor"); +DECLARE_JNI_CLASS (AndroidCursor, "android/database/Cursor") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ STATICMETHOD (getExternalStorageDirectory, "getExternalStorageDirectory", "()Ljava/io/File;") \ STATICMETHOD (getExternalStoragePublicDirectory, "getExternalStoragePublicDirectory", "(Ljava/lang/String;)Ljava/io/File;") \ -DECLARE_JNI_CLASS (AndroidEnvironment, "android/os/Environment"); +DECLARE_JNI_CLASS (AndroidEnvironment, "android/os/Environment") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ @@ -61,7 +61,7 @@ DECLARE_JNI_CLASS (AndroidEnvironment, "android/os/Environment"); METHOD (flush, "flush", "()V") \ METHOD (write, "write", "([BII)V") -DECLARE_JNI_CLASS (AndroidOutputStream, "java/io/OutputStream"); +DECLARE_JNI_CLASS (AndroidOutputStream, "java/io/OutputStream") #undef JNI_CLASS_MEMBERS //============================================================================== diff --git a/modules/juce_core/native/juce_android_JNIHelpers.h b/modules/juce_core/native/juce_android_JNIHelpers.h index de74351696..5a6d83cd88 100644 --- a/modules/juce_core/native/juce_android_JNIHelpers.h +++ b/modules/juce_core/native/juce_android_JNIHelpers.h @@ -301,7 +301,7 @@ extern AndroidSystem android; METHOD (addAppPausedResumedListener, "addAppPausedResumedListener", "(L" JUCE_ANDROID_ACTIVITY_CLASSPATH "$AppPausedResumedListener;J)V") \ METHOD (removeAppPausedResumedListener, "removeAppPausedResumedListener", "(L" JUCE_ANDROID_ACTIVITY_CLASSPATH "$AppPausedResumedListener;J)V") -DECLARE_JNI_CLASS (JuceAppActivity, JUCE_ANDROID_ACTIVITY_CLASSPATH); +DECLARE_JNI_CLASS (JuceAppActivity, JUCE_ANDROID_ACTIVITY_CLASSPATH) #undef JNI_CLASS_MEMBERS //============================================================================== @@ -320,7 +320,7 @@ DECLARE_JNI_CLASS (AndroidAudioAttributesBuilder, "android/media/AudioAttributes METHOD (abandonAudioFocus, "abandonAudioFocus", "(Landroid/media/AudioManager$OnAudioFocusChangeListener;)I") \ METHOD (requestAudioFocus, "requestAudioFocus", "(Landroid/media/AudioManager$OnAudioFocusChangeListener;II)I") -DECLARE_JNI_CLASS (AndroidAudioManager, "android/media/AudioManager"); +DECLARE_JNI_CLASS (AndroidAudioManager, "android/media/AudioManager") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ @@ -332,19 +332,19 @@ DECLARE_JNI_CLASS (AndroidAudioManager, "android/media/AudioManager"); METHOD (recycle, "recycle", "()V") \ METHOD (setPixel, "setPixel", "(III)V") -DECLARE_JNI_CLASS (AndroidBitmap, "android/graphics/Bitmap"); +DECLARE_JNI_CLASS (AndroidBitmap, "android/graphics/Bitmap") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ STATICMETHOD (valueOf, "valueOf", "(Ljava/lang/String;)Landroid/graphics/Bitmap$Config;") -DECLARE_JNI_CLASS (AndroidBitmapConfig, "android/graphics/Bitmap$Config"); +DECLARE_JNI_CLASS (AndroidBitmapConfig, "android/graphics/Bitmap$Config") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ STATICMETHOD (decodeByteArray, "decodeByteArray", "([BII)Landroid/graphics/Bitmap;") -DECLARE_JNI_CLASS (AndroidBitmapFactory, "android/graphics/BitmapFactory"); +DECLARE_JNI_CLASS (AndroidBitmapFactory, "android/graphics/BitmapFactory") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ @@ -370,13 +370,13 @@ DECLARE_JNI_CLASS (AndroidBitmapFactory, "android/graphics/BitmapFactory"); METHOD (putString, "putString", "(Ljava/lang/String;Ljava/lang/String;)V") \ METHOD (putStringArrayList, "putStringArrayList", "(Ljava/lang/String;Ljava/util/ArrayList;)V") -DECLARE_JNI_CLASS (AndroidBundle, "android/os/Bundle"); +DECLARE_JNI_CLASS (AndroidBundle, "android/os/Bundle") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ STATICMETHOD (dumpReferenceTables, "dumpReferenceTables", "()V") - DECLARE_JNI_CLASS (AndroidDebug, "android/os/Debug"); + DECLARE_JNI_CLASS (AndroidDebug, "android/os/Debug") #undef JNI_CLASS_MEMBERS #define JUCE_LOG_JNI_REFERENCES_TABLE getEnv()->CallStaticVoidMethod (AndroidDebug, AndroidDebug.dumpReferenceTables); @@ -384,7 +384,7 @@ DECLARE_JNI_CLASS (AndroidBundle, "android/os/Bundle"); #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ METHOD (getRotation, "getRotation", "()I") -DECLARE_JNI_CLASS (AndroidDisplay, "android/view/Display"); +DECLARE_JNI_CLASS (AndroidDisplay, "android/view/Display") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ @@ -393,7 +393,7 @@ DECLARE_JNI_CLASS (AndroidDisplay, "android/view/Display"); METHOD (post, "post", "(Ljava/lang/Runnable;)Z") \ METHOD (postDelayed, "postDelayed", "(Ljava/lang/Runnable;J)Z") \ -DECLARE_JNI_CLASS (AndroidHandler, "android/os/Handler"); +DECLARE_JNI_CLASS (AndroidHandler, "android/os/Handler") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ @@ -403,7 +403,7 @@ DECLARE_JNI_CLASS (AndroidHandler, "android/os/Handler"); METHOD (quitSafely, "quitSafely", "()Z") \ METHOD (start, "start", "()V") -DECLARE_JNI_CLASS (AndroidHandlerThread, "android/os/HandlerThread"); +DECLARE_JNI_CLASS (AndroidHandlerThread, "android/os/HandlerThread") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ @@ -429,7 +429,7 @@ DECLARE_JNI_CLASS (AndroidHandlerThread, "android/os/HandlerThread"); METHOD (setPackage, "setPackage", "(Ljava/lang/String;)Landroid/content/Intent;") \ METHOD (setType, "setType", "(Ljava/lang/String;)Landroid/content/Intent;") \ -DECLARE_JNI_CLASS (AndroidIntent, "android/content/Intent"); +DECLARE_JNI_CLASS (AndroidIntent, "android/content/Intent") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ @@ -439,13 +439,13 @@ DECLARE_JNI_CLASS (AndroidIntent, "android/content/Intent"); METHOD (postTranslate, "postTranslate", "(FF)Z") \ METHOD (setValues, "setValues", "([F)V") -DECLARE_JNI_CLASS (AndroidMatrix, "android/graphics/Matrix"); +DECLARE_JNI_CLASS (AndroidMatrix, "android/graphics/Matrix") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ METHOD (getPackageInfo, "getPackageInfo", "(Ljava/lang/String;I)Landroid/content/pm/PackageInfo;") -DECLARE_JNI_CLASS (AndroidPackageManager, "android/content/pm/PackageManager"); +DECLARE_JNI_CLASS (AndroidPackageManager, "android/content/pm/PackageManager") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ @@ -461,20 +461,20 @@ DECLARE_JNI_CLASS (AndroidPackageManager, "android/content/pm/PackageManager"); METHOD (getTextPath, "getTextPath", "(Ljava/lang/String;IIFFLandroid/graphics/Path;)V") \ METHOD (setShader, "setShader", "(Landroid/graphics/Shader;)Landroid/graphics/Shader;") \ -DECLARE_JNI_CLASS (AndroidPaint, "android/graphics/Paint"); +DECLARE_JNI_CLASS (AndroidPaint, "android/graphics/Paint") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ STATICMETHOD (getActivity, "getActivity", "(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;") \ METHOD (getIntentSender, "getIntentSender", "()Landroid/content/IntentSender;") -DECLARE_JNI_CLASS (AndroidPendingIntent, "android/app/PendingIntent"); +DECLARE_JNI_CLASS (AndroidPendingIntent, "android/app/PendingIntent") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ METHOD (toString, "toString", "()Ljava/lang/String;") -DECLARE_JNI_CLASS (AndroidRange, "android/util/Range"); +DECLARE_JNI_CLASS (AndroidRange, "android/util/Range") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ @@ -484,7 +484,7 @@ DECLARE_JNI_CLASS (AndroidRange, "android/util/Range"); FIELD (top, "top", "I") \ FIELD (bottom, "bottom", "I") \ -DECLARE_JNI_CLASS (AndroidRect, "android/graphics/Rect"); +DECLARE_JNI_CLASS (AndroidRect, "android/graphics/Rect") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ @@ -498,14 +498,14 @@ DECLARE_JNI_CLASS (AndroidResources, "android/content/res/Resources") METHOD (getHeight, "getHeight", "()I") \ METHOD (getWidth, "getWidth", "()I") -DECLARE_JNI_CLASS (AndroidSize, "android/util/Size"); +DECLARE_JNI_CLASS (AndroidSize, "android/util/Size") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ STATICMETHOD (parse, "parse", "(Ljava/lang/String;)Landroid/net/Uri;") \ METHOD (toString, "toString", "()Ljava/lang/String;") -DECLARE_JNI_CLASS (AndroidUri, "android/net/Uri"); +DECLARE_JNI_CLASS (AndroidUri, "android/net/Uri") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ @@ -522,7 +522,7 @@ DECLARE_JNI_CLASS (AndroidUri, "android/net/Uri"); METHOD (invalidate, "invalidate", "(IIII)V") \ METHOD (setVisibility, "setVisibility", "(I)V") -DECLARE_JNI_CLASS (AndroidView, "android/view/View"); +DECLARE_JNI_CLASS (AndroidView, "android/view/View") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ @@ -535,7 +535,7 @@ DECLARE_JNI_CLASS (AndroidViewGroup, "android/view/ViewGroup") #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ METHOD (getDefaultDisplay, "getDefaultDisplay", "()Landroid/view/Display;") -DECLARE_JNI_CLASS (AndroidWindowManager, "android/view/WindowManager"); +DECLARE_JNI_CLASS (AndroidWindowManager, "android/view/WindowManager") #undef JNI_CLASS_MEMBERS //============================================================================== @@ -546,27 +546,27 @@ DECLARE_JNI_CLASS (AndroidWindowManager, "android/view/WindowManager"); METHOD (get, "get", "(I)Ljava/lang/Object;") \ METHOD (size, "size", "()I") -DECLARE_JNI_CLASS (JavaArrayList, "java/util/ArrayList"); +DECLARE_JNI_CLASS (JavaArrayList, "java/util/ArrayList") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ STATICMETHOD (valueOf, "valueOf", "(Z)Ljava/lang/Boolean;") \ METHOD (booleanValue, "booleanValue", "()Z") -DECLARE_JNI_CLASS (JavaBoolean, "java/lang/Boolean"); +DECLARE_JNI_CLASS (JavaBoolean, "java/lang/Boolean") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ METHOD (get, "get", "([B)Ljava/nio/ByteBuffer;") \ METHOD (remaining, "remaining", "()I") -DECLARE_JNI_CLASS (JavaByteBuffer, "java/nio/ByteBuffer"); +DECLARE_JNI_CLASS (JavaByteBuffer, "java/nio/ByteBuffer") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ METHOD (toString, "toString", "()Ljava/lang/String;") -DECLARE_JNI_CLASS (JavaCharSequence, "java/lang/CharSequence"); +DECLARE_JNI_CLASS (JavaCharSequence, "java/lang/CharSequence") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ @@ -586,13 +586,13 @@ DECLARE_JNI_CLASS (JavaCharSequence, "java/lang/CharSequence"); METHOD (getSuperclass, "getSuperclass", "()Ljava/lang/Class;") \ METHOD (getClassLoader, "getClassLoader", "()Ljava/lang/ClassLoader;") \ -DECLARE_JNI_CLASS (JavaClass, "java/lang/Class"); +DECLARE_JNI_CLASS (JavaClass, "java/lang/Class") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ METHOD (toString, "toString", "()Ljava/lang/String;") -DECLARE_JNI_CLASS (JavaEnum, "java/lang/Enum"); +DECLARE_JNI_CLASS (JavaEnum, "java/lang/Enum") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ @@ -600,7 +600,7 @@ DECLARE_JNI_CLASS (JavaEnum, "java/lang/Enum"); METHOD (getAbsolutePath, "getAbsolutePath", "()Ljava/lang/String;") \ METHOD (length, "length", "()J") -DECLARE_JNI_CLASS (JavaFile, "java/io/File"); +DECLARE_JNI_CLASS (JavaFile, "java/io/File") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ @@ -608,7 +608,7 @@ DECLARE_JNI_CLASS (JavaFile, "java/io/File"); METHOD (close, "close", "()V") \ METHOD (read, "read", "([B)I") -DECLARE_JNI_CLASS (JavaFileInputStream, "java/io/FileInputStream"); +DECLARE_JNI_CLASS (JavaFileInputStream, "java/io/FileInputStream") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ @@ -616,14 +616,14 @@ DECLARE_JNI_CLASS (JavaFileInputStream, "java/io/FileInputStream"); METHOD (close, "close", "()V") \ METHOD (write, "write", "([BII)V") -DECLARE_JNI_CLASS (JavaFileOutputStream, "java/io/FileOutputStream"); +DECLARE_JNI_CLASS (JavaFileOutputStream, "java/io/FileOutputStream") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ METHOD (constructor, "", "()V") \ METHOD (constructorWithCapacity, "", "(I)V") -DECLARE_JNI_CLASS (JavaHashMap, "java/util/HashMap"); +DECLARE_JNI_CLASS (JavaHashMap, "java/util/HashMap") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ @@ -631,27 +631,27 @@ DECLARE_JNI_CLASS (JavaHashMap, "java/util/HashMap"); STATICMETHOD (valueOf, "valueOf", "(I)Ljava/lang/Integer;") \ METHOD (intValue, "intValue", "()I") -DECLARE_JNI_CLASS (JavaInteger, "java/lang/Integer"); +DECLARE_JNI_CLASS (JavaInteger, "java/lang/Integer") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ METHOD (hasNext, "hasNext", "()Z") \ METHOD (next, "next", "()Ljava/lang/Object;") -DECLARE_JNI_CLASS (JavaIterator, "java/util/Iterator"); +DECLARE_JNI_CLASS (JavaIterator, "java/util/Iterator") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ METHOD (get, "get", "(I)Ljava/lang/Object;") \ METHOD (size, "size", "()I") -DECLARE_JNI_CLASS (JavaList, "java/util/List"); +DECLARE_JNI_CLASS (JavaList, "java/util/List") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ METHOD (constructor, "", "(J)V") -DECLARE_JNI_CLASS (JavaLong, "java/lang/Long"); +DECLARE_JNI_CLASS (JavaLong, "java/lang/Long") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ @@ -659,7 +659,7 @@ DECLARE_JNI_CLASS (JavaLong, "java/lang/Long"); METHOD (keySet, "keySet", "()Ljava/util/Set;") \ METHOD (put, "put", "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;") -DECLARE_JNI_CLASS (JavaMap, "java/util/Map"); +DECLARE_JNI_CLASS (JavaMap, "java/util/Map") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ @@ -671,7 +671,7 @@ DECLARE_JNI_CLASS (JavaMap, "java/util/Map"); METHOD (hashCode, "hashCode", "()I") \ METHOD (equals, "equals", "(Ljava/lang/Object;)Z") \ -DECLARE_JNI_CLASS (JavaMethod, "java/lang/reflect/Method"); +DECLARE_JNI_CLASS (JavaMethod, "java/lang/reflect/Method") #undef JNI_CLASS_MEMBERS @@ -680,7 +680,7 @@ DECLARE_JNI_CLASS (JavaMethod, "java/lang/reflect/Method"); METHOD (getClass, "getClass", "()Ljava/lang/Class;") \ METHOD (toString, "toString", "()Ljava/lang/String;") -DECLARE_JNI_CLASS (JavaObject, "java/lang/Object"); +DECLARE_JNI_CLASS (JavaObject, "java/lang/Object") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ @@ -688,14 +688,14 @@ DECLARE_JNI_CLASS (JavaObject, "java/lang/Object"); METHOD (iterator, "iterator", "()Ljava/util/Iterator;") \ METHOD (size, "size", "()I") -DECLARE_JNI_CLASS (JavaSet, "java/util/Set"); +DECLARE_JNI_CLASS (JavaSet, "java/util/Set") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ METHOD (concat, "concat", "(Ljava/lang/String;)Ljava/lang/String;") \ METHOD (getBytes, "getBytes", "()[B") -DECLARE_JNI_CLASS (JavaString, "java/lang/String"); +DECLARE_JNI_CLASS (JavaString, "java/lang/String") #undef JNI_CLASS_MEMBERS //============================================================================== diff --git a/modules/juce_core/native/juce_android_Network.cpp b/modules/juce_core/native/juce_android_Network.cpp index 6942cda4bc..13f97fecde 100644 --- a/modules/juce_core/native/juce_android_Network.cpp +++ b/modules/juce_core/native/juce_android_Network.cpp @@ -27,7 +27,7 @@ namespace juce METHOD (constructor, "", "()V") \ METHOD (toString, "toString", "()Ljava/lang/String;") \ -DECLARE_JNI_CLASS (StringBuffer, "java/lang/StringBuffer"); +DECLARE_JNI_CLASS (StringBuffer, "java/lang/StringBuffer") #undef JNI_CLASS_MEMBERS //============================================================================== @@ -40,7 +40,7 @@ DECLARE_JNI_CLASS (StringBuffer, "java/lang/StringBuffer"); METHOD (isExhausted, "isExhausted", "()Z") \ METHOD (setPosition, "setPosition", "(J)Z") \ -DECLARE_JNI_CLASS (HTTPStream, JUCE_ANDROID_ACTIVITY_CLASSPATH "$HTTPStream"); +DECLARE_JNI_CLASS (HTTPStream, JUCE_ANDROID_ACTIVITY_CLASSPATH "$HTTPStream") #undef JNI_CLASS_MEMBERS //============================================================================== @@ -48,7 +48,7 @@ DECLARE_JNI_CLASS (HTTPStream, JUCE_ANDROID_ACTIVITY_CLASSPATH "$HTTPStream"); METHOD (close, "close", "()V") \ METHOD (read, "read", "([BII)I") \ -DECLARE_JNI_CLASS (AndroidInputStream, "java/io/InputStream"); +DECLARE_JNI_CLASS (AndroidInputStream, "java/io/InputStream") #undef JNI_CLASS_MEMBERS //============================================================================== diff --git a/modules/juce_core/native/juce_android_SystemStats.cpp b/modules/juce_core/native/juce_android_SystemStats.cpp index 77e463a43b..ff2afa64ef 100644 --- a/modules/juce_core/native/juce_android_SystemStats.cpp +++ b/modules/juce_core/native/juce_android_SystemStats.cpp @@ -26,7 +26,7 @@ namespace juce #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ STATICMETHOD (newProxyInstance, "newProxyInstance", "(Ljava/lang/ClassLoader;[Ljava/lang/Class;Ljava/lang/reflect/InvocationHandler;)Ljava/lang/Object;") \ - DECLARE_JNI_CLASS (JavaProxy, "java/lang/reflect/Proxy"); + DECLARE_JNI_CLASS (JavaProxy, "java/lang/reflect/Proxy") #undef JNI_CLASS_MEMBERS JNIClassBase::JNIClassBase (const char* cp) : classPath (cp), classRef (0) @@ -364,7 +364,7 @@ namespace AndroidStatsHelpers #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ STATICMETHOD (getProperty, "getProperty", "(Ljava/lang/String;)Ljava/lang/String;") - DECLARE_JNI_CLASS (SystemClass, "java/lang/System"); + DECLARE_JNI_CLASS (SystemClass, "java/lang/System") #undef JNI_CLASS_MEMBERS static inline String getSystemProperty (const String& name) @@ -382,7 +382,7 @@ namespace AndroidStatsHelpers } #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) - DECLARE_JNI_CLASS (BuildClass, "android/os/Build"); + DECLARE_JNI_CLASS (BuildClass, "android/os/Build") #undef JNI_CLASS_MEMBERS static inline String getAndroidOsBuildValue (const char* fieldName) diff --git a/modules/juce_graphics/native/juce_android_Fonts.cpp b/modules/juce_graphics/native/juce_android_Fonts.cpp index e058f87cea..4e0c750d2d 100644 --- a/modules/juce_graphics/native/juce_android_Fonts.cpp +++ b/modules/juce_graphics/native/juce_android_Fonts.cpp @@ -98,7 +98,7 @@ bool TextLayout::createNativeLayout (const AttributedString&) STATICMETHOD (create, "create", "(Ljava/lang/String;I)Landroid/graphics/Typeface;") \ STATICMETHOD (createFromFile, "createFromFile", "(Ljava/lang/String;)Landroid/graphics/Typeface;") \ -DECLARE_JNI_CLASS (TypefaceClass, "android/graphics/Typeface"); +DECLARE_JNI_CLASS (TypefaceClass, "android/graphics/Typeface") #undef JNI_CLASS_MEMBERS //============================================================================== @@ -199,8 +199,8 @@ public: float getStringWidth (const String& text) override { JNIEnv* env = getEnv(); - const int numChars = CharPointer_UTF16::getBytesRequiredFor (text.getCharPointer()); - jfloatArray widths = env->NewFloatArray (numChars); + auto numChars = CharPointer_UTF16::getBytesRequiredFor (text.getCharPointer()); + jfloatArray widths = env->NewFloatArray ((int) numChars); const int numDone = paint.callIntMethod (AndroidPaint.getTextWidths, javaString (text).get(), widths); @@ -209,6 +209,7 @@ public: env->DeleteLocalRef (widths); float x = 0; + for (int i = 0; i < numDone; ++i) x += localWidths[i]; @@ -218,8 +219,8 @@ public: void getGlyphPositions (const String& text, Array& glyphs, Array& xOffsets) override { JNIEnv* env = getEnv(); - const int numChars = CharPointer_UTF16::getBytesRequiredFor (text.getCharPointer()); - jfloatArray widths = env->NewFloatArray (numChars); + auto numChars = CharPointer_UTF16::getBytesRequiredFor (text.getCharPointer()); + jfloatArray widths = env->NewFloatArray ((int) numChars); const int numDone = paint.callIntMethod (AndroidPaint.getTextWidths, javaString (text).get(), widths); @@ -230,8 +231,8 @@ public: auto s = text.getCharPointer(); xOffsets.add (0); - float x = 0; + for (int i = 0; i < numDone; ++i) { const float local = localWidths[i]; diff --git a/modules/juce_graphics/native/juce_android_GraphicsContext.cpp b/modules/juce_graphics/native/juce_android_GraphicsContext.cpp index 2b354b2921..a53a5a559e 100644 --- a/modules/juce_graphics/native/juce_android_GraphicsContext.cpp +++ b/modules/juce_graphics/native/juce_android_GraphicsContext.cpp @@ -41,6 +41,7 @@ namespace GraphicsHelpers return getEnv()->NewObject (AndroidPaint, AndroidPaint.constructor, constructorFlags); } + // const jobject createMatrix (JNIEnv* env, const AffineTransform& t) { jobject m = env->NewObject (AndroidMatrix, AndroidMatrix.constructor); diff --git a/modules/juce_gui_basics/native/juce_android_ContentSharer.cpp b/modules/juce_gui_basics/native/juce_android_ContentSharer.cpp index 6911527255..73dbfcbdee 100644 --- a/modules/juce_gui_basics/native/juce_android_ContentSharer.cpp +++ b/modules/juce_gui_basics/native/juce_android_ContentSharer.cpp @@ -30,13 +30,13 @@ namespace juce #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ FIELD (providers, "providers", "[Landroid/content/pm/ProviderInfo;") -DECLARE_JNI_CLASS (AndroidPackageInfo, "android/content/pm/PackageInfo"); +DECLARE_JNI_CLASS (AndroidPackageInfo, "android/content/pm/PackageInfo") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ FIELD (authority, "authority", "Ljava/lang/String;") -DECLARE_JNI_CLASS (AndroidProviderInfo, "android/content/pm/ProviderInfo"); +DECLARE_JNI_CLASS (AndroidProviderInfo, "android/content/pm/ProviderInfo") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ @@ -44,13 +44,13 @@ DECLARE_JNI_CLASS (AndroidProviderInfo, "android/content/pm/ProviderInfo"); METHOD (createInputStream, "createInputStream", "()Ljava/io/FileInputStream;") \ METHOD (getLength, "getLength", "()J") -DECLARE_JNI_CLASS (AssetFileDescriptor, "android/content/res/AssetFileDescriptor"); +DECLARE_JNI_CLASS (AssetFileDescriptor, "android/content/res/AssetFileDescriptor") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ METHOD (close, "close", "()V") -DECLARE_JNI_CLASS (JavaCloseable, "java/io/Closeable"); +DECLARE_JNI_CLASS (JavaCloseable, "java/io/Closeable") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ @@ -58,20 +58,20 @@ DECLARE_JNI_CLASS (JavaCloseable, "java/io/Closeable"); METHOD (startWatching, "startWatching", "()V") \ METHOD (stopWatching, "stopWatching", "()V") -DECLARE_JNI_CLASS (JuceContentProviderFileObserver, JUCE_ANDROID_SHARING_CONTENT_PROVIDER_CLASSPATH "$ProviderFileObserver"); +DECLARE_JNI_CLASS (JuceContentProviderFileObserver, JUCE_ANDROID_SHARING_CONTENT_PROVIDER_CLASSPATH "$ProviderFileObserver") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ METHOD (addRow, "addRow", "([Ljava/lang/Object;)V") \ METHOD (constructor, "", "(L" JUCE_ANDROID_SHARING_CONTENT_PROVIDER_CLASSPATH ";J[Ljava/lang/String;)V") -DECLARE_JNI_CLASS (JuceContentProviderFileObserverCursor, JUCE_ANDROID_SHARING_CONTENT_PROVIDER_CLASSPATH "$ProviderCursor"); +DECLARE_JNI_CLASS (JuceContentProviderFileObserverCursor, JUCE_ANDROID_SHARING_CONTENT_PROVIDER_CLASSPATH "$ProviderCursor") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ STATICMETHOD (open, "open", "(Ljava/io/File;I)Landroid/os/ParcelFileDescriptor;") -DECLARE_JNI_CLASS (ParcelFileDescriptor, "android/os/ParcelFileDescriptor"); +DECLARE_JNI_CLASS (ParcelFileDescriptor, "android/os/ParcelFileDescriptor") #undef JNI_CLASS_MEMBERS //============================================================================== diff --git a/modules/juce_gui_basics/native/juce_android_Windowing.cpp b/modules/juce_gui_basics/native/juce_android_Windowing.cpp index b7c1562a86..c8dd673bfa 100644 --- a/modules/juce_gui_basics/native/juce_android_Windowing.cpp +++ b/modules/juce_gui_basics/native/juce_android_Windowing.cpp @@ -200,7 +200,7 @@ JUCE_JNI_CALLBACK (JUCE_FIREBASE_MESSAGING_SERVICE_CLASSNAME, firebaseRemoteMess METHOD (drawBitmap, "drawBitmap", "([IIIFFIIZLandroid/graphics/Paint;)V") \ METHOD (getClipBounds, "getClipBounds", "()Landroid/graphics/Rect;") -DECLARE_JNI_CLASS (CanvasMinimal, "android/graphics/Canvas"); +DECLARE_JNI_CLASS (CanvasMinimal, "android/graphics/Canvas") #undef JNI_CLASS_MEMBERS //============================================================================== @@ -212,7 +212,7 @@ DECLARE_JNI_CLASS (CanvasMinimal, "android/graphics/Canvas"); METHOD (showKeyboard, "showKeyboard", "(Ljava/lang/String;)V") \ METHOD (setSystemUiVisibilityCompat, "setSystemUiVisibilityCompat", "(I)V") \ -DECLARE_JNI_CLASS (ComponentPeerView, JUCE_ANDROID_ACTIVITY_CLASSPATH "$ComponentPeerView"); +DECLARE_JNI_CLASS (ComponentPeerView, JUCE_ANDROID_ACTIVITY_CLASSPATH "$ComponentPeerView") #undef JNI_CLASS_MEMBERS diff --git a/modules/juce_gui_extra/native/juce_android_PushNotifications.cpp b/modules/juce_gui_extra/native/juce_android_PushNotifications.cpp index 4c01bb4a38..bf132b647f 100644 --- a/modules/juce_gui_extra/native/juce_android_PushNotifications.cpp +++ b/modules/juce_gui_extra/native/juce_android_PushNotifications.cpp @@ -42,13 +42,13 @@ namespace juce METHOD (setSound, "setSound", "(Landroid/net/Uri;Landroid/media/AudioAttributes;)V") \ METHOD (setVibrationPattern, "setVibrationPattern", "([J)V") -DECLARE_JNI_CLASS (NotificationChannel, "android/app/NotificationChannel"); +DECLARE_JNI_CLASS (NotificationChannel, "android/app/NotificationChannel") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ METHOD (constructor, "", "(Ljava/lang/String;Ljava/lang/CharSequence;)V") -DECLARE_JNI_CLASS (NotificationChannelGroup, "android/app/NotificationChannelGroup"); +DECLARE_JNI_CLASS (NotificationChannelGroup, "android/app/NotificationChannelGroup") #undef JNI_CLASS_MEMBERS #endif @@ -56,7 +56,7 @@ DECLARE_JNI_CLASS (NotificationChannelGroup, "android/app/NotificationChannelGro #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ FIELD (extras, "extras", "Landroid/os/Bundle;") -DECLARE_JNI_CLASS (AndroidNotification, "android/app/Notification"); +DECLARE_JNI_CLASS (AndroidNotification, "android/app/Notification") #undef JNI_CLASS_MEMBERS #endif @@ -67,7 +67,7 @@ DECLARE_JNI_CLASS (AndroidNotification, "android/app/Notification"); METHOD (constructor, "", "(ILjava/lang/CharSequence;Landroid/app/PendingIntent;)V") \ METHOD (build, "build", "()Landroid/app/Notification$Action;") -DECLARE_JNI_CLASS (NotificationActionBuilder, "android/app/Notification$Action$Builder"); +DECLARE_JNI_CLASS (NotificationActionBuilder, "android/app/Notification$Action$Builder") #undef JNI_CLASS_MEMBERS #endif @@ -92,7 +92,7 @@ DECLARE_JNI_CLASS (NotificationActionBuilder, "android/app/Notification$Action$B METHOD (setVibrate, "setVibrate", "([J)Landroid/app/Notification$Builder;") \ METHOD (setWhen, "setWhen", "(J)Landroid/app/Notification$Builder;") -DECLARE_JNI_CLASS (NotificationBuilderBase, "android/app/Notification$Builder"); +DECLARE_JNI_CLASS (NotificationBuilderBase, "android/app/Notification$Builder") #undef JNI_CLASS_MEMBERS #if __ANDROID_API__ >= 16 @@ -103,7 +103,7 @@ DECLARE_JNI_CLASS (NotificationBuilderBase, "android/app/Notification$Builder"); METHOD (setSubText, "setSubText", "(Ljava/lang/CharSequence;)Landroid/app/Notification$Builder;") \ METHOD (setUsesChronometer, "setUsesChronometer", "(Z)Landroid/app/Notification$Builder;") -DECLARE_JNI_CLASS (NotificationBuilderApi16, "android/app/Notification$Builder"); +DECLARE_JNI_CLASS (NotificationBuilderApi16, "android/app/Notification$Builder") #undef JNI_CLASS_MEMBERS #endif @@ -111,7 +111,7 @@ DECLARE_JNI_CLASS (NotificationBuilderApi16, "android/app/Notification$Builder") #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ METHOD (setShowWhen, "setShowWhen", "(Z)Landroid/app/Notification$Builder;") -DECLARE_JNI_CLASS (NotificationBuilderApi17, "android/app/Notification$Builder"); +DECLARE_JNI_CLASS (NotificationBuilderApi17, "android/app/Notification$Builder") #undef JNI_CLASS_MEMBERS #endif @@ -124,7 +124,7 @@ DECLARE_JNI_CLASS (NotificationBuilderApi17, "android/app/Notification$Builder") METHOD (setGroupSummary, "setGroupSummary", "(Z)Landroid/app/Notification$Builder;") \ METHOD (setSortKey, "setSortKey", "(Ljava/lang/String;)Landroid/app/Notification$Builder;") -DECLARE_JNI_CLASS (NotificationBuilderApi20, "android/app/Notification$Builder"); +DECLARE_JNI_CLASS (NotificationBuilderApi20, "android/app/Notification$Builder") #undef JNI_CLASS_MEMBERS #endif @@ -136,7 +136,7 @@ DECLARE_JNI_CLASS (NotificationBuilderApi20, "android/app/Notification$Builder") METHOD (setPublicVersion, "setPublicVersion", "(Landroid/app/Notification;)Landroid/app/Notification$Builder;") \ METHOD (setVisibility, "setVisibility", "(I)Landroid/app/Notification$Builder;") -DECLARE_JNI_CLASS (NotificationBuilderApi21, "android/app/Notification$Builder"); +DECLARE_JNI_CLASS (NotificationBuilderApi21, "android/app/Notification$Builder") #undef JNI_CLASS_MEMBERS #endif @@ -144,7 +144,7 @@ DECLARE_JNI_CLASS (NotificationBuilderApi21, "android/app/Notification$Builder") #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ METHOD (setChronometerCountDown, "setChronometerCountDown", "(Z)Landroid/app/Notification$Builder;") -DECLARE_JNI_CLASS (NotificationBuilderApi24, "android/app/Notification$Builder"); +DECLARE_JNI_CLASS (NotificationBuilderApi24, "android/app/Notification$Builder") #undef JNI_CLASS_MEMBERS #endif @@ -154,7 +154,7 @@ DECLARE_JNI_CLASS (NotificationBuilderApi24, "android/app/Notification$Builder") METHOD (setGroupAlertBehavior, "setGroupAlertBehavior", "(I)Landroid/app/Notification$Builder;") \ METHOD (setTimeoutAfter, "setTimeoutAfter", "(J)Landroid/app/Notification$Builder;") -DECLARE_JNI_CLASS (NotificationBuilderApi26, "android/app/Notification$Builder"); +DECLARE_JNI_CLASS (NotificationBuilderApi26, "android/app/Notification$Builder") #undef JNI_CLASS_MEMBERS #endif @@ -163,14 +163,14 @@ DECLARE_JNI_CLASS (NotificationBuilderApi26, "android/app/Notification$Builder") METHOD (cancelAll, "cancelAll", "()V") \ METHOD (notify, "notify", "(Ljava/lang/String;ILandroid/app/Notification;)V") -DECLARE_JNI_CLASS (NotificationManagerBase, "android/app/NotificationManager"); +DECLARE_JNI_CLASS (NotificationManagerBase, "android/app/NotificationManager") #undef JNI_CLASS_MEMBERS #if __ANDROID_API__ >= 23 #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ METHOD (getActiveNotifications, "getActiveNotifications", "()[Landroid/service/notification/StatusBarNotification;") -DECLARE_JNI_CLASS (NotificationManagerApi23, "android/app/NotificationManager"); +DECLARE_JNI_CLASS (NotificationManagerApi23, "android/app/NotificationManager") #undef JNI_CLASS_MEMBERS #endif @@ -178,7 +178,7 @@ DECLARE_JNI_CLASS (NotificationManagerApi23, "android/app/NotificationManager"); #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ METHOD (areNotificationsEnabled, "areNotificationsEnabled", "()Z") -DECLARE_JNI_CLASS (NotificationManagerApi24, "android/app/NotificationManager"); +DECLARE_JNI_CLASS (NotificationManagerApi24, "android/app/NotificationManager") #undef JNI_CLASS_MEMBERS #endif @@ -187,7 +187,7 @@ DECLARE_JNI_CLASS (NotificationManagerApi24, "android/app/NotificationManager"); METHOD (createNotificationChannel, "createNotificationChannel", "(Landroid/app/NotificationChannel;)V") \ METHOD (createNotificationChannelGroup, "createNotificationChannelGroup", "(Landroid/app/NotificationChannelGroup;)V") -DECLARE_JNI_CLASS (NotificationManagerApi26, "android/app/NotificationManager"); +DECLARE_JNI_CLASS (NotificationManagerApi26, "android/app/NotificationManager") #undef JNI_CLASS_MEMBERS #endif @@ -195,7 +195,7 @@ DECLARE_JNI_CLASS (NotificationManagerApi26, "android/app/NotificationManager"); #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ STATICMETHOD (getResultsFromIntent, "getResultsFromIntent", "(Landroid/content/Intent;)Landroid/os/Bundle;") -DECLARE_JNI_CLASS (RemoteInput, "android/app/RemoteInput"); +DECLARE_JNI_CLASS (RemoteInput, "android/app/RemoteInput") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ @@ -205,7 +205,7 @@ DECLARE_JNI_CLASS (RemoteInput, "android/app/RemoteInput"); METHOD (setChoices, "setChoices", "([Ljava/lang/CharSequence;)Landroid/app/RemoteInput$Builder;") \ METHOD (setLabel, "setLabel", "(Ljava/lang/CharSequence;)Landroid/app/RemoteInput$Builder;") -DECLARE_JNI_CLASS (RemoteInputBuilder, "android/app/RemoteInput$Builder"); +DECLARE_JNI_CLASS (RemoteInputBuilder, "android/app/RemoteInput$Builder") #undef JNI_CLASS_MEMBERS #endif @@ -213,7 +213,7 @@ DECLARE_JNI_CLASS (RemoteInputBuilder, "android/app/RemoteInput$Builder"); #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ METHOD (getNotification, "getNotification", "()Landroid/app/Notification;") - DECLARE_JNI_CLASS (StatusBarNotification, "android/service/notification/StatusBarNotification"); + DECLARE_JNI_CLASS (StatusBarNotification, "android/service/notification/StatusBarNotification") #undef JNI_CLASS_MEMBERS #endif @@ -223,7 +223,7 @@ DECLARE_JNI_CLASS (RemoteInputBuilder, "android/app/RemoteInput$Builder"); STATICMETHOD (getInstance, "getInstance", "()Lcom/google/firebase/iid/FirebaseInstanceId;") \ METHOD (getToken, "getToken", "()Ljava/lang/String;") - DECLARE_JNI_CLASS (FirebaseInstanceId, "com/google/firebase/iid/FirebaseInstanceId"); + DECLARE_JNI_CLASS (FirebaseInstanceId, "com/google/firebase/iid/FirebaseInstanceId") #undef JNI_CLASS_MEMBERS #endif @@ -234,7 +234,7 @@ DECLARE_JNI_CLASS (RemoteInputBuilder, "android/app/RemoteInput$Builder"); METHOD (subscribeToTopic, "subscribeToTopic", "(Ljava/lang/String;)V") \ METHOD (unsubscribeFromTopic, "unsubscribeFromTopic", "(Ljava/lang/String;)V") \ - DECLARE_JNI_CLASS (FirebaseMessaging, "com/google/firebase/messaging/FirebaseMessaging"); + DECLARE_JNI_CLASS (FirebaseMessaging, "com/google/firebase/messaging/FirebaseMessaging") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ @@ -248,7 +248,7 @@ DECLARE_JNI_CLASS (RemoteInputBuilder, "android/app/RemoteInput$Builder"); METHOD (getTo, "getTo", "()Ljava/lang/String;") \ METHOD (getTtl, "getTtl", "()I") - DECLARE_JNI_CLASS (RemoteMessage, "com/google/firebase/messaging/RemoteMessage"); + DECLARE_JNI_CLASS (RemoteMessage, "com/google/firebase/messaging/RemoteMessage") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ @@ -260,7 +260,7 @@ DECLARE_JNI_CLASS (RemoteInputBuilder, "android/app/RemoteInput$Builder"); METHOD (setMessageType, "setMessageType", "(Ljava/lang/String;)Lcom/google/firebase/messaging/RemoteMessage$Builder;") \ METHOD (setTtl, "setTtl", "(I)Lcom/google/firebase/messaging/RemoteMessage$Builder;") - DECLARE_JNI_CLASS (RemoteMessageBuilder, "com/google/firebase/messaging/RemoteMessage$Builder"); + DECLARE_JNI_CLASS (RemoteMessageBuilder, "com/google/firebase/messaging/RemoteMessage$Builder") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ @@ -277,7 +277,7 @@ DECLARE_JNI_CLASS (RemoteInputBuilder, "android/app/RemoteInput$Builder"); METHOD (getTitleLocalizationArgs, "getTitleLocalizationArgs", "()[Ljava/lang/String;") \ METHOD (getTitleLocalizationKey, "getTitleLocalizationKey", "()Ljava/lang/String;") - DECLARE_JNI_CLASS (RemoteMessageNotification, "com/google/firebase/messaging/RemoteMessage$Notification"); + DECLARE_JNI_CLASS (RemoteMessageNotification, "com/google/firebase/messaging/RemoteMessage$Notification") #undef JNI_CLASS_MEMBERS #endif diff --git a/modules/juce_gui_extra/native/juce_android_WebBrowserComponent.cpp b/modules/juce_gui_extra/native/juce_android_WebBrowserComponent.cpp index fab2c3e1da..8e79b41cc7 100644 --- a/modules/juce_gui_extra/native/juce_android_WebBrowserComponent.cpp +++ b/modules/juce_gui_extra/native/juce_android_WebBrowserComponent.cpp @@ -46,32 +46,32 @@ DECLARE_JNI_CLASS (AndroidWebView, "android/webkit/WebView") #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ METHOD (constructor, "", "()V") -DECLARE_JNI_CLASS (AndroidWebChromeClient, "android/webkit/WebChromeClient"); +DECLARE_JNI_CLASS (AndroidWebChromeClient, "android/webkit/WebChromeClient") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ METHOD (constructor, "", "()V") -DECLARE_JNI_CLASS (AndroidWebViewClient, "android/webkit/WebViewClient"); +DECLARE_JNI_CLASS (AndroidWebViewClient, "android/webkit/WebViewClient") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ STATICMETHOD (getInstance, "getInstance", "()Landroid/webkit/CookieManager;") -DECLARE_JNI_CLASS (AndroidCookieManager, "android/webkit/CookieManager"); +DECLARE_JNI_CLASS (AndroidCookieManager, "android/webkit/CookieManager") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ METHOD (constructor, "", "(L" JUCE_ANDROID_ACTIVITY_CLASSPATH ";J)V") -DECLARE_JNI_CLASS (JuceWebChromeClient, JUCE_ANDROID_ACTIVITY_CLASSPATH "$JuceWebChromeClient"); +DECLARE_JNI_CLASS (JuceWebChromeClient, JUCE_ANDROID_ACTIVITY_CLASSPATH "$JuceWebChromeClient") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ METHOD (constructor, "", "(L" JUCE_ANDROID_ACTIVITY_CLASSPATH ";J)V") \ METHOD (hostDeleted, "hostDeleted", "()V") -DECLARE_JNI_CLASS (JuceWebViewClient, JUCE_ANDROID_ACTIVITY_CLASSPATH "$JuceWebViewClient"); +DECLARE_JNI_CLASS (JuceWebViewClient, JUCE_ANDROID_ACTIVITY_CLASSPATH "$JuceWebViewClient") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ @@ -80,7 +80,7 @@ DECLARE_JNI_CLASS (JuceWebViewClient, JUCE_ANDROID_ACTIVITY_CLASSPATH "$JuceWebV METHOD (setJavaScriptEnabled, "setJavaScriptEnabled", "(Z)V") \ METHOD (setSupportMultipleWindows, "setSupportMultipleWindows", "(Z)V") -DECLARE_JNI_CLASS (WebSettings, "android/webkit/WebSettings"); +DECLARE_JNI_CLASS (WebSettings, "android/webkit/WebSettings") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ diff --git a/modules/juce_product_unlocking/native/juce_android_InAppPurchases.cpp b/modules/juce_product_unlocking/native/juce_android_InAppPurchases.cpp index 563f3cdc33..96ebbac9ad 100644 --- a/modules/juce_product_unlocking/native/juce_android_InAppPurchases.cpp +++ b/modules/juce_product_unlocking/native/juce_android_InAppPurchases.cpp @@ -36,13 +36,13 @@ namespace juce METHOD (consumePurchase, "consumePurchase", "(ILjava/lang/String;Ljava/lang/String;)I") \ METHOD (getPurchaseHistory, "getPurchaseHistory", "(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Landroid/os/Bundle;)Landroid/os/Bundle;") -DECLARE_JNI_CLASS (IInAppBillingService, "com/android/vending/billing/IInAppBillingService"); +DECLARE_JNI_CLASS (IInAppBillingService, "com/android/vending/billing/IInAppBillingService") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ STATICMETHOD (asInterface, "asInterface", "(Landroid/os/IBinder;)Lcom/android/vending/billing/IInAppBillingService;") \ -DECLARE_JNI_CLASS (IInAppBillingServiceStub, "com/android/vending/billing/IInAppBillingService$Stub"); +DECLARE_JNI_CLASS (IInAppBillingServiceStub, "com/android/vending/billing/IInAppBillingService$Stub") #undef JNI_CLASS_MEMBERS //============================================================================== diff --git a/modules/juce_video/capture/juce_CameraDevice.cpp b/modules/juce_video/capture/juce_CameraDevice.cpp index 636be58f25..35dbdd84bf 100644 --- a/modules/juce_video/capture/juce_CameraDevice.cpp +++ b/modules/juce_video/capture/juce_CameraDevice.cpp @@ -81,19 +81,19 @@ public: pendingOpen.device->pimpl->open ([this](const String& deviceId, const String& error) { - int index = getCameraIndex (deviceId); + int cIndex = getCameraIndex (deviceId); - if (index == -1) + if (cIndex == -1) return; - auto& pendingOpen = camerasToOpen.getReference (index); + auto& cameraPendingOpen = camerasToOpen.getReference (cIndex); if (error.isEmpty()) - pendingOpen.resultCallback (pendingOpen.device.release(), error); + cameraPendingOpen.resultCallback (cameraPendingOpen.device.release(), error); else - pendingOpen.resultCallback (nullptr, error); + cameraPendingOpen.resultCallback (nullptr, error); - int id = pendingOpen.requestId; + int id = cameraPendingOpen.requestId; MessageManager::callAsync ([this, id]() { removeRequestWithId (id); }); }); diff --git a/modules/juce_video/native/juce_android_CameraDevice.h b/modules/juce_video/native/juce_android_CameraDevice.h index 88334296d8..9ec4529c71 100644 --- a/modules/juce_video/native/juce_android_CameraDevice.h +++ b/modules/juce_video/native/juce_android_CameraDevice.h @@ -28,7 +28,7 @@ #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ STATICMETHOD (valueOf, "valueOf", "(Ljava/lang/String;)Landroid/graphics/Bitmap$CompressFormat;") -DECLARE_JNI_CLASS (AndroidBitmapCompressFormat, "android/graphics/Bitmap$CompressFormat"); +DECLARE_JNI_CLASS (AndroidBitmapCompressFormat, "android/graphics/Bitmap$CompressFormat") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ @@ -36,20 +36,20 @@ DECLARE_JNI_CLASS (AndroidBitmapCompressFormat, "android/graphics/Bitmap$Compres METHOD (createCaptureRequest, "createCaptureRequest", "(I)Landroid/hardware/camera2/CaptureRequest$Builder;") \ METHOD (createCaptureSession, "createCaptureSession", "(Ljava/util/List;Landroid/hardware/camera2/CameraCaptureSession$StateCallback;Landroid/os/Handler;)V") -DECLARE_JNI_CLASS (AndroidCameraDevice, "android/hardware/camera2/CameraDevice"); +DECLARE_JNI_CLASS (AndroidCameraDevice, "android/hardware/camera2/CameraDevice") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ METHOD (close, "close", "()V") \ METHOD (getPlanes, "getPlanes", "()[Landroid/media/Image$Plane;") -DECLARE_JNI_CLASS (AndroidImage, "android/media/Image"); +DECLARE_JNI_CLASS (AndroidImage, "android/media/Image") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ METHOD (getBuffer, "getBuffer", "()Ljava/nio/ByteBuffer;") -DECLARE_JNI_CLASS (AndroidImagePlane, "android/media/Image$Plane"); +DECLARE_JNI_CLASS (AndroidImagePlane, "android/media/Image$Plane") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ @@ -59,7 +59,7 @@ DECLARE_JNI_CLASS (AndroidImagePlane, "android/media/Image$Plane"); METHOD (setOnImageAvailableListener, "setOnImageAvailableListener", "(Landroid/media/ImageReader$OnImageAvailableListener;Landroid/os/Handler;)V") \ STATICMETHOD (newInstance, "newInstance", "(IIII)Landroid/media/ImageReader;") -DECLARE_JNI_CLASS (AndroidImageReader, "android/media/ImageReader"); +DECLARE_JNI_CLASS (AndroidImageReader, "android/media/ImageReader") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ @@ -82,7 +82,7 @@ DECLARE_JNI_CLASS (AndroidImageReader, "android/media/ImageReader"); METHOD (start, "start", "()V") \ METHOD (stop, "stop", "()V") -DECLARE_JNI_CLASS (AndroidMediaRecorder, "android/media/MediaRecorder"); +DECLARE_JNI_CLASS (AndroidMediaRecorder, "android/media/MediaRecorder") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ @@ -92,19 +92,19 @@ DECLARE_JNI_CLASS (AndroidMediaRecorder, "android/media/MediaRecorder"); METHOD (setSurfaceTextureListener, "setSurfaceTextureListener", "(Landroid/view/TextureView$SurfaceTextureListener;)V") \ METHOD (setTransform, "setTransform", "(Landroid/graphics/Matrix;)V") -DECLARE_JNI_CLASS (AndroidTextureView, "android/view/TextureView"); +DECLARE_JNI_CLASS (AndroidTextureView, "android/view/TextureView") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ METHOD (constructor, "", "(Landroid/graphics/SurfaceTexture;)V") -DECLARE_JNI_CLASS (AndroidSurface, "android/view/Surface"); +DECLARE_JNI_CLASS (AndroidSurface, "android/view/Surface") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ METHOD (setDefaultBufferSize, "setDefaultBufferSize", "(II)V") -DECLARE_JNI_CLASS (AndroidSurfaceTexture, "android/graphics/SurfaceTexture"); +DECLARE_JNI_CLASS (AndroidSurfaceTexture, "android/graphics/SurfaceTexture") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ @@ -113,7 +113,7 @@ DECLARE_JNI_CLASS (AndroidSurfaceTexture, "android/graphics/SurfaceTexture"); METHOD (isOutputSupportedFor, "isOutputSupportedFor", "(I)Z") \ METHOD (isOutputSupportedForSurface, "isOutputSupportedFor", "(Landroid/view/Surface;)Z") -DECLARE_JNI_CLASS (AndroidStreamConfigurationMap, "android/hardware/camera2/params/StreamConfigurationMap"); +DECLARE_JNI_CLASS (AndroidStreamConfigurationMap, "android/hardware/camera2/params/StreamConfigurationMap") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ @@ -121,7 +121,7 @@ DECLARE_JNI_CLASS (AndroidStreamConfigurationMap, "android/hardware/camera2/para METHOD (toByteArray, "toByteArray", "()[B") \ METHOD (size, "size", "()I") -DECLARE_JNI_CLASS (ByteArrayOutputStream, "java/io/ByteArrayOutputStream"); +DECLARE_JNI_CLASS (ByteArrayOutputStream, "java/io/ByteArrayOutputStream") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ @@ -137,13 +137,13 @@ DECLARE_JNI_CLASS (CameraCaptureSession, "android/hardware/camera2/CameraCapture #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ METHOD (constructor, "", "(L" JUCE_ANDROID_ACTIVITY_CLASSPATH ";JZ)V") -DECLARE_JNI_CLASS (CameraCaptureSessionCaptureCallback, JUCE_ANDROID_ACTIVITY_CLASSPATH "$CameraCaptureSessionCaptureCallback"); +DECLARE_JNI_CLASS (CameraCaptureSessionCaptureCallback, JUCE_ANDROID_ACTIVITY_CLASSPATH "$CameraCaptureSessionCaptureCallback") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ METHOD (constructor, "", "(L" JUCE_ANDROID_ACTIVITY_CLASSPATH ";J)V") -DECLARE_JNI_CLASS (CameraCaptureSessionStateCallback, JUCE_ANDROID_ACTIVITY_CLASSPATH "$CameraCaptureSessionStateCallback"); +DECLARE_JNI_CLASS (CameraCaptureSessionStateCallback, JUCE_ANDROID_ACTIVITY_CLASSPATH "$CameraCaptureSessionStateCallback") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ @@ -154,19 +154,19 @@ DECLARE_JNI_CLASS (CameraCaptureSessionStateCallback, JUCE_ANDROID_ACTIVITY_CLAS STATICFIELD (SCALER_STREAM_CONFIGURATION_MAP, "SCALER_STREAM_CONFIGURATION_MAP", "Landroid/hardware/camera2/CameraCharacteristics$Key;") \ STATICFIELD (SENSOR_ORIENTATION, "SENSOR_ORIENTATION", "Landroid/hardware/camera2/CameraCharacteristics$Key;") -DECLARE_JNI_CLASS (CameraCharacteristics, "android/hardware/camera2/CameraCharacteristics"); +DECLARE_JNI_CLASS (CameraCharacteristics, "android/hardware/camera2/CameraCharacteristics") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ METHOD (getName, "getName", "()Ljava/lang/String;") -DECLARE_JNI_CLASS (CameraCharacteristicsKey, "android/hardware/camera2/CameraCharacteristics$Key"); +DECLARE_JNI_CLASS (CameraCharacteristicsKey, "android/hardware/camera2/CameraCharacteristics$Key") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ METHOD (constructor, "", "(L" JUCE_ANDROID_ACTIVITY_CLASSPATH ";J)V") -DECLARE_JNI_CLASS (CameraDeviceStateCallback, JUCE_ANDROID_ACTIVITY_CLASSPATH "$CameraDeviceStateCallback"); +DECLARE_JNI_CLASS (CameraDeviceStateCallback, JUCE_ANDROID_ACTIVITY_CLASSPATH "$CameraDeviceStateCallback") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ @@ -174,7 +174,7 @@ DECLARE_JNI_CLASS (CameraDeviceStateCallback, JUCE_ANDROID_ACTIVITY_CLASSPATH "$ METHOD (getCameraIdList, "getCameraIdList", "()[Ljava/lang/String;") \ METHOD (openCamera, "openCamera", "(Ljava/lang/String;Landroid/hardware/camera2/CameraDevice$StateCallback;Landroid/os/Handler;)V") -DECLARE_JNI_CLASS (CameraManager, "android/hardware/camera2/CameraManager"); +DECLARE_JNI_CLASS (CameraManager, "android/hardware/camera2/CameraManager") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ @@ -183,7 +183,7 @@ DECLARE_JNI_CLASS (CameraManager, "android/hardware/camera2/CameraManager"); STATICFIELD (CONTROL_AF_TRIGGER, "CONTROL_AF_TRIGGER", "Landroid/hardware/camera2/CaptureRequest$Key;") \ STATICFIELD (CONTROL_MODE, "CONTROL_MODE", "Landroid/hardware/camera2/CaptureRequest$Key;") -DECLARE_JNI_CLASS (CaptureRequest, "android/hardware/camera2/CaptureRequest"); +DECLARE_JNI_CLASS (CaptureRequest, "android/hardware/camera2/CaptureRequest") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ @@ -191,7 +191,7 @@ DECLARE_JNI_CLASS (CaptureRequest, "android/hardware/camera2/CaptureRequest"); METHOD (build, "build", "()Landroid/hardware/camera2/CaptureRequest;") \ METHOD (set, "set", "(Landroid/hardware/camera2/CaptureRequest$Key;Ljava/lang/Object;)V") -DECLARE_JNI_CLASS (CaptureRequestBuilder, "android/hardware/camera2/CaptureRequest$Builder"); +DECLARE_JNI_CLASS (CaptureRequestBuilder, "android/hardware/camera2/CaptureRequest$Builder") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ @@ -199,7 +199,7 @@ DECLARE_JNI_CLASS (CaptureRequestBuilder, "android/hardware/camera2/CaptureReque STATICFIELD (CONTROL_AE_STATE, "CONTROL_AE_STATE", "Landroid/hardware/camera2/CaptureResult$Key;") \ STATICFIELD (CONTROL_AF_STATE, "CONTROL_AF_STATE", "Landroid/hardware/camera2/CaptureResult$Key;") -DECLARE_JNI_CLASS (CaptureResult, "android/hardware/camera2/CaptureResult"); +DECLARE_JNI_CLASS (CaptureResult, "android/hardware/camera2/CaptureResult") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ @@ -208,7 +208,7 @@ DECLARE_JNI_CLASS (CaptureResult, "android/hardware/camera2/CaptureResult"); METHOD (disable, "disable", "()V") \ METHOD (enable, "enable", "()V") -DECLARE_JNI_CLASS (OrientationEventListener, JUCE_ANDROID_ACTIVITY_CLASSPATH "$JuceOrientationEventListener"); +DECLARE_JNI_CLASS (OrientationEventListener, JUCE_ANDROID_ACTIVITY_CLASSPATH "$JuceOrientationEventListener") #undef JNI_CLASS_MEMBERS #endif @@ -692,9 +692,9 @@ private: JUCE_CAMERA_LOG ("Camera id: " + cameraId + ", characteristics keys num: " + String (size)); - for (int i = 0; i < size; ++i) + for (int ikey = 0; ikey < size; ++ikey) { - auto key = LocalRef (env->CallObjectMethod (keysList, JavaList.get, i)); + auto key = LocalRef (env->CallObjectMethod (keysList, JavaList.get, ikey)); auto jKeyName = LocalRef ((jstring) env->CallObjectMethod (key, CameraCharacteristicsKey.getName)); auto keyName = juceString (jKeyName); @@ -710,7 +710,7 @@ private: } else if (kvs.startsWith ("[Landroid.util.Range")) { - printRangeArrayElements (keyValue, keyName); + printRangeArrayElements (keyValue); } else { @@ -771,7 +771,7 @@ private: JUCE_CAMERA_LOG ("Key: " + keyName + ", value: " + result); } - static void printRangeArrayElements (const LocalRef& rangeArray, const String& keyName) + static void printRangeArrayElements (const LocalRef& rangeArray) { auto* env = getEnv(); @@ -797,8 +797,8 @@ private: class StreamConfigurationMap { public: - StreamConfigurationMap (const GlobalRef& cameraCharacteristics) - : scalerStreamConfigurationMap (getStreamConfigurationMap (cameraCharacteristics)), + StreamConfigurationMap (const GlobalRef& characteristics) + : scalerStreamConfigurationMap (getStreamConfigurationMap (characteristics)), supportedPreviewOutputSizes (retrieveOutputSizes (scalerStreamConfigurationMap, getClassForName ("android.graphics.SurfaceTexture"), -1)), @@ -838,14 +838,14 @@ private: Array> supportedVideoRecordingOutputSizes; Rectangle defaultPreviewSize, previewBufferSize; - GlobalRef getStreamConfigurationMap (const GlobalRef& cameraCharacteristics) + GlobalRef getStreamConfigurationMap (const GlobalRef& characteristics) { auto* env = getEnv(); auto scalerStreamConfigurationMapKey = LocalRef (env->GetStaticObjectField (CameraCharacteristics, CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP)); - return GlobalRef (LocalRef (env->CallObjectMethod (cameraCharacteristics, + return GlobalRef (LocalRef (env->CallObjectMethod (characteristics, CameraCharacteristics.get, scalerStreamConfigurationMapKey.get()))); } @@ -1222,8 +1222,6 @@ private: auto byteArray = LocalRef (env->NewByteArray (bufferSize)); env->CallObjectMethod (imagePlaneBuffer, JavaByteBuffer.get, byteArray.get()); - auto orientationsEnabled = Desktop::getInstance().getOrientationsEnabled() & ~Desktop::upsideDown; - auto rotationAngle = getRotationAngle (deviceOrientationFromAccelerometerSensor, targetOrientation, cameraLensFrontFacing, cameraSensorOrientation); @@ -1268,8 +1266,6 @@ private: bool cameraLensFrontFacing, int cameraSensorOrientation) { - auto orientationsEnabled = Desktop::getInstance().getOrientationsEnabled() & ~Desktop::upsideDown; - auto isSensorOrientationHorizontal = deviceOrientationFromAccelerometerSensor == Desktop::rotatedAntiClockwise || deviceOrientationFromAccelerometerSensor == Desktop::rotatedClockwise; @@ -1312,8 +1308,6 @@ private: auto origBitmapWidth = env->CallIntMethod (origBitmap, AndroidBitmap.getWidth); auto origBitmapHeight = env->CallIntMethod (origBitmap, AndroidBitmap.getHeight); - auto orientationsEnabled = Desktop::getInstance().getOrientationsEnabled() & ~Desktop::upsideDown; - auto matrix = LocalRef (env->NewObject (AndroidMatrix, AndroidMatrix.constructor)); env->CallBooleanMethod (matrix, AndroidMatrix.postRotate, (jfloat) rotationAngle, (jfloat) 0, (jfloat) 0); @@ -1748,8 +1742,6 @@ private: if (jniCheckHasExceptionOccurredAndClear()) return; - auto* env = getEnv(); - switch (currentState) { case State::pendingFocusLock: diff --git a/modules/juce_video/native/juce_android_Video.h b/modules/juce_video/native/juce_android_Video.h index 789877585c..e691fb5cfd 100644 --- a/modules/juce_video/native/juce_android_Video.h +++ b/modules/juce_video/native/juce_android_Video.h @@ -31,13 +31,13 @@ METHOD (setVolumeTo, "setVolumeTo", "(II)V") \ METHOD (unregisterCallback, "unregisterCallback", "(Landroid/media/session/MediaController$Callback;)V") -DECLARE_JNI_CLASS (AndroidMediaController, "android/media/session/MediaController"); +DECLARE_JNI_CLASS (AndroidMediaController, "android/media/session/MediaController") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ METHOD (constructor, "", "(L" JUCE_ANDROID_ACTIVITY_CLASSPATH ";J)V") \ -DECLARE_JNI_CLASS (AndroidMediaControllerCallback, JUCE_ANDROID_ACTIVITY_CLASSPATH "$MediaControllerCallback"); +DECLARE_JNI_CLASS (AndroidMediaControllerCallback, JUCE_ANDROID_ACTIVITY_CLASSPATH "$MediaControllerCallback") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ @@ -45,7 +45,7 @@ DECLARE_JNI_CLASS (AndroidMediaControllerCallback, JUCE_ANDROID_ACTIVITY_CLASSPA METHOD (getCurrentVolume, "getCurrentVolume", "()I") \ METHOD (getMaxVolume, "getMaxVolume", "()I") -DECLARE_JNI_CLASS (AndroidMediaControllerPlaybackInfo, "android/media/session/MediaController$PlaybackInfo"); +DECLARE_JNI_CLASS (AndroidMediaControllerPlaybackInfo, "android/media/session/MediaController$PlaybackInfo") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ @@ -55,7 +55,7 @@ DECLARE_JNI_CLASS (AndroidMediaControllerPlaybackInfo, "android/media/session/Me METHOD (seekTo, "seekTo", "(J)V") \ METHOD (stop, "stop", "()V") -DECLARE_JNI_CLASS (AndroidMediaControllerTransportControls, "android/media/session/MediaController$TransportControls"); +DECLARE_JNI_CLASS (AndroidMediaControllerTransportControls, "android/media/session/MediaController$TransportControls") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ @@ -84,7 +84,7 @@ DECLARE_JNI_CLASS (AndroidMediaControllerTransportControls, "android/media/sessi METHOD (start, "start", "()V") \ METHOD (stop, "stop", "()V") -DECLARE_JNI_CLASS (AndroidMediaPlayer, "android/media/MediaPlayer"); +DECLARE_JNI_CLASS (AndroidMediaPlayer, "android/media/MediaPlayer") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ @@ -99,13 +99,13 @@ DECLARE_JNI_CLASS (AndroidMediaPlayer, "android/media/MediaPlayer"); METHOD (setPlaybackState, "setPlaybackState", "(Landroid/media/session/PlaybackState;)V") \ METHOD (setPlaybackToLocal, "setPlaybackToLocal", "(Landroid/media/AudioAttributes;)V") -DECLARE_JNI_CLASS (AndroidMediaSession, "android/media/session/MediaSession"); +DECLARE_JNI_CLASS (AndroidMediaSession, "android/media/session/MediaSession") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ METHOD (constructor, "", "(L" JUCE_ANDROID_ACTIVITY_CLASSPATH ";J)V") \ -DECLARE_JNI_CLASS (AndroidMediaSessionCallback, JUCE_ANDROID_ACTIVITY_CLASSPATH "$MediaSessionCallback"); +DECLARE_JNI_CLASS (AndroidMediaSessionCallback, JUCE_ANDROID_ACTIVITY_CLASSPATH "$MediaSessionCallback") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ @@ -113,14 +113,14 @@ DECLARE_JNI_CLASS (AndroidMediaSessionCallback, JUCE_ANDROID_ACTIVITY_CLASSPATH METHOD (constructor, "", "()V") \ METHOD (putLong, "putLong", "(Ljava/lang/String;J)Landroid/media/MediaMetadata$Builder;") -DECLARE_JNI_CLASS (AndroidMediaMetadataBuilder, "android/media/MediaMetadata$Builder"); +DECLARE_JNI_CLASS (AndroidMediaMetadataBuilder, "android/media/MediaMetadata$Builder") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ METHOD (getSpeed, "getSpeed", "()F") \ METHOD (setSpeed, "setSpeed", "(F)Landroid/media/PlaybackParams;") -DECLARE_JNI_CLASS (AndroidPlaybackParams, "android/media/PlaybackParams"); +DECLARE_JNI_CLASS (AndroidPlaybackParams, "android/media/PlaybackParams") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ @@ -130,7 +130,7 @@ DECLARE_JNI_CLASS (AndroidPlaybackParams, "android/media/PlaybackParams"); METHOD (getPosition, "getPosition", "()J") \ METHOD (getState, "getState", "()I") -DECLARE_JNI_CLASS (AndroidPlaybackState, "android/media/session/PlaybackState"); +DECLARE_JNI_CLASS (AndroidPlaybackState, "android/media/session/PlaybackState") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ @@ -140,14 +140,14 @@ DECLARE_JNI_CLASS (AndroidPlaybackState, "android/media/session/PlaybackState"); METHOD (setErrorMessage, "setErrorMessage", "(Ljava/lang/CharSequence;)Landroid/media/session/PlaybackState$Builder;") \ METHOD (setState, "setState", "(IJF)Landroid/media/session/PlaybackState$Builder;") -DECLARE_JNI_CLASS (AndroidPlaybackStateBuilder, "android/media/session/PlaybackState$Builder"); +DECLARE_JNI_CLASS (AndroidPlaybackStateBuilder, "android/media/session/PlaybackState$Builder") #undef JNI_CLASS_MEMBERS #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ METHOD (constructor, "", "(L" JUCE_ANDROID_ACTIVITY_CLASSPATH ";Landroid/app/Activity;J)V") \ METHOD (setEnabled, "setEnabled", "(Z)V") -DECLARE_JNI_CLASS (SystemVolumeObserver, JUCE_ANDROID_ACTIVITY_CLASSPATH "$SystemVolumeObserver"); +DECLARE_JNI_CLASS (SystemVolumeObserver, JUCE_ANDROID_ACTIVITY_CLASSPATH "$SystemVolumeObserver") #undef JNI_CLASS_MEMBERS #endif @@ -575,9 +575,9 @@ private: class Controller { public: - Controller (MediaSession& ownerToUse, jobject nativeController) + Controller (MediaSession& ownerToUse, jobject nativeControllerToUse) : owner (ownerToUse), - nativeController (GlobalRef (nativeController)), + nativeController (GlobalRef (nativeControllerToUse)), controllerTransportControls (LocalRef (getEnv()->CallObjectMethod (nativeController, AndroidMediaController.getTransportControls))), controllerCallback (LocalRef (getEnv()->NewObject (AndroidMediaControllerCallback, @@ -1302,7 +1302,7 @@ private: auto playPos = player.getPlayPosition(); auto durationMs = player.getVideoDuration(); - int playPosPercent = 100 * playPos / static_cast (durationMs); + auto playPosPercent = (int) (100 * playPos / static_cast (durationMs)); // NB: assuming the playback will start roughly when there is 5% of content loaded... return ! bufferedRegions.containsRange (Range (playPosPercent, jmin (101, playPosPercent + 5))); @@ -1353,7 +1353,7 @@ private: auto playPos = player.getPlayPosition(); auto durationMs = player.getVideoDuration(); - int playPosPercent = 100 * playPos / static_cast (durationMs); + auto playPosPercent = (int) (100 * playPos / static_cast (durationMs)); bufferedRegions.addRange (Range (playPosPercent, progress + 1)); @@ -1675,7 +1675,7 @@ private: mediaSession.setDisplay (surfaceHolder); } - void videoSurfaceDestroyed (jobject surfaceHolder) + void videoSurfaceDestroyed (jobject /*surfaceHolder*/) { mediaSession.setDisplay (nullptr); }