Exemplo n.º 1
0
        /// <summary>
        /// Start playing, from the start of the track, if: (1) there is a queued track to play and (2) the player is in the hard-stopped state at the moment
        /// </summary>
        public void StartPlayingIfAppropriate()
        {
            if (this.PlayQueue.Count == 0 || !ToccataModel.MediaPlayerHasNoSource())
            {
                return;
            }

            ToccataModel.Play(this.PlayQueue[0].storage); // start playing the track that is at the top of the queue.
        }
Exemplo n.º 2
0
 /// <summary>
 /// Starts or restarts playback.
 /// </summary>
 public void Play()
 {
     if (ToccataModel.MediaPlayerHasNoSource()) // if the player has been hard-stopeed, then ...
     {
         if (this.PlayQueue.Count <= 0)
         {
             return;
         }
         ToccataModel.Play(this.PlayQueue[0].storage); // ... play the top track on the queue
     }
     else
     {
         ToccataModel.Play(); // ... else play whatever is currently assigned as the player's source.
     }
 }