本文整理汇总了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();
}