@Override public void render () { currentPosition = music.getPosition(); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); batch.begin(); batch.draw(buttons, 0, 0); font.draw(batch, (int)currentPosition / 60 + ":" + (int)currentPosition % 60, 365, 35); batch.end(); sliderUpdating = true; slider.setValue((currentPosition / songDuration) * 100f); sliderUpdating = false; stage.act(); stage.draw(); if (Gdx.input.justTouched()) { if (Gdx.input.getY() > Gdx.graphics.getHeight() - 64) { if (Gdx.input.getX() < 64) { music.play(); } if (Gdx.input.getX() > 64 && Gdx.input.getX() < 128) { music.stop(); } if (Gdx.input.getX() > 128 && Gdx.input.getX() < 192) { music.pause(); } } } }
/** * 停止音乐 */ public void stopMusic() { if (music != null) { music.stop(); music = null; } }
public void stopMusic() { if (currentMusic != null) { currentMusic.stop(); } }
@Override public void stop() { music.stop(); }
private void clearCurrentMusic() { if (currentMusic != null) { currentMusic.stop(); currentMusic = null; } }
@Override public void stop() { music.stop(); }
public void stop() { if (voice != null) { voice.stop(); dispose(); } }
public void stop() { if (player != null) { player.stop(); player.dispose(); player = null; } }
@Override public void stopBackgroundMusic() { if (backgroundPlaying < 0) return; for (Music m : backgroundMusicList) { if (m.isPlaying()) m.stop(); } backgroundPlaying = -1; backgroundIsPlaying = false; }
@Override public void dispose() { for (Texture t : images.values()) t.dispose(); images.clear(); credits.clear(); if (music != null) { music.stop(); music.dispose(); music = null; } }
public void stopMusic() { if (currentMusic.isEmpty()) { return; } Music music = assetManager.get(musicPath + currentMusic, Music.class); if (music.isPlaying()) { music.stop(); } }
@Override public void stopEndMusic() { Music endMusic = getMusic(Sounds.END_THEME); if (endMusic == null) { return; } if (endMusic.isPlaying()) { endMusic.stop(); } TheEndIsPlaying = false; }
private void disposeInstance() { if (currentMusic != null) { currentMusic.stop(); currentMusic.dispose(); } if (EventManager.instance != null) EventManager.instance.unsubscribe(this, Events.MUSIC_NEXT_CMD, Events.MUSIC_PLAYPAUSE_CMD, Events.MUSIC_PREVIOUS_CMD, Events.MUSIC_VOLUME_CMD, Events.MUSIC_RELOAD_CMD); }
@Override public void stopTitleMusic() { Music titleMusic = getMusic(Sounds.TITLE_THEME); if (titleMusic == null) { return; } if (titleMusic.isPlaying()) { titleMusic.stop(); } TitleIsPlaying = false; }
private void disposeOf(Music mus) { if(mus == null) return;; if(mus.isPlaying()) mus.stop(); mus.dispose(); }
@Override public void clicked(InputEvent event, float x, float y) { if (theSong != null) { theSong.stop(); theSong.dispose(); } ((Game) Gdx.app.getApplicationListener()).setScreen(new SongSelectionScreen()); } }));
@Override public void clicked(InputEvent event, float x, float y) { if (theSong != null) { theSong.stop(); theSong.dispose(); } ((Game) Gdx.app.getApplicationListener()).setScreen(new SongScreen()); } }));
void playSong(int songIdx) { Music song = songs.get(currentSongIdx); song.setOnCompletionListener(null); song.stop(); currentSongIdx = songIdx; song = songs.get(currentSongIdx); song.play(); song.setVolume(volume); song.setOnCompletionListener(listener); }
public void die() { if (!isDead()) { MarioBros.manager.get("audio/music/mario_music.ogg", Music.class).stop(); MarioBros.manager.get("audio/sounds/mariodie.wav", Sound.class).play(); marioIsDead = true; Filter filter = new Filter(); filter.maskBits = MarioBros.NOTHING_BIT; for (Fixture fixture : b2body.getFixtureList()) { fixture.setFilterData(filter); } b2body.applyLinearImpulse(new Vector2(0, 4f), b2body.getWorldCenter(), true); } }