Browse Source

Re-saved all projects.

tags/2021-05-28
Lukasz Kozakiewicz 8 years ago
parent
commit
c4ebfcd735
13 changed files with 253 additions and 53 deletions
  1. +24
    -4
      examples/AnalyticsCollection/Builds/Android/app/src/main/java/com/yourcompany/analyticscollection/AnalyticsCollection.java
  2. +4
    -4
      examples/DSPDemo/JuceLibraryCode/BinaryData.cpp
  3. +2
    -2
      examples/DSPDemo/JuceLibraryCode/BinaryData.h
  4. +24
    -4
      examples/Demo/Builds/Android/app/src/main/java/com/roli/jucedemo/JuceDemo.java
  5. +24
    -4
      examples/InAppPurchase/Builds/Android/app/src/main/java/com/roli/juceinapppurchasesample/InAppPurchase.java
  6. +24
    -4
      examples/MidiTest/Builds/Android/app/src/main/java/com/yourcompany/miditest/MidiTest.java
  7. +24
    -4
      examples/NetworkGraphicsDemo/Builds/Android/app/src/main/java/com/juce/networkgraphicsdemo/JUCENetworkGraphicsDemo.java
  8. +24
    -4
      examples/OSCReceiver/Builds/Android/app/src/main/java/com/yourcompany/oscreceiver/OSCReceiver.java
  9. +24
    -4
      examples/OSCSender/Builds/Android/app/src/main/java/com/yourcompany/oscsender/OSCSender.java
  10. +24
    -4
      examples/PushNotificationsDemo/Builds/Android/app/src/main/java/com/juce/pushnotificationsdemo/PushNotificationsDemo.java
  11. +24
    -4
      examples/audio plugin demo/Builds/Android/app/src/main/java/com/juce/jucedemoplugin/JuceDemoPlugin.java
  12. +24
    -4
      extras/AudioPerformanceTest/Builds/Android/app/src/main/java/com/juce/audioperformancetest/AudioPerformanceTest.java
  13. +7
    -7
      modules/juce_core/native/java/JuceAppActivity.java

+ 24
- 4
examples/AnalyticsCollection/Builds/Android/app/src/main/java/com/yourcompany/analyticscollection/AnalyticsCollection.java View File

@@ -1037,15 +1037,29 @@ public class AnalyticsCollection extends Activity
//============================================================================== //==============================================================================
public static class NativeInvocationHandler implements InvocationHandler public static class NativeInvocationHandler implements InvocationHandler
{ {
public NativeInvocationHandler (long nativeContextRef)
public NativeInvocationHandler (Activity activityToUse, long nativeContextRef)
{ {
activity = activityToUse;
nativeContext = nativeContextRef; nativeContext = nativeContextRef;
} }
public void nativeContextDeleted()
{
nativeContext = 0;
}
@Override @Override
public void finalize() public void finalize()
{ {
dispatchFinalize (nativeContext);
activity.runOnUiThread (new Runnable()
{
@Override
public void run()
{
if (nativeContext != 0)
dispatchFinalize (nativeContext);
}
});
} }
@Override @Override
@@ -1055,15 +1069,21 @@ public class AnalyticsCollection extends Activity
} }
//============================================================================== //==============================================================================
Activity activity;
private long nativeContext = 0; private long nativeContext = 0;
private native void dispatchFinalize (long nativeContextRef); private native void dispatchFinalize (long nativeContextRef);
private native Object dispatchInvoke (long nativeContextRef, Object proxy, Method method, Object[] args); private native Object dispatchInvoke (long nativeContextRef, Object proxy, Method method, Object[] args);
} }
public static InvocationHandler createInvocationHandler (long nativeContextRef)
public InvocationHandler createInvocationHandler (long nativeContextRef)
{
return new NativeInvocationHandler (this, nativeContextRef);
}
public void invocationHandlerContextDeleted (InvocationHandler handler)
{ {
return new NativeInvocationHandler (nativeContextRef);
((NativeInvocationHandler) handler).nativeContextDeleted();
} }
//============================================================================== //==============================================================================


+ 4
- 4
examples/DSPDemo/JuceLibraryCode/BinaryData.cpp View File

@@ -1560,7 +1560,7 @@ static const unsigned char temp_binary_data_3[] =
" {\r\n" " {\r\n"
" bypass = false;\r\n" " bypass = false;\r\n"
"\r\n" "\r\n"
" auto maxSize = static_cast<size_t> (roundDoubleToInt (8192.0 * sampleRate / 44100.0));\r\n"
" auto maxSize = static_cast<size_t> (roundToInt (sampleRate * (8192.0 / 44100.0)));\r\n"
"\r\n" "\r\n"
" if (cabinetTypeParameter->getCurrentSelectedID() == 2)\r\n" " if (cabinetTypeParameter->getCurrentSelectedID() == 2)\r\n"
" convolution.loadImpulseResponse (BinaryData::guitar_amp_wav,\r\n" " convolution.loadImpulseResponse (BinaryData::guitar_amp_wav,\r\n"
@@ -2235,7 +2235,7 @@ static const unsigned char temp_binary_data_10[] =
"\r\n" "\r\n"
" ChoiceParameter typeParam {{ \"Low-pass\", \"Band-pass\", \"High-pass\"}, 1, \"Type\" };\r\n" " ChoiceParameter typeParam {{ \"Low-pass\", \"Band-pass\", \"High-pass\"}, 1, \"Type\" };\r\n"
" SliderParameter cutoffParam {{ 20.0, 20000.0 }, 0.5, 440.0f, \"Cutoff\", \"Hz\" };\r\n" " SliderParameter cutoffParam {{ 20.0, 20000.0 }, 0.5, 440.0f, \"Cutoff\", \"Hz\" };\r\n"
" SliderParameter qParam {{ 0.3, 20.0 }, 0.5, 1.0 / std::sqrt (2.0), \"Resonance\" };\r\n"
" SliderParameter qParam {{ 0.3, 20.0 }, 0.5, 1.0 / MathConstants<double>::sqrt2, \"Resonance\" };\r\n"
"\r\n" "\r\n"
" std::vector<DSPDemoParameterBase*> parameters { &typeParam, &cutoffParam, &qParam };\r\n" " std::vector<DSPDemoParameterBase*> parameters { &typeParam, &cutoffParam, &qParam };\r\n"
" double sampleRate = 0;\r\n" " double sampleRate = 0;\r\n"
@@ -2325,14 +2325,14 @@ const char* getNamedResource (const char* resourceNameUTF8, int& numBytes) throw
case 0x409ff6ec: numBytes = 37902; return cassette_recorder_wav; case 0x409ff6ec: numBytes = 37902; return cassette_recorder_wav;
case 0x69523d16: numBytes = 628; return EditorColourScheme_xml; case 0x69523d16: numBytes = 628; return EditorColourScheme_xml;
case 0x700ccf3c: numBytes = 90246; return guitar_amp_wav; case 0x700ccf3c: numBytes = 90246; return guitar_amp_wav;
case 0x5922ccdf: numBytes = 3011; return ConvolutionDemo_cpp;
case 0x5922ccdf: numBytes = 3007; return ConvolutionDemo_cpp;
case 0x14aa0aae: numBytes = 2674; return FIRFilterDemo_cpp; case 0x14aa0aae: numBytes = 2674; return FIRFilterDemo_cpp;
case 0xab621a06: numBytes = 1809; return GainDemo_cpp; case 0xab621a06: numBytes = 1809; return GainDemo_cpp;
case 0x06a7a4b1: numBytes = 2819; return IIRFilterDemo_cpp; case 0x06a7a4b1: numBytes = 2819; return IIRFilterDemo_cpp;
case 0x6fc33e27: numBytes = 3986; return OscillatorDemo_cpp; case 0x6fc33e27: numBytes = 3986; return OscillatorDemo_cpp;
case 0xdfdc547d: numBytes = 3039; return OverdriveDemo_cpp; case 0xdfdc547d: numBytes = 3039; return OverdriveDemo_cpp;
case 0x3f21e597: numBytes = 4849; return SIMDRegisterDemo_cpp; case 0x3f21e597: numBytes = 4849; return SIMDRegisterDemo_cpp;
case 0x54e9f84c: numBytes = 2718; return StateVariableFilterDemo_cpp;
case 0x54e9f84c: numBytes = 2731; return StateVariableFilterDemo_cpp;
case 0x5ce06dd8: numBytes = 2037; return WaveShaperTanhDemo_cpp; case 0x5ce06dd8: numBytes = 2037; return WaveShaperTanhDemo_cpp;
default: break; default: break;
} }


+ 2
- 2
examples/DSPDemo/JuceLibraryCode/BinaryData.h View File

@@ -18,7 +18,7 @@ namespace BinaryData
const int guitar_amp_wavSize = 90246; const int guitar_amp_wavSize = 90246;
extern const char* ConvolutionDemo_cpp; extern const char* ConvolutionDemo_cpp;
const int ConvolutionDemo_cppSize = 3011;
const int ConvolutionDemo_cppSize = 3007;
extern const char* FIRFilterDemo_cpp; extern const char* FIRFilterDemo_cpp;
const int FIRFilterDemo_cppSize = 2674; const int FIRFilterDemo_cppSize = 2674;
@@ -39,7 +39,7 @@ namespace BinaryData
const int SIMDRegisterDemo_cppSize = 4849; const int SIMDRegisterDemo_cppSize = 4849;
extern const char* StateVariableFilterDemo_cpp; extern const char* StateVariableFilterDemo_cpp;
const int StateVariableFilterDemo_cppSize = 2718;
const int StateVariableFilterDemo_cppSize = 2731;
extern const char* WaveShaperTanhDemo_cpp; extern const char* WaveShaperTanhDemo_cpp;
const int WaveShaperTanhDemo_cppSize = 2037; const int WaveShaperTanhDemo_cppSize = 2037;


+ 24
- 4
examples/Demo/Builds/Android/app/src/main/java/com/roli/jucedemo/JuceDemo.java View File

@@ -1037,15 +1037,29 @@ public class JuceDemo extends Activity
//============================================================================== //==============================================================================
public static class NativeInvocationHandler implements InvocationHandler public static class NativeInvocationHandler implements InvocationHandler
{ {
public NativeInvocationHandler (long nativeContextRef)
public NativeInvocationHandler (Activity activityToUse, long nativeContextRef)
{ {
activity = activityToUse;
nativeContext = nativeContextRef; nativeContext = nativeContextRef;
} }
public void nativeContextDeleted()
{
nativeContext = 0;
}
@Override @Override
public void finalize() public void finalize()
{ {
dispatchFinalize (nativeContext);
activity.runOnUiThread (new Runnable()
{
@Override
public void run()
{
if (nativeContext != 0)
dispatchFinalize (nativeContext);
}
});
} }
@Override @Override
@@ -1055,15 +1069,21 @@ public class JuceDemo extends Activity
} }
//============================================================================== //==============================================================================
Activity activity;
private long nativeContext = 0; private long nativeContext = 0;
private native void dispatchFinalize (long nativeContextRef); private native void dispatchFinalize (long nativeContextRef);
private native Object dispatchInvoke (long nativeContextRef, Object proxy, Method method, Object[] args); private native Object dispatchInvoke (long nativeContextRef, Object proxy, Method method, Object[] args);
} }
public static InvocationHandler createInvocationHandler (long nativeContextRef)
public InvocationHandler createInvocationHandler (long nativeContextRef)
{
return new NativeInvocationHandler (this, nativeContextRef);
}
public void invocationHandlerContextDeleted (InvocationHandler handler)
{ {
return new NativeInvocationHandler (nativeContextRef);
((NativeInvocationHandler) handler).nativeContextDeleted();
} }
//============================================================================== //==============================================================================


+ 24
- 4
examples/InAppPurchase/Builds/Android/app/src/main/java/com/roli/juceinapppurchasesample/InAppPurchase.java View File

@@ -1037,15 +1037,29 @@ public class InAppPurchase extends Activity
//============================================================================== //==============================================================================
public static class NativeInvocationHandler implements InvocationHandler public static class NativeInvocationHandler implements InvocationHandler
{ {
public NativeInvocationHandler (long nativeContextRef)
public NativeInvocationHandler (Activity activityToUse, long nativeContextRef)
{ {
activity = activityToUse;
nativeContext = nativeContextRef; nativeContext = nativeContextRef;
} }
public void nativeContextDeleted()
{
nativeContext = 0;
}
@Override @Override
public void finalize() public void finalize()
{ {
dispatchFinalize (nativeContext);
activity.runOnUiThread (new Runnable()
{
@Override
public void run()
{
if (nativeContext != 0)
dispatchFinalize (nativeContext);
}
});
} }
@Override @Override
@@ -1055,15 +1069,21 @@ public class InAppPurchase extends Activity
} }
//============================================================================== //==============================================================================
Activity activity;
private long nativeContext = 0; private long nativeContext = 0;
private native void dispatchFinalize (long nativeContextRef); private native void dispatchFinalize (long nativeContextRef);
private native Object dispatchInvoke (long nativeContextRef, Object proxy, Method method, Object[] args); private native Object dispatchInvoke (long nativeContextRef, Object proxy, Method method, Object[] args);
} }
public static InvocationHandler createInvocationHandler (long nativeContextRef)
public InvocationHandler createInvocationHandler (long nativeContextRef)
{
return new NativeInvocationHandler (this, nativeContextRef);
}
public void invocationHandlerContextDeleted (InvocationHandler handler)
{ {
return new NativeInvocationHandler (nativeContextRef);
((NativeInvocationHandler) handler).nativeContextDeleted();
} }
//============================================================================== //==============================================================================


+ 24
- 4
examples/MidiTest/Builds/Android/app/src/main/java/com/yourcompany/miditest/MidiTest.java View File

@@ -1969,15 +1969,29 @@ public class MidiTest extends Activity
//============================================================================== //==============================================================================
public static class NativeInvocationHandler implements InvocationHandler public static class NativeInvocationHandler implements InvocationHandler
{ {
public NativeInvocationHandler (long nativeContextRef)
public NativeInvocationHandler (Activity activityToUse, long nativeContextRef)
{ {
activity = activityToUse;
nativeContext = nativeContextRef; nativeContext = nativeContextRef;
} }
public void nativeContextDeleted()
{
nativeContext = 0;
}
@Override @Override
public void finalize() public void finalize()
{ {
dispatchFinalize (nativeContext);
activity.runOnUiThread (new Runnable()
{
@Override
public void run()
{
if (nativeContext != 0)
dispatchFinalize (nativeContext);
}
});
} }
@Override @Override
@@ -1987,15 +2001,21 @@ public class MidiTest extends Activity
} }
//============================================================================== //==============================================================================
Activity activity;
private long nativeContext = 0; private long nativeContext = 0;
private native void dispatchFinalize (long nativeContextRef); private native void dispatchFinalize (long nativeContextRef);
private native Object dispatchInvoke (long nativeContextRef, Object proxy, Method method, Object[] args); private native Object dispatchInvoke (long nativeContextRef, Object proxy, Method method, Object[] args);
} }
public static InvocationHandler createInvocationHandler (long nativeContextRef)
public InvocationHandler createInvocationHandler (long nativeContextRef)
{
return new NativeInvocationHandler (this, nativeContextRef);
}
public void invocationHandlerContextDeleted (InvocationHandler handler)
{ {
return new NativeInvocationHandler (nativeContextRef);
((NativeInvocationHandler) handler).nativeContextDeleted();
} }
//============================================================================== //==============================================================================


+ 24
- 4
examples/NetworkGraphicsDemo/Builds/Android/app/src/main/java/com/juce/networkgraphicsdemo/JUCENetworkGraphicsDemo.java View File

@@ -1037,15 +1037,29 @@ public class JUCENetworkGraphicsDemo extends Activity
//============================================================================== //==============================================================================
public static class NativeInvocationHandler implements InvocationHandler public static class NativeInvocationHandler implements InvocationHandler
{ {
public NativeInvocationHandler (long nativeContextRef)
public NativeInvocationHandler (Activity activityToUse, long nativeContextRef)
{ {
activity = activityToUse;
nativeContext = nativeContextRef; nativeContext = nativeContextRef;
} }
public void nativeContextDeleted()
{
nativeContext = 0;
}
@Override @Override
public void finalize() public void finalize()
{ {
dispatchFinalize (nativeContext);
activity.runOnUiThread (new Runnable()
{
@Override
public void run()
{
if (nativeContext != 0)
dispatchFinalize (nativeContext);
}
});
} }
@Override @Override
@@ -1055,15 +1069,21 @@ public class JUCENetworkGraphicsDemo extends Activity
} }
//============================================================================== //==============================================================================
Activity activity;
private long nativeContext = 0; private long nativeContext = 0;
private native void dispatchFinalize (long nativeContextRef); private native void dispatchFinalize (long nativeContextRef);
private native Object dispatchInvoke (long nativeContextRef, Object proxy, Method method, Object[] args); private native Object dispatchInvoke (long nativeContextRef, Object proxy, Method method, Object[] args);
} }
public static InvocationHandler createInvocationHandler (long nativeContextRef)
public InvocationHandler createInvocationHandler (long nativeContextRef)
{
return new NativeInvocationHandler (this, nativeContextRef);
}
public void invocationHandlerContextDeleted (InvocationHandler handler)
{ {
return new NativeInvocationHandler (nativeContextRef);
((NativeInvocationHandler) handler).nativeContextDeleted();
} }
//============================================================================== //==============================================================================


+ 24
- 4
examples/OSCReceiver/Builds/Android/app/src/main/java/com/yourcompany/oscreceiver/OSCReceiver.java View File

@@ -1037,15 +1037,29 @@ public class OSCReceiver extends Activity
//============================================================================== //==============================================================================
public static class NativeInvocationHandler implements InvocationHandler public static class NativeInvocationHandler implements InvocationHandler
{ {
public NativeInvocationHandler (long nativeContextRef)
public NativeInvocationHandler (Activity activityToUse, long nativeContextRef)
{ {
activity = activityToUse;
nativeContext = nativeContextRef; nativeContext = nativeContextRef;
} }
public void nativeContextDeleted()
{
nativeContext = 0;
}
@Override @Override
public void finalize() public void finalize()
{ {
dispatchFinalize (nativeContext);
activity.runOnUiThread (new Runnable()
{
@Override
public void run()
{
if (nativeContext != 0)
dispatchFinalize (nativeContext);
}
});
} }
@Override @Override
@@ -1055,15 +1069,21 @@ public class OSCReceiver extends Activity
} }
//============================================================================== //==============================================================================
Activity activity;
private long nativeContext = 0; private long nativeContext = 0;
private native void dispatchFinalize (long nativeContextRef); private native void dispatchFinalize (long nativeContextRef);
private native Object dispatchInvoke (long nativeContextRef, Object proxy, Method method, Object[] args); private native Object dispatchInvoke (long nativeContextRef, Object proxy, Method method, Object[] args);
} }
public static InvocationHandler createInvocationHandler (long nativeContextRef)
public InvocationHandler createInvocationHandler (long nativeContextRef)
{
return new NativeInvocationHandler (this, nativeContextRef);
}
public void invocationHandlerContextDeleted (InvocationHandler handler)
{ {
return new NativeInvocationHandler (nativeContextRef);
((NativeInvocationHandler) handler).nativeContextDeleted();
} }
//============================================================================== //==============================================================================


+ 24
- 4
examples/OSCSender/Builds/Android/app/src/main/java/com/yourcompany/oscsender/OSCSender.java View File

@@ -1037,15 +1037,29 @@ public class OSCSender extends Activity
//============================================================================== //==============================================================================
public static class NativeInvocationHandler implements InvocationHandler public static class NativeInvocationHandler implements InvocationHandler
{ {
public NativeInvocationHandler (long nativeContextRef)
public NativeInvocationHandler (Activity activityToUse, long nativeContextRef)
{ {
activity = activityToUse;
nativeContext = nativeContextRef; nativeContext = nativeContextRef;
} }
public void nativeContextDeleted()
{
nativeContext = 0;
}
@Override @Override
public void finalize() public void finalize()
{ {
dispatchFinalize (nativeContext);
activity.runOnUiThread (new Runnable()
{
@Override
public void run()
{
if (nativeContext != 0)
dispatchFinalize (nativeContext);
}
});
} }
@Override @Override
@@ -1055,15 +1069,21 @@ public class OSCSender extends Activity
} }
//============================================================================== //==============================================================================
Activity activity;
private long nativeContext = 0; private long nativeContext = 0;
private native void dispatchFinalize (long nativeContextRef); private native void dispatchFinalize (long nativeContextRef);
private native Object dispatchInvoke (long nativeContextRef, Object proxy, Method method, Object[] args); private native Object dispatchInvoke (long nativeContextRef, Object proxy, Method method, Object[] args);
} }
public static InvocationHandler createInvocationHandler (long nativeContextRef)
public InvocationHandler createInvocationHandler (long nativeContextRef)
{
return new NativeInvocationHandler (this, nativeContextRef);
}
public void invocationHandlerContextDeleted (InvocationHandler handler)
{ {
return new NativeInvocationHandler (nativeContextRef);
((NativeInvocationHandler) handler).nativeContextDeleted();
} }
//============================================================================== //==============================================================================


+ 24
- 4
examples/PushNotificationsDemo/Builds/Android/app/src/main/java/com/juce/pushnotificationsdemo/PushNotificationsDemo.java View File

@@ -1969,15 +1969,29 @@ public class PushNotificationsDemo extends Activity
//============================================================================== //==============================================================================
public static class NativeInvocationHandler implements InvocationHandler public static class NativeInvocationHandler implements InvocationHandler
{ {
public NativeInvocationHandler (long nativeContextRef)
public NativeInvocationHandler (Activity activityToUse, long nativeContextRef)
{ {
activity = activityToUse;
nativeContext = nativeContextRef; nativeContext = nativeContextRef;
} }
public void nativeContextDeleted()
{
nativeContext = 0;
}
@Override @Override
public void finalize() public void finalize()
{ {
dispatchFinalize (nativeContext);
activity.runOnUiThread (new Runnable()
{
@Override
public void run()
{
if (nativeContext != 0)
dispatchFinalize (nativeContext);
}
});
} }
@Override @Override
@@ -1987,15 +2001,21 @@ public class PushNotificationsDemo extends Activity
} }
//============================================================================== //==============================================================================
Activity activity;
private long nativeContext = 0; private long nativeContext = 0;
private native void dispatchFinalize (long nativeContextRef); private native void dispatchFinalize (long nativeContextRef);
private native Object dispatchInvoke (long nativeContextRef, Object proxy, Method method, Object[] args); private native Object dispatchInvoke (long nativeContextRef, Object proxy, Method method, Object[] args);
} }
public static InvocationHandler createInvocationHandler (long nativeContextRef)
public InvocationHandler createInvocationHandler (long nativeContextRef)
{
return new NativeInvocationHandler (this, nativeContextRef);
}
public void invocationHandlerContextDeleted (InvocationHandler handler)
{ {
return new NativeInvocationHandler (nativeContextRef);
((NativeInvocationHandler) handler).nativeContextDeleted();
} }
//============================================================================== //==============================================================================


+ 24
- 4
examples/audio plugin demo/Builds/Android/app/src/main/java/com/juce/jucedemoplugin/JuceDemoPlugin.java View File

@@ -1969,15 +1969,29 @@ public class JuceDemoPlugin extends Activity
//============================================================================== //==============================================================================
public static class NativeInvocationHandler implements InvocationHandler public static class NativeInvocationHandler implements InvocationHandler
{ {
public NativeInvocationHandler (long nativeContextRef)
public NativeInvocationHandler (Activity activityToUse, long nativeContextRef)
{ {
activity = activityToUse;
nativeContext = nativeContextRef; nativeContext = nativeContextRef;
} }
public void nativeContextDeleted()
{
nativeContext = 0;
}
@Override @Override
public void finalize() public void finalize()
{ {
dispatchFinalize (nativeContext);
activity.runOnUiThread (new Runnable()
{
@Override
public void run()
{
if (nativeContext != 0)
dispatchFinalize (nativeContext);
}
});
} }
@Override @Override
@@ -1987,15 +2001,21 @@ public class JuceDemoPlugin extends Activity
} }
//============================================================================== //==============================================================================
Activity activity;
private long nativeContext = 0; private long nativeContext = 0;
private native void dispatchFinalize (long nativeContextRef); private native void dispatchFinalize (long nativeContextRef);
private native Object dispatchInvoke (long nativeContextRef, Object proxy, Method method, Object[] args); private native Object dispatchInvoke (long nativeContextRef, Object proxy, Method method, Object[] args);
} }
public static InvocationHandler createInvocationHandler (long nativeContextRef)
public InvocationHandler createInvocationHandler (long nativeContextRef)
{
return new NativeInvocationHandler (this, nativeContextRef);
}
public void invocationHandlerContextDeleted (InvocationHandler handler)
{ {
return new NativeInvocationHandler (nativeContextRef);
((NativeInvocationHandler) handler).nativeContextDeleted();
} }
//============================================================================== //==============================================================================


+ 24
- 4
extras/AudioPerformanceTest/Builds/Android/app/src/main/java/com/juce/audioperformancetest/AudioPerformanceTest.java View File

@@ -1969,15 +1969,29 @@ public class AudioPerformanceTest extends Activity
//============================================================================== //==============================================================================
public static class NativeInvocationHandler implements InvocationHandler public static class NativeInvocationHandler implements InvocationHandler
{ {
public NativeInvocationHandler (long nativeContextRef)
public NativeInvocationHandler (Activity activityToUse, long nativeContextRef)
{ {
activity = activityToUse;
nativeContext = nativeContextRef; nativeContext = nativeContextRef;
} }
public void nativeContextDeleted()
{
nativeContext = 0;
}
@Override @Override
public void finalize() public void finalize()
{ {
dispatchFinalize (nativeContext);
activity.runOnUiThread (new Runnable()
{
@Override
public void run()
{
if (nativeContext != 0)
dispatchFinalize (nativeContext);
}
});
} }
@Override @Override
@@ -1987,15 +2001,21 @@ public class AudioPerformanceTest extends Activity
} }
//============================================================================== //==============================================================================
Activity activity;
private long nativeContext = 0; private long nativeContext = 0;
private native void dispatchFinalize (long nativeContextRef); private native void dispatchFinalize (long nativeContextRef);
private native Object dispatchInvoke (long nativeContextRef, Object proxy, Method method, Object[] args); private native Object dispatchInvoke (long nativeContextRef, Object proxy, Method method, Object[] args);
} }
public static InvocationHandler createInvocationHandler (long nativeContextRef)
public InvocationHandler createInvocationHandler (long nativeContextRef)
{
return new NativeInvocationHandler (this, nativeContextRef);
}
public void invocationHandlerContextDeleted (InvocationHandler handler)
{ {
return new NativeInvocationHandler (nativeContextRef);
((NativeInvocationHandler) handler).nativeContextDeleted();
} }
//============================================================================== //==============================================================================


+ 7
- 7
modules/juce_core/native/java/JuceAppActivity.java View File

@@ -956,7 +956,7 @@ public class JuceAppActivity extends Activity
public static class NativeInvocationHandler implements InvocationHandler public static class NativeInvocationHandler implements InvocationHandler
{ {
public NativeInvocationHandler (Activity activityToUse, long nativeContextRef) public NativeInvocationHandler (Activity activityToUse, long nativeContextRef)
{
{
activity = activityToUse; activity = activityToUse;
nativeContext = nativeContextRef; nativeContext = nativeContextRef;
} }
@@ -986,7 +986,7 @@ public class JuceAppActivity extends Activity
return dispatchInvoke (nativeContext, proxy, method, args); return dispatchInvoke (nativeContext, proxy, method, args);
} }
//==============================================================================
//==============================================================================
Activity activity; Activity activity;
private long nativeContext = 0; private long nativeContext = 0;
@@ -997,11 +997,11 @@ public class JuceAppActivity extends Activity
public InvocationHandler createInvocationHandler (long nativeContextRef) public InvocationHandler createInvocationHandler (long nativeContextRef)
{ {
return new NativeInvocationHandler (this, nativeContextRef); return new NativeInvocationHandler (this, nativeContextRef);
}
public void invocationHandlerContextDeleted (InvocationHandler handler)
{
((NativeInvocationHandler) handler).nativeContextDeleted();
}
public void invocationHandlerContextDeleted (InvocationHandler handler)
{
((NativeInvocationHandler) handler).nativeContextDeleted();
} }
//============================================================================== //==============================================================================


Loading…
Cancel
Save