Example #1
0
        public void Play()
        {
            if (_isPlaying)
            {
                return;
            }

            _stopped   = false;
            _isPlaying = true;

            Log.Debug("Play starting");

            if (ShouldPlayASong())
            {
                while (!_stopped)
                {
                    Playlist.CurrentSongIsStarting();
                    AudioInteractor.PlaySong(Playlist.CurrentSong.FullPath);
                    PlayCount++;
                    Playlist.CurrentSongIsEnding();

                    if (!ShouldPlayASong())
                    {
                        break;
                    }

                    if (!_stopped)
                    {
                        Playlist.MoveToNextSong();
                    }
                }
            }
            _isPlaying = false;
        }
Example #2
0
        public void JumpToPlaylistIndex(int playlistIndex)
        {
            Log.Debug("Jumping to index in playlist " + playlistIndex);
            this.Playlist.CurrentPosition = playlistIndex - 1;
            AudioInteractor.StopSong();

            //this.Play();
        }
Example #3
0
        public void Back()
        {
            Log.Debug("Back-ing");

            Playlist.MoveBackOneSong();
            Playlist.MoveBackOneSong();
            AudioInteractor.StopSong();
        }
Example #4
0
        public void Next()
        {
            Log.Debug("Next-ing.");
            AudioInteractor.StopSong();
            //Stop();

            /*Playlist.MoveToNextSong();
             * Play();*/
        }
Example #5
0
 public void Resume()
 {
     Log.Debug("Resuming");
     if (IsPaused)
     {
         AudioInteractor.ResumeSong();
         IsPaused = false;
     }
 }
Example #6
0
        public void JumpToPlaylistByPath(string path)
        {
            Log.Debug("Jumping to song " + path + " in playlist.");

            var found = this.Playlist.Where(X => X.FullPath == path).LastOrDefault();

            if (found == null)
            {
                return;
            }

            var playlistIndex = this.Playlist.LastIndexOf(found);

            //var playlistIndex = this.Playlist.IndexOf(found);

            this.Playlist.CurrentPosition = playlistIndex - 1;

            //if (_stopped)
            //    this.Play();

            AudioInteractor.StopSong();
        }
Example #7
0
 public void Pause()
 {
     Log.Debug("Pausing");
     AudioInteractor.PauseSong();
     IsPaused = true;
 }
Example #8
0
 public void Stop()
 {
     Log.Debug("Stopping");
     _stopped = true;
     AudioInteractor.StopSong();
 }