| | |
| | | string msg = Language.StringByID(StringId.addMusicList) + list.ListName; |
| | | new PublicAssmebly().TipMsgAutoClose(msg, false); |
| | | }; |
| | | fileIconBtn.MouseUpEventHandler += click; |
| | | fileNameBtn.MouseUpEventHandler += click; |
| | | addFlieRow.MouseUpEventHandler += click; |
| | | } |
| | |
| | | /// <summary> |
| | | /// 选中组合的播放器的界面 |
| | | /// </summary> |
| | | public void PlayMergence() |
| | | public void PlayMergence(A31MusicModel a31MusicModel) |
| | | { |
| | | |
| | | #region |
| | |
| | | SelectedImagePath = "MusicIcon/selectedIcon.png", |
| | | }; |
| | | PlayRow.AddChidren(selectedIconBtn); |
| | | |
| | | |
| | | ///加大几点范围 |
| | | Button clickBtn = new Button |
| | |
| | | Height = Application.GetRealHeight(50), |
| | | }; |
| | | PlayRow.AddChidren(clickBtn); |
| | | |
| | | if (a31MusicModel.UniqueDeviceName == player.UniqueDeviceName) |
| | | { |
| | | clickBtn.IsSelected = selectedIconBtn.IsSelected = true; |
| | | playList1.Add(a31MusicModel); |
| | | } |
| | | clickBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | clickBtn.IsSelected = !clickBtn.IsSelected; |
| | |
| | | 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) |
| | |
| | | { |
| | | X = Application.GetRealWidth(289), |
| | | Y = Application.GetRealHeight(31), |
| | | Width = Application.GetRealWidth(26), |
| | | Width = Application.GetRealWidth(26+15), |
| | | Height = Application.GetRealHeight(17), |
| | | TextColor = Color.MusicNoTxetColor, |
| | | TextSize = TextSize.Text12, |
| | |
| | | Text = player.A31PlayStatus.vol + "%", |
| | | }; |
| | | volumeFra.AddChidren(valueBtn); |
| | | |
| | | |
| | | ///音量进度条点击事件 |
| | | EventHandler<int> progressClick = (sender, e) => |
| | |
| | | if (player.ServerClientType == -1) |
| | | { |
| | | valueBtn.Text = volSeekBar.Progress + "%"; |
| | | //SendMethod.ControlVolume(volSeekBar.Progress, player); |
| | | } |
| | | else if (player.ServerClientType == 1) |
| | | { |
| | |
| | | var button = (Button)frameLayout.GetChildren(2); |
| | | diyImageSeekBar.Progress = volSeekBar.Progress; |
| | | button.Text = volSeekBar.Progress + "%"; |
| | | //SendMethod.ControlVolume(volSeekBar.Progress, music); |
| | | } |
| | | } |
| | | }; |
| | |
| | | } |
| | | else if (currVolumePlay.ServerClientType == 1) |
| | | { |
| | | //先发主播放器音量命令 |
| | | SendMethod.ControlVolume(endVolume, currVolumePlay); |
| | | for (int j = 0; j < volumePlayList.Count; j++) |
| | | { |
| | | var music = volumePlayList[j]; |
| | | if (music.ServerClientType == 1) |
| | | { |
| | | continue; |
| | | } |
| | | System.Threading.Thread.Sleep(500); |
| | | //每个500毫秒发从播放器音量命令 |
| | | SendMethod.ControlVolume(endVolume, music); |
| | | } |
| | | } |