Beispiel #1
0
        /// <summary>
        /// Play Previous Track
        /// </summary>
        public void PrevTrack()
        {
            Musicqueue.PrevTrack();

            // Check if there is a previous track
            if (Musicqueue.ActiveTrack != null)
            {
                Mediaplayer.Open(Musicqueue.ActiveTrack.Filepath);
                if (State == PlayerState.Play)
                {
                    Play();
                }
            }
            else
            {
                Stop();
            }
        }
Beispiel #2
0
        /// <summary>
        /// Play next track
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void NextTrack(object sender = null, EventArgs e = null)
        {
            Musicqueue.NextTrack(this);

            // Check if there is a next track
            if (Musicqueue.RepeatTrack && Musicqueue.ActiveNode != null)
            {
                Musicqueue.ActiveNode = Musicqueue.ActiveNode.Previous;
            }
            else if (Musicqueue.RepeatQueue && Musicqueue.ActiveNode == Musicqueue.Queue.Last)
            {
                Musicqueue.ActiveNode  = Musicqueue.Queue.First;
                Musicqueue.ActiveTrack = Musicqueue.ActiveNode.Value;
                NextTrack();
            }

            Mediaplayer.Open(Musicqueue.ActiveTrack.Filepath);
            if (State == PlayerState.Play)
            {
                Play();
            }
        }
Beispiel #3
0
 public void SetActiveTrackInPlayableContainer(Track track)
 {
     Musicqueue.FindActiveNode(track);
     Musicqueue.ActiveTrack = track;
     Mediaplayer.Open(new Uri(@"file:///" + track.audio));
 }