public void SetCurrentTrackNext() { if (PlaylistTracks.Count <= 1) { return; } Data.CurrentTrack = PlaylistTracks[(PlaylistTracks.IndexOf(Data.CurrentTrack) + 1) % PlaylistTracks.Count]; }
private void OnEnded() { if (PlaylistTracks.Count <= 1) { return; } Data.CurrentTrack = PlaylistTracks[(PlaylistTracks.IndexOf(Data.CurrentTrack) + 1) % PlaylistTracks.Count]; }
protected void PreviousTrackClick() { if (PlaylistTracks.Count <= 1) { return; } if (PlaylistTracks.IndexOf(Data.CurrentTrack) == 0) { Data.CurrentTrack = PlaylistTracks[PlaylistTracks.Count - 1]; } else { Data.CurrentTrack = PlaylistTracks[(PlaylistTracks.ToList().IndexOf(Data.CurrentTrack) - 1) % PlaylistTracks.Count]; } }