Esempio n. 1
0
 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();
     }
 }
Esempio n. 3
0
 //Pause the music
 public static void PauseMusic()
 {
     if (musicPlayer != null && musicPlayer.Status != BgmStatus.Paused)
     {
         musicPlayer.Pause();
     }
 }
Esempio n. 4
0
 public void pause()
 {
     if (bgmPlayer != null && bgmPlayer.Status == BgmStatus.Playing)
     {
         bgmPlayer.Pause();
     }
 }
Esempio n. 5
0
 /// <summary>
 /// 暂停音乐
 /// </summary>
 public void MusicPause()
 {
     if (MusicPlayer != null && MusicPlayer.Status == BgmStatus.Playing)
     {
         MusicPlayer.Pause();
     }
     musicStatus = SoundComanndStatus.Pause;
 }
Esempio n. 6
0
 public virtual int PauseMusic()
 {
     if (_musicPlayer != null)
     {
         _musicPlayer.Pause();
     }
     return(0);
 }
Esempio n. 7
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);
        }
Esempio n. 8
0
 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;
     }
 }
Esempio n. 9
0
        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();
        }