示例#1
0
        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);
            }
        }
示例#2
0
        public void PlayChatSongByIndex(int index)
        {
            Song tmp = ChatPlayList.First(song => song.Index == index);

            if (CurrentSong != tmp)
            {
                CurrentSong  = tmp;
                LastChatSong = CurrentSong;
                foreach (var item in ChatPlayList)
                {
                    item.IsSelected = false;
                }
                foreach (var item in StreamerPlaylist)
                {
                    item.IsSelected = false;
                }
                CurrentSong.IsSelected = true;
            }
            else
            {
                StartStopPlayer();
            }
        }
示例#3
0
        public void AddToStreamerPlaylistFromChatPlaylistByIndex(int index)
        {
            string id = ChatPlayList.First(song => song.Index == index).Id;

            AddSong(CreateSongById(id));
        }
示例#4
0
        public void CopyChatSongLinkByIndex(int index)
        {
            string link = ChatPlayList.First(song => song.Index == index).YoutubeLink;

            Clipboard.SetText(link);
        }