|
|
@ -71,6 +71,7 @@ public class AndroidOpenALSoftAudioRenderer implements AndroidAudioRenderer, Run |
|
|
|
private static final float UPDATE_RATE = 0.05f; |
|
|
|
private static final float UPDATE_RATE = 0.05f; |
|
|
|
private final Thread audioThread = new Thread(this, "jME3 Audio Thread"); |
|
|
|
private final Thread audioThread = new Thread(this, "jME3 Audio Thread"); |
|
|
|
private final AtomicBoolean threadLock = new AtomicBoolean(false); |
|
|
|
private final AtomicBoolean threadLock = new AtomicBoolean(false); |
|
|
|
|
|
|
|
private boolean initialized = false; |
|
|
|
|
|
|
|
|
|
|
|
public AndroidOpenALSoftAudioRenderer() { |
|
|
|
public AndroidOpenALSoftAudioRenderer() { |
|
|
|
} |
|
|
|
} |
|
|
@ -98,6 +99,8 @@ public class AndroidOpenALSoftAudioRenderer implements AndroidAudioRenderer, Run |
|
|
|
threadLock.notifyAll(); |
|
|
|
threadLock.notifyAll(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
initialized = true; |
|
|
|
|
|
|
|
|
|
|
|
long updateRateNanos = (long) (UPDATE_RATE * 1000000000); |
|
|
|
long updateRateNanos = (long) (UPDATE_RATE * 1000000000); |
|
|
|
mainloop: |
|
|
|
mainloop: |
|
|
|
while (true) { |
|
|
|
while (true) { |
|
|
@ -126,6 +129,8 @@ public class AndroidOpenALSoftAudioRenderer implements AndroidAudioRenderer, Run |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
initialized = false; |
|
|
|
|
|
|
|
|
|
|
|
synchronized (threadLock) { |
|
|
|
synchronized (threadLock) { |
|
|
|
cleanupInThread(); |
|
|
|
cleanupInThread(); |
|
|
|
} |
|
|
|
} |
|
|
@ -1292,6 +1297,12 @@ public class AndroidOpenALSoftAudioRenderer implements AndroidAudioRenderer, Run |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void pauseAll() { |
|
|
|
public void pauseAll() { |
|
|
|
|
|
|
|
// don't try to pause all audio (mainly from Android activity) if
|
|
|
|
|
|
|
|
// the renderer is already closed down
|
|
|
|
|
|
|
|
if (!initialized) { |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
checkDead(); |
|
|
|
checkDead(); |
|
|
|
synchronized (threadLock) { |
|
|
|
synchronized (threadLock) { |
|
|
|
while (!threadLock.get()) { |
|
|
|
while (!threadLock.get()) { |
|
|
|