public void Start(musicItem track) { selectTrack(track); Start(); }
public void skip(bool isNext) { if (selectedTrack != null) { int currentIndex; currentIndex = playlist.IndexOf(selectedTrack); // Skip next if (isNext && currentIndex < playlist.Count - 1 ) { selectedTrack = playlist[currentIndex + 1]; Start(); } else if (isNext && playlist[0] != null) { selectedTrack = playlist[0]; Start(); } //Skip prev else if (!isNext && currentIndex > 0) { selectedTrack = playlist[currentIndex - 1]; Start(); } else if (!isNext && playlist[playlist.Count-1] != null) { selectedTrack = playlist[playlist.Count-1]; Start(); } else { Start(); } } }
public void delTracks(System.Collections.IList list) { List<musicItem> tempList = new List<musicItem>(); foreach (musicItem item in list) { tempList.Add(item); } foreach (musicItem item in tempList) { playlist.Remove(item); if (selectedTrack != null && selectedTrack == item) { selectedTrack = null; } } }
public void selectTrack(musicItem targetItem) { selectedTrack = targetItem; }
public void delSelectedTrack() { if (selectedTrack != null && playlist.Count > 0) { playlist.Remove(selectedTrack); selectedTrack = null; } }