@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 pauseMusic() { if (currentMusic != null) { currentMusic.pause(); } }
public void pause() { if (player != null) { player.pause(); } }
public void pause() { if (voice != null && voice.isPlaying()) { voice.pause(); isPaused = true; } }
public void pause() { if (currentMusic != null && currentMusic.isPlaying()) { currentMusic.pause(); } }
public void pauseMusic() { if (music != null && music.isPlaying()) { music.pause(); isPaused = true; } }
@Override public void pauseBackgroundMusic() { paused = true; if (backgroundPlaying >= 0) backgroundMusicList.get(backgroundPlaying).pause(); Music music; music = getMusic(Sounds.TITLE_THEME); if (music != null && TitleIsPlaying) { music.pause(); } music = getMusic(Sounds.END_THEME); if (music != null && TheEndIsPlaying) { music.pause(); } }
public void pauseMusic() { if (currentMusic.isEmpty()) { return; } Music music = assetManager.get(musicPath + currentMusic, Music.class); if (music.isPlaying()) { music.pause(); } }
public void pauseAll() { Stream.of(manager.values()).forEach(p -> p.music.pause()); }
public void pause() { // TODO Auto-generated method stub var3dListener.onIOSPause(); if (music != null) music.pause(); if (stage != null && isLoading) stage.pause(); }
public void back() { if (world.started) { // if the game was paused and we pressed back again, we skip to the results screen if (world.paused) { this.done = true; this.onCompletion(theSong); return; } world.paused = true; if (hasMusic) { theSong.pause(); lastmtime = theSong.getPosition(); time = lastmtime + world.delay; timeSyncAcc = 0; } } }
public void pauseMusic(String res){ final Music musicFromPool = musics.get(res); if(null==musicFromPool){ final Music musicFromAssets = Engine.resource(res); musics.put(res, musicFromAssets); if(musicFromAssets.isPlaying()){ musicFromAssets.pause(); } }else{ if(musicFromPool.isPlaying()){ musicFromPool.pause(); } } } public void playMusic(String res,boolean loop){
public void playPauseToggle() { if (currentMusic != null) { if (currentMusic.isPlaying()) { currentMusic.pause(); } else { currentMusic.play(); } } else { start(); } }
theSong.pause(); theSong.setPosition(newAPosition); theSong.setVolume(GlobalConfiguration.songVolume / 100f);
@Override public boolean keyDown (int keycode) { if (keycode == Keys.P) { songs.get(currentSongIdx).pause(); Gdx.app.log("MusicSample", "Song paused");
resetMarks(); if (hasMusic) { theSong.pause(); theSong.setPosition(aPosition); theSong.play();
public void update () { if (Gdx.input.justTouched()) { guiCam.unproject(touchPoint.set(Gdx.input.getX(), Gdx.input.getY(), 0)); if (playBounds.contains(touchPoint.x, touchPoint.y)) { Assets.playSound(Assets.clickSound); game.setScreen(new GameScreen(game)); return; } if (highscoresBounds.contains(touchPoint.x, touchPoint.y)) { Assets.playSound(Assets.clickSound); game.setScreen(new HighscoresScreen(game)); return; } if (helpBounds.contains(touchPoint.x, touchPoint.y)) { Assets.playSound(Assets.clickSound); game.setScreen(new HelpScreen(game)); return; } if (soundBounds.contains(touchPoint.x, touchPoint.y)) { Assets.playSound(Assets.clickSound); Settings.soundEnabled = !Settings.soundEnabled; if (Settings.soundEnabled) Assets.music.play(); else Assets.music.pause(); } } }