v2.3.0: fixed track looping interfering with fade behaviour
This commit is contained in:
@@ -162,6 +162,8 @@ public enum Music {
|
|||||||
private com.badlogic.gdx.audio.Music.OnCompletionListener trackLooper = new com.badlogic.gdx.audio.Music.OnCompletionListener() {
|
private com.badlogic.gdx.audio.Music.OnCompletionListener trackLooper = new com.badlogic.gdx.audio.Music.OnCompletionListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onCompletion(com.badlogic.gdx.audio.Music music) {
|
public void onCompletion(com.badlogic.gdx.audio.Music music) {
|
||||||
|
//don't play the next track if we're currently in the middle of a fade
|
||||||
|
if (fadeTotal == -1f) {
|
||||||
//we do this in a separate thread to avoid graphics hitching while the music is prepared
|
//we do this in a separate thread to avoid graphics hitching while the music is prepared
|
||||||
if (!DeviceCompat.isDesktop()) {
|
if (!DeviceCompat.isDesktop()) {
|
||||||
new Thread() {
|
new Thread() {
|
||||||
@@ -175,6 +177,7 @@ public enum Music {
|
|||||||
playNextTrack(music);
|
playNextTrack(music);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
private synchronized void playNextTrack(com.badlogic.gdx.audio.Music music){
|
private synchronized void playNextTrack(com.badlogic.gdx.audio.Music music){
|
||||||
|
|||||||
Reference in New Issue
Block a user