| | |
| | | //主控件 |
| | | Dialog dialog = new Dialog() |
| | | { |
| | | BackgroundColor = Color.PopupBackgroundColor, |
| | | BackgroundColor = MusicColor.PopupBackgroundColor, |
| | | }; |
| | | dialog.Show(); |
| | | //父控件 |
| | |
| | | Y = Application.GetRealHeight(187), |
| | | Width = Application.GetRealWidth(344), |
| | | Height = Application.GetRealHeight(460), |
| | | BackgroundColor = Color.WhiteColor, |
| | | BackgroundColor = MusicColor.WhiteColor, |
| | | Radius = (uint)Application.GetRealHeight(12), |
| | | }; |
| | | frame.AddChidren(dialogFra); |
| | |
| | | Height = Application.GetRealHeight(20), |
| | | TextID = StringId.cancelMusic, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = Color.MusicNoTxetColor, |
| | | TextColor = MusicColor.MusicNoTxetColor, |
| | | TextSize = TextSize.Text14, |
| | | }; |
| | | topFra.AddChidren(cancelnBtn); |
| | |
| | | Y = Application.GetRealHeight(23), |
| | | Width = Application.GetRealWidth(152), |
| | | Height = Application.GetRealHeight(22), |
| | | TextColor = Color.TextColor, |
| | | TextColor = MusicColor.TextColor, |
| | | TextSize = TextSize.Text16, |
| | | TextAlignment = TextAlignment.Center, |
| | | TextID = StringId.myList, |
| | |
| | | RowLayout addFlieRow = new RowLayout |
| | | { |
| | | Height = Application.GetRealHeight(78), |
| | | LineColor = Color.WhiteColor, |
| | | LineColor = MusicColor.WhiteColor, |
| | | SubViewWidth = Application.GetRealWidth(80),//改变编辑控件宽度多少; |
| | | }; |
| | | verticalScrolViewLayout.AddChidren(addFlieRow); |
| | |
| | | Y = Application.GetRealHeight(29), |
| | | Width = Application.GetRealWidth(189), |
| | | Height = Application.GetRealHeight(20), |
| | | TextColor = Color.TextColor, |
| | | TextColor = MusicColor.TextColor, |
| | | TextSize = TextSize.Text14, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | Text = list.ListName, |
| | |
| | | ///编辑控件 |
| | | var editBtn = new Button |
| | | { |
| | | BackgroundColor = Color.MusicEditColor, |
| | | BackgroundColor = MusicColor.MusicEditColor, |
| | | Text = Language.StringByID(StringId.editMusic), |
| | | TextColor = Color.WhiteColor, |
| | | TextColor = MusicColor.WhiteColor, |
| | | TextSize = TextSize.Text16, |
| | | }; |
| | | addFlieRow.AddRightView(editBtn); |
| | |
| | | ///删除控件 |
| | | var delBtn = new Button |
| | | { |
| | | BackgroundColor = Color.MusicDelColor, |
| | | BackgroundColor = MusicColor.MusicDelColor, |
| | | Text = Language.StringByID(StringId.delMusic), |
| | | TextColor = Color.WhiteColor, |
| | | TextColor = MusicColor.WhiteColor, |
| | | TextSize = TextSize.Text16, |
| | | }; |
| | | addFlieRow.AddRightView(delBtn); |
| | |
| | | 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 |
| | |
| | | //主控件 |
| | | Dialog dialog = new Dialog() |
| | | { |
| | | BackgroundColor = Color.PopupBackgroundColor, |
| | | BackgroundColor = MusicColor.PopupBackgroundColor, |
| | | }; |
| | | dialog.Show(); |
| | | //父控件 |
| | |
| | | Y = Application.GetRealHeight(397), |
| | | Width = Application.GetRealWidth(344), |
| | | Height = Application.GetRealHeight(250), |
| | | BackgroundColor = Color.WhiteColor, |
| | | BackgroundColor = MusicColor.WhiteColor, |
| | | Radius = (uint)Application.GetRealHeight(12), |
| | | }; |
| | | frame.AddChidren(dialogFra); |
| | |
| | | Height = Application.GetRealHeight(20), |
| | | TextID = StringId.cancelMusic, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = Color.MusicNoTxetColor, |
| | | TextColor = MusicColor.MusicNoTxetColor, |
| | | TextSize = TextSize.Text14, |
| | | }; |
| | | topFra.AddChidren(cancelnBtn); |
| | |
| | | Y = Application.GetRealHeight(14), |
| | | Width = Application.GetRealWidth(152), |
| | | Height = Application.GetRealHeight(22), |
| | | TextColor = Color.TextColor, |
| | | TextColor = MusicColor.TextColor, |
| | | TextSize = TextSize.Text16, |
| | | TextAlignment = TextAlignment.Center, |
| | | TextID = StringId.selectedMergence, |
| | |
| | | Height = Application.GetRealHeight(20), |
| | | TextID = StringId.confirmMusic, |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextColor = Color.SelectedColor, |
| | | TextColor = MusicColor.SelectedColor, |
| | | TextSize = TextSize.Text14, |
| | | }; |
| | | topFra.AddChidren(confirmBtn); |
| | |
| | | RowLayout PlayRow = new RowLayout |
| | | { |
| | | Height = Application.GetRealHeight(50), |
| | | LineColor = Color.WhiteColor, |
| | | LineColor = MusicColor.WhiteColor, |
| | | SubViewWidth = Application.GetRealWidth(80),//改变编辑控件宽度多少; |
| | | }; |
| | | verticalScrolViewLayout.AddChidren(PlayRow); |
| | |
| | | Y = Application.GetRealHeight(15), |
| | | Width = Application.GetRealWidth(150), |
| | | Height = Application.GetRealHeight(20), |
| | | TextColor = Color.TextColor, |
| | | TextColor = MusicColor.TextColor, |
| | | TextSize = TextSize.Text14, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | Text = NamePlayer(player), |
| | |
| | | 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; |
| | |
| | | X = Application.GetRealWidth(20), |
| | | Width = Application.GetRealWidth(304), |
| | | Height = 1, |
| | | BackgroundColor = Color.LineColor, |
| | | BackgroundColor = MusicColor.LineColor, |
| | | }; |
| | | PlayRow.AddChidren(lineBtn); |
| | | } |
| | |
| | | Y = Application.GetRealHeight(397), |
| | | Width = Application.GetRealWidth(344), |
| | | Height = Application.GetRealHeight(250), |
| | | BackgroundColor = Color.WhiteColor, |
| | | BackgroundColor = MusicColor.WhiteColor, |
| | | Radius = (uint)Application.GetRealHeight(12), |
| | | }; |
| | | frame.AddChidren(dialogFra); |
| | |
| | | Height = Application.GetRealHeight(20), |
| | | TextID = StringId.cancelMusic, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = Color.MusicNoTxetColor, |
| | | TextColor = MusicColor.MusicNoTxetColor, |
| | | TextSize = TextSize.Text14, |
| | | }; |
| | | topFra.AddChidren(cancelnBtn); |
| | |
| | | Y = Application.GetRealHeight(14), |
| | | Width = Application.GetRealWidth(152), |
| | | Height = Application.GetRealHeight(22), |
| | | TextColor = Color.TextColor, |
| | | TextColor = MusicColor.TextColor, |
| | | TextSize = TextSize.Text16, |
| | | TextAlignment = TextAlignment.Center, |
| | | TextID = StringId.readyPlay, |
| | |
| | | Height = Application.GetRealHeight(20), |
| | | TextID = StringId.confirmMusic, |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextColor = Color.SelectedColor, |
| | | TextColor = MusicColor.SelectedColor, |
| | | TextSize = TextSize.Text14, |
| | | }; |
| | | topFra.AddChidren(confirmBtn); |
| | |
| | | RowLayout addFlieRow = new RowLayout |
| | | { |
| | | Height = Application.GetRealHeight(50), |
| | | LineColor = Color.WhiteColor, |
| | | LineColor = MusicColor.WhiteColor, |
| | | }; |
| | | verticalScrolViewLayout.AddChidren(addFlieRow); |
| | | |
| | |
| | | Y = Application.GetRealHeight(15), |
| | | Width = Application.GetRealWidth(150), |
| | | Height = Application.GetRealHeight(20), |
| | | TextColor = Color.TextColor, |
| | | TextColor = MusicColor.TextColor, |
| | | TextSize = TextSize.Text14, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | Text = player.A31PlayStatus.Title, |
| | |
| | | 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, |
| | | TextColor = MusicColor.MusicNoTxetColor, |
| | | TextSize = TextSize.Text12, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | Text = "-" + player.A31PlayStatus.Artist.Trim(), |
| | | }; |
| | | addFlieRow.AddChidren(singerBtn); |
| | | if (wText > 280) |
| | | { |
| | | ///歌名长度小于250才可以显示歌手出来 |
| | | singerBtn.Width = Application.GetRealWidth(0); |
| | | } |
| | | } |
| | | else |
| | | { |
| | |
| | | Y = Application.GetRealHeight(15), |
| | | Width = Application.GetRealWidth(150), |
| | | Height = Application.GetRealHeight(20), |
| | | TextColor = Color.TextColor, |
| | | TextColor = MusicColor.TextColor, |
| | | TextSize = TextSize.Text14, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | Text = NamePlayer(player), |
| | |
| | | X = Application.GetRealWidth(20), |
| | | Width = Application.GetRealWidth(304), |
| | | Height = 1, |
| | | BackgroundColor = Color.LineColor, |
| | | BackgroundColor = MusicColor.LineColor, |
| | | }; |
| | | addFlieRow.AddChidren(lineBtn); |
| | | } |
| | |
| | | //主控件 |
| | | Dialog dialog = new Dialog() |
| | | { |
| | | BackgroundColor = Color.PopupBackgroundColor, |
| | | BackgroundColor = MusicColor.PopupBackgroundColor, |
| | | }; |
| | | dialog.Show(); |
| | | //父控件 |
| | |
| | | Y = Application.GetRealHeight(397), |
| | | Width = Application.GetRealWidth(344), |
| | | Height = Application.GetRealHeight(250), |
| | | BackgroundColor = Color.WhiteColor, |
| | | BackgroundColor = MusicColor.WhiteColor, |
| | | Radius = (uint)Application.GetRealHeight(12), |
| | | }; |
| | | frame.AddChidren(dialogFra); |
| | |
| | | Height = Application.GetRealHeight(20), |
| | | TextID = StringId.cancelMusic, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = Color.MusicNoTxetColor, |
| | | TextColor = MusicColor.MusicNoTxetColor, |
| | | TextSize = TextSize.Text14, |
| | | }; |
| | | topFra.AddChidren(cancelnBtn); |
| | |
| | | Y = Application.GetRealHeight(14), |
| | | Width = Application.GetRealWidth(152), |
| | | Height = Application.GetRealHeight(22), |
| | | TextColor = Color.TextColor, |
| | | TextColor = MusicColor.TextColor, |
| | | TextSize = TextSize.Text16, |
| | | TextAlignment = TextAlignment.Center, |
| | | TextID = StringId.checkTheReleasePlayer, |
| | |
| | | Height = Application.GetRealHeight(20), |
| | | TextID = StringId.confirmMusic, |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextColor = Color.SelectedColor, |
| | | TextColor = MusicColor.SelectedColor, |
| | | TextSize = TextSize.Text14, |
| | | }; |
| | | topFra.AddChidren(confirmBtn); |
| | |
| | | RowLayout PlayRow = new RowLayout |
| | | { |
| | | Height = Application.GetRealHeight(50), |
| | | LineColor = Color.WhiteColor, |
| | | LineColor = MusicColor.WhiteColor, |
| | | SubViewWidth = Application.GetRealWidth(80),//改变编辑控件宽度多少; |
| | | }; |
| | | verticalScrolViewLayout.AddChidren(PlayRow); |
| | |
| | | Y = Application.GetRealHeight(15), |
| | | Width = Application.GetRealWidth(150), |
| | | Height = Application.GetRealHeight(20), |
| | | TextColor = Color.TextColor, |
| | | TextColor = MusicColor.TextColor, |
| | | TextSize = TextSize.Text14, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | Text = NamePlayer(player), |
| | |
| | | X = Application.GetRealWidth(20), |
| | | Width = Application.GetRealWidth(304), |
| | | Height = 1, |
| | | BackgroundColor = Color.LineColor, |
| | | BackgroundColor = MusicColor.LineColor, |
| | | }; |
| | | PlayRow.AddChidren(lineBtn); |
| | | } |
| | |
| | | A31MusicModel currVolumePlay = null;//当前的播放器 |
| | | int startVolume = 0;//之前的音量 |
| | | int endVolume = 0;//现在的音量 |
| | | string if_volume ="";//标记是调节总音量还是单个播放器音量; |
| | | /// <summary> |
| | | /// 播放器音量的界面 |
| | | /// </summary> |
| | | /// <param name="a31player">主播放器</param> |
| | | public void PlayerVolumeView(A31MusicModel a31player) |
| | | { |
| | | volumePlayList.Clear(); |
| | | for (int i = 0; i < a31player.Slave.slave_list.Count; i++) |
| | | { |
| | | var slave = a31player.Slave.slave_list[i]; |
| | | var music_If = A31MusicModel.A31MusicModelList.Find((c) => c.UniqueDeviceName == slave.uuid.Replace("uuid:", "")); |
| | | if (music_If != null) |
| | | { |
| | | music_If.ServerClientType = -1; |
| | | music_If.A31PlayStatus.vol = slave.volume; |
| | | volumePlayList.Add(music_If); |
| | | } |
| | | } |
| | | volumePlayList.Add(a31player); |
| | | #region |
| | | //主控件 |
| | | Dialog volumedialog = new Dialog(); |
| | |
| | | //父控件 |
| | | FrameLayout frame = new FrameLayout { }; |
| | | volumedialog.AddChidren(frame); |
| | | frame.MouseUpEventHandler += (sen, e) => |
| | | { |
| | | volumedialog.Close(); |
| | | if (updateVolumeThread != null) |
| | | { |
| | | try |
| | | { |
| | | if (updateVolumeThread.IsAlive) |
| | | { |
| | | updateVolumeThread.Abort(); |
| | | } |
| | | } |
| | | catch { } |
| | | } |
| | | }; |
| | | //白色快父控件 |
| | | FrameLayout dialogFra = new FrameLayout() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealHeight(397), |
| | | Y = Application.GetRealHeight(397-20), |
| | | Width = Application.GetRealWidth(344), |
| | | Height = Application.GetRealHeight(250), |
| | | BackgroundColor = Color.WhiteColor, |
| | | Height = Application.GetRealHeight(250+20), |
| | | BackgroundColor = MusicColor.WhiteColor, |
| | | Radius = (uint)Application.GetRealHeight(12), |
| | | }; |
| | | frame.AddChidren(dialogFra); |
| | | #region 确认 取消 |
| | | //显示头部信息父控件 |
| | | FrameLayout topFra = new FrameLayout() |
| | | { |
| | |
| | | Height = Application.GetRealHeight(20), |
| | | TextID = StringId.cancelMusic, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = Color.MusicNoTxetColor, |
| | | TextColor = MusicColor.MusicNoTxetColor, |
| | | TextSize = TextSize.Text14, |
| | | }; |
| | | topFra.AddChidren(cancelnBtn); |
| | | cancelnBtn.MouseUpEventHandler += (sen, e) => |
| | | { |
| | | volumedialog.Close(); |
| | | if (updateVolumeThread != null) |
| | | { |
| | | try |
| | | { |
| | | if (updateVolumeThread.IsAlive) |
| | | { |
| | | updateVolumeThread.Abort(); |
| | | } |
| | | } |
| | | catch { } |
| | | } |
| | | }; |
| | | //标题控件 |
| | | Button txetBtn = new Button |
| | | { |
| | |
| | | Y = Application.GetRealHeight(14), |
| | | Width = Application.GetRealWidth(152), |
| | | Height = Application.GetRealHeight(22), |
| | | TextColor = Color.TextColor, |
| | | TextColor = MusicColor.TextColor, |
| | | TextSize = TextSize.Text16, |
| | | TextAlignment = TextAlignment.Center, |
| | | TextID = StringId.volumeAdjustment, |
| | |
| | | Height = Application.GetRealHeight(20), |
| | | TextID = StringId.confirmMusic, |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextColor = Color.SelectedColor, |
| | | TextColor = MusicColor.SelectedColor, |
| | | TextSize = TextSize.Text14, |
| | | }; |
| | | topFra.AddChidren(confirmBtn); |
| | | confirmBtn.MouseUpEventHandler += (sen, e) => |
| | | { |
| | | |
| | | EventHandler<MouseEventArgs> eventHandler= (sen,e) => { |
| | | volumedialog.Close(); |
| | | if (updateVolumeThread != null) |
| | | { |
| | |
| | | catch { } |
| | | } |
| | | }; |
| | | cancelnBtn.MouseUpEventHandler += eventHandler; |
| | | confirmBtn.MouseUpEventHandler += eventHandler; |
| | | frame.MouseUpEventHandler += eventHandler; |
| | | #endregion |
| | | #region 总音量的View |
| | | FrameLayout totalVolumeFra = new FrameLayout |
| | | { |
| | | Height = Application.GetRealHeight(64), |
| | | Y = Application.GetRealHeight(58), |
| | | }; |
| | | dialogFra.AddChidren(totalVolumeFra); |
| | | Button totalvolumeTextBtn = new Button |
| | | { |
| | | X = Application.GetRealWidth(28), |
| | | Y = Application.GetRealHeight(8), |
| | | Width = Application.GetRealWidth(200), |
| | | Height = Application.GetRealHeight(14), |
| | | TextColor = MusicColor.MusicNoTxetColor, |
| | | TextSize = TextSize.Text10, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | Text = Language.StringByID(StringId.totalVolume), |
| | | }; |
| | | totalVolumeFra.AddChidren(totalvolumeTextBtn); |
| | | DiyImageSeekBar totalVolSeekBar = new DiyImageSeekBar |
| | | { |
| | | Y = Application.GetRealHeight(12), |
| | | X = Application.GetRealWidth(28), |
| | | Width = Application.GetRealWidth(240), |
| | | Height = Application.GetRealHeight(54),//进度条父控件背景高度 |
| | | IsProgressTextShow = false,//显示百分比 |
| | | IsClickable = true,//进度条是否滑动 |
| | | ProgressBarColor = MusicColor.SelectedColor,//选中进度条颜色 |
| | | ThumbImagePath = "MusicIcon/progressIcon.png",//进度条按钮图标 |
| | | ThumbImageHeight = Application.GetMinRealAverage(54),//进度条按钮图标的高度(默认正方形:宽和高一样) |
| | | SeekBarViewHeight = Application.GetMinRealAverage(8),//进度条的高度 |
| | | Progress = int.Parse(a31player.A31PlayStatus.vol), |
| | | //ProgressChangeDelayTime= |
| | | }; |
| | | totalVolumeFra.AddChidren(totalVolSeekBar); |
| | | |
| | | Button totalVolumeValueBtn = new Button |
| | | { |
| | | X = Application.GetRealWidth(289), |
| | | Y = Application.GetRealHeight(31), |
| | | Width = Application.GetRealWidth(26 + 15), |
| | | Height = Application.GetRealHeight(17), |
| | | TextColor = MusicColor.MusicNoTxetColor, |
| | | TextSize = TextSize.Text12, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | Text = totalVolSeekBar.Progress.ToString() + "%", |
| | | }; |
| | | totalVolumeFra.AddChidren(totalVolumeValueBtn); |
| | | #endregion |
| | | |
| | | VerticalScrolViewLayout volumeViewLayout = new VerticalScrolViewLayout |
| | | { |
| | | Y = Application.GetRealHeight(58), |
| | | Height = dialogFra.Height - Application.GetRealHeight(58), |
| | | Y =Application.GetRealHeight(58+64), |
| | | Height = dialogFra.Height - Application.GetRealHeight(58+64), |
| | | Width = Application.GetRealWidth(343), |
| | | }; |
| | | dialogFra.AddChidren(volumeViewLayout); |
| | | volumePlayList.Clear(); |
| | | for (int i = 0; i < a31player.Slave.slave_list.Count; i++) |
| | | { |
| | | var slave = a31player.Slave.slave_list[i]; |
| | | var music_If = A31MusicModel.A31MusicModelList.Find((c) => c.UniqueDeviceName == slave.uuid.Replace("uuid:", "")); |
| | | if (music_If != null) |
| | | { |
| | | music_If.ServerClientType = -1; |
| | | music_If.A31PlayStatus.vol = slave.volume; |
| | | volumePlayList.Add(music_If); |
| | | } |
| | | } |
| | | volumePlayList.Add(a31player); |
| | | |
| | | for (int i = 0; i < volumePlayList.Count; i++) |
| | | { |
| | | var player = volumePlayList[i]; |
| | | #region 调节当个播放器View |
| | | FrameLayout volumeFra = new FrameLayout |
| | | { |
| | | Height = Application.GetRealHeight(64), |
| | |
| | | Y = Application.GetRealHeight(8), |
| | | Width = Application.GetRealWidth(200), |
| | | Height = Application.GetRealHeight(14), |
| | | TextColor = Color.MusicNoTxetColor, |
| | | TextColor = MusicColor.MusicNoTxetColor, |
| | | TextSize = TextSize.Text10, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | Text = player.Name + Language.StringByID(StringId.volumeMusic), |
| | | |
| | | }; |
| | | volumeFra.AddChidren(volumeTextBtn); |
| | | if (player.ServerClientType == -1) |
| | | { |
| | | volumeTextBtn.Text = player.Name + Language.StringByID(StringId.volumeMusic); |
| | | } |
| | | else if (player.ServerClientType == 1) |
| | | { |
| | | volumeTextBtn.Text = Language.StringByID(StringId.totalVolume); |
| | | } |
| | | |
| | | DiyImageSeekBar volSeekBar = new DiyImageSeekBar |
| | | { |
| | |
| | | Height = Application.GetRealHeight(54),//进度条父控件背景高度 |
| | | IsProgressTextShow = false,//显示百分比 |
| | | IsClickable = true,//进度条是否滑动 |
| | | ProgressBarColor = Color.SelectedColor,//选中进度条颜色 |
| | | ProgressBarColor = MusicColor.SelectedColor,//选中进度条颜色 |
| | | ThumbImagePath = "MusicIcon/progressIcon.png",//进度条按钮图标 |
| | | ThumbImageHeight = Application.GetMinRealAverage(54),//进度条按钮图标的高度(默认正方形:宽和高一样) |
| | | SeekBarViewHeight = Application.GetMinRealAverage(8),//进度条的高度 |
| | |
| | | { |
| | | X = Application.GetRealWidth(289), |
| | | Y = Application.GetRealHeight(31), |
| | | Width = Application.GetRealWidth(26), |
| | | Width = Application.GetRealWidth(26+15), |
| | | Height = Application.GetRealHeight(17), |
| | | TextColor = Color.MusicNoTxetColor, |
| | | TextColor = MusicColor.MusicNoTxetColor, |
| | | TextSize = TextSize.Text12, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | Text = player.A31PlayStatus.vol + "%", |
| | | }; |
| | | volumeFra.AddChidren(valueBtn); |
| | | |
| | | |
| | | #endregion |
| | | ///音量进度条点击事件 |
| | | EventHandler<int> progressClick = (sender, e) => |
| | | { |
| | | |
| | | if (currVolumePlay == null || (currVolumePlay != null && currVolumePlay.UniqueDeviceName != player.UniqueDeviceName)) |
| | | { |
| | | currVolumePlay = player; |
| | | } |
| | | endVolume = e; |
| | | if (player.ServerClientType == -1) |
| | | { |
| | | valueBtn.Text = volSeekBar.Progress + "%"; |
| | | //SendMethod.ControlVolume(volSeekBar.Progress, player); |
| | | } |
| | | else if (player.ServerClientType == 1) |
| | | { |
| | | for (int j = 0; j < volumePlayList.Count; j++) |
| | | { |
| | | var music = volumePlayList[j]; |
| | | var frameLayout = (FrameLayout)volumeViewLayout.GetChildren(j); |
| | | var diyImageSeekBar = (DiyImageSeekBar)frameLayout.GetChildren(1); |
| | | var button = (Button)frameLayout.GetChildren(2); |
| | | diyImageSeekBar.Progress = volSeekBar.Progress; |
| | | button.Text = volSeekBar.Progress + "%"; |
| | | //SendMethod.ControlVolume(volSeekBar.Progress, music); |
| | | } |
| | | } |
| | | if_volume = "Volume"; |
| | | valueBtn.Text = volSeekBar.Progress + "%"; |
| | | }; |
| | | volSeekBar.OnProgressChangedEvent += progressClick; |
| | | volSeekBar.OnStopTrackingTouchEvent += progressClick; |
| | | } |
| | | |
| | | EventHandler<int> totalProgressClick = (sender, e) => |
| | | { |
| | | if_volume = "totalVolume"; |
| | | endVolume = e; |
| | | totalVolumeValueBtn.Text = totalVolSeekBar.Progress + "%"; |
| | | for (int j = 0; j < volumePlayList.Count; j++) |
| | | { |
| | | var music = volumePlayList[j]; |
| | | var frameLayout = (FrameLayout)volumeViewLayout.GetChildren(j); |
| | | var diyImageSeekBar = (DiyImageSeekBar)frameLayout.GetChildren(1); |
| | | var button = (Button)frameLayout.GetChildren(2); |
| | | diyImageSeekBar.Progress = totalVolSeekBar.Progress; |
| | | button.Text = totalVolSeekBar.Progress + "%"; |
| | | } |
| | | }; |
| | | totalVolSeekBar.OnProgressChangedEvent += totalProgressClick; |
| | | totalVolSeekBar.OnStopTrackingTouchEvent += totalProgressClick; |
| | | #endregion |
| | | |
| | | } |
| | |
| | | while (true) |
| | | { |
| | | System.Threading.Thread.Sleep(500); |
| | | if (startVolume == endVolume || currVolumePlay == null) |
| | | if (startVolume == endVolume) |
| | | { |
| | | continue; |
| | | } |
| | | startVolume = endVolume; |
| | | |
| | | if (currVolumePlay.ServerClientType == -1) |
| | | { |
| | | SendMethod.ControlVolume(endVolume, currVolumePlay); |
| | | } |
| | | else if (currVolumePlay.ServerClientType == 1) |
| | | if (if_volume == "totalVolume") |
| | | { |
| | | for (int j = 0; j < volumePlayList.Count; j++) |
| | | { |
| | | var music = volumePlayList[j]; |
| | | //每个500毫秒发从播放器音量命令 |
| | | SendMethod.ControlVolume(endVolume, music); |
| | | System.Threading.Thread.Sleep(1000); |
| | | |
| | | } |
| | | } |
| | | else if(if_volume == "Volume") |
| | | { |
| | | if (currVolumePlay == null) |
| | | { |
| | | continue; |
| | | } |
| | | SendMethod.ControlVolume(endVolume, currVolumePlay); |
| | | } |
| | | |
| | | |
| | | } |
| | | } |