List of usage examples for com.badlogic.gdx.backends.lwjgl.audio OpenALMusic isPlaying
public boolean isPlaying()
From source file:phasereditor.audio.core.AudioCore.java
License:Open Source License
private static void initGdxAudio() { GdxNativesLoader.disableNativesLoading = true; _musicsToUpdate = new ArrayList<>(); _musicActionsToUpdate = new ArrayList<>(); // music loop Thread th = new Thread("Phaser Editor music loop") { @Override//from ww w. j a v a 2s.c om public void run() { while (true) { try { sleep(100); } catch (InterruptedException e) { // nothing } synchronized (_musicsToUpdate) { for (OpenALMusic music : _musicsToUpdate) { synchronized (music) { if (music.isPlaying()) { music.update(); } } } } synchronized (_musicActionsToUpdate) { for (Runnable action : _musicActionsToUpdate) { try { action.run(); } catch (Exception e) { e.printStackTrace(); } } } } } }; th.setDaemon(true); th.start(); }