本文整理匯總了Java中com.badlogic.gdx.audio.Music.isPlaying方法的典型用法代碼示例。如果您正苦於以下問題:Java Music.isPlaying方法的具體用法?Java Music.isPlaying怎麽用?Java Music.isPlaying使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.badlogic.gdx.audio.Music
的用法示例。
在下文中一共展示了Music.isPlaying方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: RandomMusicPlaylist
import com.badlogic.gdx.audio.Music; //導入方法依賴的package包/類
public RandomMusicPlaylist(float volume, AssetsHandler assetsHndlr){
_assetsHndlr = assetsHndlr;
_musics = new ArrayList<Music>();
_volume = volume;
for(String name : _GAME_MUSIC_NAMES)
_musics.add((Music)_assetsHndlr.get(name));
_musicListener = new OnCompletionListener() {
@Override
public void onCompletion(Music music) {
if(music.isPlaying())
music.stop();
PlayRandomMusic();
}
};
}
示例2: playMusic
import com.badlogic.gdx.audio.Music; //導入方法依賴的package包/類
public void playMusic(String musicName, boolean isLooping) {
Music music = assetManager.get(musicPath + musicName);
music.setVolume(0.6f);
if (currentMusic.equals(musicName)) {
music.setLooping(isLooping);
if (!music.isPlaying()) {
music.play();
}
return;
}
stopMusic();
music.setLooping(isLooping);
music.play();
currentMusic = musicName;
}
示例3: playMusic
import com.badlogic.gdx.audio.Music; //導入方法依賴的package包/類
@Override
public final void playMusic( int soundId, boolean looping, float volume, float pan ) {
Music sound = music.get( soundId );
if ( sound == null || sound.isPlaying() ) {
return;
}
sound.setPan( pan, volume );
sound.setLooping( looping );
sound.play();
}
示例4: changeMusic
import com.badlogic.gdx.audio.Music; //導入方法依賴的package包/類
@Override
public final void changeMusic( int soundId, float volume, float pan ) {
Music sound = music.get( soundId );
if ( sound == null || sound.isPlaying() ) {
return;
}
sound.setPan( pan, volume );
}
示例5: stopMusic
import com.badlogic.gdx.audio.Music; //導入方法依賴的package包/類
@Override
public final void stopMusic( int soundId ) {
Music sound = music.get( soundId );
if ( sound == null || !sound.isPlaying() ) {
return;
}
sound.stop();
}
示例6: disposeOf
import com.badlogic.gdx.audio.Music; //導入方法依賴的package包/類
private void disposeOf(Music mus) {
if(mus == null)
return;;
if(mus.isPlaying())
mus.stop();
mus.dispose();
}
示例7: stopMusic
import com.badlogic.gdx.audio.Music; //導入方法依賴的package包/類
public void stopMusic() {
if (currentMusic.isEmpty()) {
return;
}
Music music = assetManager.get(musicPath + currentMusic, Music.class);
if (music.isPlaying()) {
music.stop();
}
}
示例8: pauseMusic
import com.badlogic.gdx.audio.Music; //導入方法依賴的package包/類
public void pauseMusic() {
if (currentMusic.isEmpty()) {
return;
}
Music music = assetManager.get(musicPath + currentMusic, Music.class);
if (music.isPlaying()) {
music.pause();
}
}
示例9: isPlaying
import com.badlogic.gdx.audio.Music; //導入方法依賴的package包/類
@Override
public boolean isPlaying() {
Music music = musicRef.get();
return music != null && music.isPlaying();
}