当前位置: 首页>>代码示例>>Java>>正文


Java Music.isPlaying方法代码示例

本文整理汇总了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();	
		}
	};
}
 
开发者ID:mitsuhirato,项目名称:TheEndlessCastle,代码行数:18,代码来源:RandomMusicPlaylist.java

示例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;
}
 
开发者ID:yichen0831,项目名称:Bomberman_libGdx,代码行数:17,代码来源:GameManager.java

示例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();
}
 
开发者ID:Inari-Soft,项目名称:inari-firefly-libGDX,代码行数:13,代码来源:GdxAudioImpl.java

示例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 );
}
 
开发者ID:Inari-Soft,项目名称:inari-firefly-libGDX,代码行数:10,代码来源:GdxAudioImpl.java

示例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();
}
 
开发者ID:Inari-Soft,项目名称:inari-firefly-libGDX,代码行数:10,代码来源:GdxAudioImpl.java

示例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();
}
 
开发者ID:kbz,项目名称:SSTrain,代码行数:10,代码来源:Crossfader.java

示例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();
    }
}
 
开发者ID:yichen0831,项目名称:Bomberman_libGdx,代码行数:10,代码来源:GameManager.java

示例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();
    }
}
 
开发者ID:yichen0831,项目名称:Bomberman_libGdx,代码行数:11,代码来源:GameManager.java

示例9: isPlaying

import com.badlogic.gdx.audio.Music; //导入方法依赖的package包/类
@Override
public boolean isPlaying() {
    Music music = musicRef.get();
    return music != null && music.isPlaying();
}
 
开发者ID:anonl,项目名称:nvlist,代码行数:6,代码来源:NativeAudio.java


注:本文中的com.badlogic.gdx.audio.Music.isPlaying方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。