public void PlayStreamerSongByIndex(int index) { Song tmp = StreamerPlaylist.First(song => song.Index == index); if (CurrentSong != tmp) { CurrentSong = tmp; LastStreamerSong = CurrentSong; foreach (var item in StreamerPlaylist) { item.IsSelected = false; } foreach (var item in ChatPlayList) { item.IsSelected = false; } CurrentSong.IsSelected = true; _timer.Elapsed += _timer_Elapsed; _timer.Start(); } else { StartStopPlayer(); } }
public void PlayNextSong() { bool nextChatSong = false; if (ConfigSet.Config.PlayerConfig.ChatPlaylistOn) { if (ChatPlayList.Count != 0) { if (LastChatSong != null) { if (LastChatSong.Index < ChatPlayList.Count) { int needindex = LastChatSong.Index + 1; Song tmp = ChatPlayList.First(song => song.Index == needindex); int index = tmp.Index; PlayChatSongByIndex(index); nextChatSong = true; } } else { PlayChatSongByIndex(1); nextChatSong = true; } } } else { nextChatSong = false; } if (StreamerPlaylist.Count != 0 && nextChatSong == false) { int index = 1; if (LastStreamerSong != null) { if (LastStreamerSong.Index == StreamerPlaylist.Count) { index = 1; } else { int needindex = LastStreamerSong.Index + 1; Song tmp = StreamerPlaylist.First(song => song.Index == needindex); index = tmp.Index; } } PlayStreamerSongByIndex(index); } }
public void PlayPreviousSong() { if (StreamerPlaylist.Count != 0) { int index = 0; if (CurrentSong.Index == 1) { index = StreamerPlaylist.Count; } else { int needindex = CurrentSong.Index - 1; Song tmp = StreamerPlaylist.First(song => song.Index == needindex); index = tmp.Index; } PlayStreamerSongByIndex(index); } }
public void CopyStreamerSongLinkByIndex(int index) { string link = StreamerPlaylist.First(song => song.Index == index).YoutubeLink; Clipboard.SetText(link); }