internal void Pause() { if (_bgmPlayer != null && _currentSong == this) { _bgmPlayer.Pause(); } }
static void HandlePause_btnButtonAction(object sender, TouchEventArgs e) { if (player.Status == BgmStatus.Playing) { player.Pause(); } }
//Pause the music public static void PauseMusic() { if (musicPlayer != null && musicPlayer.Status != BgmStatus.Paused) { musicPlayer.Pause(); } }
public void pause() { if (bgmPlayer != null && bgmPlayer.Status == BgmStatus.Playing) { bgmPlayer.Pause(); } }
/// <summary> /// 暂停音乐 /// </summary> public void MusicPause() { if (MusicPlayer != null && MusicPlayer.Status == BgmStatus.Playing) { MusicPlayer.Pause(); } musicStatus = SoundComanndStatus.Pause; }
public virtual int PauseMusic() { if (_musicPlayer != null) { _musicPlayer.Pause(); } return(0); }
public static bool Update() { uint enableColor = 0xffffffff; uint disableColor = 0xff7f7f7f; playButton.ButtonColor = disableColor; stopButton.ButtonColor = disableColor; pauseButton.ButtonColor = disableColor; resumeButton.ButtonColor = disableColor; if (bgmPlayer.Status == BgmStatus.Stopped) { playButton.ButtonColor = enableColor; } else if (bgmPlayer.Status == BgmStatus.Playing) { stopButton.ButtonColor = enableColor; pauseButton.ButtonColor = enableColor; } else if (bgmPlayer.Status == BgmStatus.Paused) { stopButton.ButtonColor = enableColor; resumeButton.ButtonColor = enableColor; } List <TouchData> touchDataList = Touch.GetData(0); if (playButton.ButtonColor == enableColor && playButton.TouchDown(touchDataList)) { bgmPlayer.Play(); } if (stopButton.ButtonColor == enableColor && stopButton.TouchDown(touchDataList)) { bgmPlayer.Stop(); } if (pauseButton.ButtonColor == enableColor && pauseButton.TouchDown(touchDataList)) { bgmPlayer.Pause(); } if (resumeButton.ButtonColor == enableColor && resumeButton.TouchDown(touchDataList)) { bgmPlayer.Resume(); } volumeSlider.Update(touchDataList); bgmPlayer.Volume = volumeSlider.Rate; return(true); }
public void Button_Mute_Click(object sender, RoutedEventArgs args) { if (isBgmMute) { BgmPlayer.Play(); isBgmMute = false; Button_Mute_Forbid_Idle.Visibility = Visibility.Hidden; Button_Mute_Forbid_Clicked.Visibility = Visibility.Hidden; } else { BgmPlayer.Pause(); isBgmMute = true; Button_Mute_Forbid_Idle.Visibility = Visibility.Visible; Button_Mute_Forbid_Clicked.Visibility = Visibility.Visible; } }
public override void Update(float dT) { uiTime.Text = "Time: " + ScoreManager.Instance.getTime(); uiScore.Text = "Score: " + ScoreManager.Instance.getScore(); foreach (Tank tank in tankList) { tank.Update(dT); tank.rotateTurret(player.Position(), dT); if (player.isTouching() && player.Collision(tank.getPosition(), tank.getSize())) { alive = false; } } player.Update(); if (player.isTouching()) { ScoreManager.Instance.runScore(); if (bgSoundPlayer.Status == BgmStatus.Paused) { bgSoundPlayer.Resume(); } else if (bgSoundPlayer.Status != BgmStatus.Playing) { bgSoundPlayer.Play(); } } else { bgSoundPlayer.Pause(); } if (!alive) { bgSoundPlayer.Dispose(); ScoreManager.Instance.setScore(); SceneManager.Instance.setEndScene(); } Director.Instance.Update(); }