Exemplo n.º 1
0
 private void Stop()
 {
     StopRequested(this, EventArgs.Empty);
     SliderTimer.Stop();
     IsPlaying     = false;
     MediaPosition = 0;
 }
Exemplo n.º 2
0
        public void Stop()
        {
            SearchTimer.Stop();
            SliderTimer.Stop();

            ViewModel.Status = SongStatus.Stopped;

            sliderControl.Value = 0;

            ViewModel.Player.Stop();
        }
Exemplo n.º 3
0
 public void OnTimedEvent(object sender, EventArgs eventArgs)
 {
     if (MediaPosition < MediaLength)
     {
         MediaPosition++;
     }
     else
     {
         SliderTimer.Stop();
     }
 }
Exemplo n.º 4
0
        /// <summary>
        /// Occurs when current playing song ended,
        /// looks play queue and plays next one.
        /// </summary>
        void Player_MediaEnded(object sender, EventArgs e)
        {
            sliderControl.Value = 0;
            songTime.Content    = "";
            SliderTimer.Stop();
            ViewModel.Status = SongStatus.Stopped;

            if (ViewModel.PlayQueue.Count > 0)
            {
                ViewModel.CurrentSong = ViewModel.PlayQueue.Dequeue();
                Play();
            }
        }
Exemplo n.º 5
0
 private void PlayPause()
 {
     if (IsPlaying)
     {
         PauseRequested(this, EventArgs.Empty);
         SliderTimer.IsEnabled = false;
         IsPlaying             = false;
     }
     else
     {
         PlayRequested(this, EventArgs.Empty);
         SliderTimer.Start();
         IsPlaying = true;
     }
 }
Exemplo n.º 6
0
        public void Play()
        {
            ViewModel.Play();
            switch (ViewModel.Status)
            {
            case SongStatus.Playing:
                SliderTimer.Start();
                break;

            case SongStatus.Paused:
            // Fall through
            case SongStatus.Stopped:
                SliderTimer.Stop();
                break;
            }
        }