| | |
| | | var host_Music_If = playList1.Find((c) => c.ServerClientType == 1); |
| | | if (host_Music_If == null) |
| | | { |
| | | |
| | | var playList2 = new List<A31MusicModel>(); |
| | | for (int i = 0; i < playList1.Count; i++) |
| | | { |
| | |
| | | { |
| | | playList2.Add(musics); |
| | | } |
| | | |
| | | } |
| | | |
| | | if (playList2.Count == 0) |
| | |
| | | addFlieRow.AddChidren(songNameBtn); |
| | | |
| | | var wText = songNameBtn.GetTextWidth();//获取文本宽度 |
| | | if (wText > 280) |
| | | if (wText >Application.GetRealWidth(220)) |
| | | { |
| | | songNameBtn.Width = Application.GetRealWidth(280); |
| | | songNameBtn.Width = Application.GetRealWidth(220); |
| | | } |
| | | else |
| | | { |
| | | songNameBtn.Width = wText + 5; |
| | | songNameBtn.Width = wText + Application.GetRealWidth(15); |
| | | } |
| | | //歌手控件 |
| | | Button singerBtn = new Button |
| | | { |
| | | X = songNameBtn.Right, |
| | | Y = Application.GetRealHeight(15), |
| | | Width = Application.GetRealWidth(280 - songNameBtn.Width), |
| | | Width = Application.GetRealWidth(220)- wText, |
| | | Height = Application.GetRealHeight(20), |
| | | TextColor = Color.MusicNoTxetColor, |
| | | TextSize = TextSize.Text12, |
| | |
| | | Text = "-" + player.A31PlayStatus.Artist.Trim(), |
| | | }; |
| | | addFlieRow.AddChidren(singerBtn); |
| | | if (wText > 280) |
| | | { |
| | | ///歌名长度小于250才可以显示歌手出来 |
| | | singerBtn.Width = Application.GetRealWidth(0); |
| | | } |
| | | } |
| | | else |
| | | { |
| | |
| | | /// <param name="musicList1"></param> |
| | | void MergeThreading(A31MusicModel serverMusic, List<A31MusicModel> musicList1) |
| | | { |
| | | A31MusicModel mainModel = null; |
| | | bool mainModelCollection = false; |
| | | MusicMain.loading.Start(Language.StringByID(StringId.inConfiguration)); |
| | | bool _if = false; |
| | | System.Threading.Tasks.Task.Run(() => |
| | |
| | | for (int j = 0; j < A31MusicModel.A31MusicModelList.Count; j++) |
| | | { |
| | | var music = A31MusicModel.A31MusicModelList[j]; |
| | | if(music.collection && !mainModelCollection) |
| | | { |
| | | mainModelCollection = true; |
| | | } |
| | | if (music.UniqueDeviceName == serverMusic.UniqueDeviceName) |
| | | { |
| | | |
| | | music.ServerClientType = 1; |
| | | mainModel = music; |
| | | music.Slave = tmepSlaves; |
| | | //过滤掉主播放器; |
| | | continue; |
| | |
| | | } |
| | | } |
| | | serverMusic.MainPlayName = str; |
| | | foreach(var music in A31MusicModel.A31MusicModelList) |
| | | { |
| | | if(music.ServerClientType == 1) |
| | | { |
| | | music.MainPlayCollection = mainModelCollection; |
| | | } |
| | | } |
| | | A31MusicModel.Save(); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | catch { } |
| | | } |
| | |
| | | { |
| | | if (tmepSlaves.slave_list.Count == 0) |
| | | { |
| | | |
| | | var host_music = A31MusicModel.A31MusicModelList.Find((c) => c.UniqueDeviceName == a31player.UniqueDeviceName); |
| | | if (host_music != null) |
| | | { |
| | |
| | | music.IsOnLine = false;//先不允许读取 |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | var host_a31player = A31MusicModel.A31MusicModelList.Find((c) => c.UniqueDeviceName == a31player.UniqueDeviceName); |
| | |
| | | }); |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 播放器名称 |
| | | /// </summary> |
| | | public string NamePlayer(A31MusicModel a31player) |
| | | { |
| | | if (a31player.ServerClientType == 1) |