/// <summary>
 /// Enqueues a music track for playback.
 /// </summary>
 /// <param name="item">Music track to enqueue.</param>
 public void Enqueue(MusicItem item)
 {
     lock (this.QueueInternal)
     {
         if (this.RepeatMode == RepeatMode.All && this.QueueInternal.Count == 1)
         {
             this.QueueInternal.Insert(0, item);
         }
         else if (!this.IsShuffled || !this.QueueInternal.Any())
         {
             this.QueueInternal.Add(item);
         }
         else if (this.IsShuffled)
         {
             var index = this.RNG.Next(0, this.QueueInternal.Count);
             this.QueueInternal.Insert(index, item);
         }
     }
 }
Exemplo n.º 2
0
 public MusicItemSerializable(MusicItem mi)
 {
     this.Track    = mi.Track.TrackString;
     this.MemberId = mi.RequestedBy.Id;
 }