本文整理汇总了Java中org.andengine.audio.music.Music.isPlaying方法的典型用法代码示例。如果您正苦于以下问题:Java Music.isPlaying方法的具体用法?Java Music.isPlaying怎么用?Java Music.isPlaying使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.andengine.audio.music.Music
的用法示例。
在下文中一共展示了Music.isPlaying方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: play
import org.andengine.audio.music.Music; //导入方法依赖的package包/类
public void play(MusicType pMusicType, boolean isStart) {
Music music = get(pMusicType);
// 再生中
if (music.isPlaying()) {
return;
}
stopPlayingMusic(); // 再生中のBGMは全部止めてから再生する
// 再生する(基本ループ)
music.setLooping(true);
music.play();
}
示例2: pause
import org.andengine.audio.music.Music; //导入方法依赖的package包/类
public void pause(MusicType pMusicType) {
Music music = get(pMusicType);
// 再生中
if (music.isPlaying()) {
// 一時停止
music.pause();
}
}
示例3: pausePlayingMusic
import org.andengine.audio.music.Music; //导入方法依赖的package包/类
public void pausePlayingMusic() {
int size = mMusicArray.size();
for (int i = 0; i < size; i++) {
MusicType musicType = MusicType.get(mMusicArray.keyAt(i));
Music music = get(musicType);
if (music.isPlaying()) {
music.pause();
mPauseMusicType = musicType;
}
}
}
示例4: playMusic
import org.andengine.audio.music.Music; //导入方法依赖的package包/类
/**
* Begins playing music.
* @param m
*/
public static void playMusic(Music m) {
if(m != null && !m.isPlaying()) {
m.setVolume(getMusicVolume());
m.play();
}
}
示例5: playMusicLoop
import org.andengine.audio.music.Music; //导入方法依赖的package包/类
/**
* Play music in looping.
* @param m
*/
public static void playMusicLoop(Music m) {
if(m != null && !m.isPlaying()) {
m.setVolume(getMusicVolume());
m.setLooping(true);
m.play();
}
}
示例6: stopMusic
import org.andengine.audio.music.Music; //导入方法依赖的package包/类
/**
* Stops music and sets the tune to the begining.
* @param m
*/
public static void stopMusic(Music m) {
if(m != null && m.isPlaying()) {
m.pause();
m.seekTo(0);
}
}
示例7: isPlaying
import org.andengine.audio.music.Music; //导入方法依赖的package包/类
public static boolean isPlaying(Music m) {
return m.isPlaying();
}
示例8: pauseMusic
import org.andengine.audio.music.Music; //导入方法依赖的package包/类
/**
* Pause music. May be resumed.
* @param m
*/
public static void pauseMusic(Music m) {
if(m != null && m.isPlaying())
m.pause();
}