Esempio n. 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;
        }
Esempio n. 2
0
        public void JumpToPlaylistIndex(int playlistIndex)
        {
            Log.Debug("Jumping to index in playlist " + playlistIndex);
            this.Playlist.CurrentPosition = playlistIndex - 1;
            AudioInteractor.StopSong();

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

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

            /*Playlist.MoveToNextSong();
             * Play();*/
        }
Esempio n. 5
0
 public void Resume()
 {
     Log.Debug("Resuming");
     if (IsPaused)
     {
         AudioInteractor.ResumeSong();
         IsPaused = false;
     }
 }
Esempio n. 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();
        }
Esempio n. 7
0
 public void Pause()
 {
     Log.Debug("Pausing");
     AudioInteractor.PauseSong();
     IsPaused = true;
 }
Esempio n. 8
0
 public void Stop()
 {
     Log.Debug("Stopping");
     _stopped = true;
     AudioInteractor.StopSong();
 }