示例#1
0
 private PlaylistItem indexToItem(int index, Playlist pl)
 {
     return index < pl.PlaylistItems.Count ? pl.PlaylistItems[index] : null;
 }
示例#2
0
 private void resetShuffle(Playlist pl)
 {
     foreach (PlaylistItem pi in pl.PlaylistItems)
     {
         pi.Played = false;
     }
 }
示例#3
0
 private int getRandomMove(Playlist pl)
 {
     List<int> candidates = new List<int>();
     int currIdx = pl.PlaylistItems.IndexOf(mainForm.DataSource.CurrentItem);
     for (int i = 0; i < pl.PlaylistItems.Count; i++)
     {
         if (i != currIdx)
             candidates.Add(i);
     }
     if (candidates.Count > 0)
     {
         return candidates[(int)GetRandom(0, candidates.Count)];
     }
     else
     {
         return currIdx;
     }
 }