| | |
| | | } |
| | | catch { } |
| | | } |
| | | |
| | | } |
| | | View.PlayView playView = new View.PlayView(); |
| | | |
| | | |
| | | public void Show() |
| | | { |
| | | ///1秒定时更新状态 |
| | |
| | | this.AddChidren(middLayout); |
| | | ///加载播放音乐界面的控件方法 |
| | | playView.viewFrameLayout(middLayout); |
| | | //收藏图标事件 |
| | | playView.collectIconBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | playView.collectIconBtn.IsSelected = !playView.collectIconBtn.IsSelected; |
| | | if (playView.collectIconBtn.IsSelected) |
| | | { |
| | | A31MusicModel.Current.collection = true; |
| | | } |
| | | else |
| | | { |
| | | A31MusicModel.Current.collection = false; |
| | | } |
| | | |
| | | }; |
| | | #endregion |
| | | |
| | | |
| | | //快进滑动事件; |
| | | EventHandler<int> seekClick = (sender, e) => |
| | | { |
| | | int totalSecond = (int)(playView.diyArcSeekBar.Progress * 1.0f / 100 * int.Parse(A31MusicModel.Current.A31PlayStatus.totlen) / 1000); |
| | | //分钟 |
| | | int Minute = totalSecond / 60; |
| | | //秒钟 |
| | | int Second = totalSecond % 60; |
| | | string time = "00" + ":" + (Minute.ToString().Length < 2 ? "0" + Minute.ToString() : Minute.ToString()) + ":" + (Second.ToString().Length < 2 ? "0" + Second.ToString() : Second.ToString()); |
| | | SendMethod.Seek(time, A31MusicModel.Current); |
| | | A31MusicModel.Current.A31PlayStatus.curpos = (DateTime.Parse(time) - DateTime.Parse("00:00:00")).TotalMilliseconds.ToString(); |
| | | }; |
| | | //playView.diyArcSeekBar.OnProgressChangedEvent += seekClick; |
| | | playView.diyArcSeekBar.OnStopTrackingTouchEvent += seekClick;//快进滑动不发命令, |
| | | |
| | | ///切换播放模式点击事件; |
| | | playView.playOrderBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | |
| | | msg += Language.StringByID(StringId.listMode); |
| | | break; |
| | | } |
| | | new PublicAssmebly().TipMsgAutoClose(msg, false, 1000); |
| | | new PublicAssmebly().TipMsgAutoClose(msg, false,1000); |
| | | string url = "http://" + A31MusicModel.Current.IPAddress + "/httpapi.asp?command=setPlayerCmd:" + "loopmode:" + A31MusicModel.Current.A31PlayStatus.loop; |
| | | SendMethod.SendCommand(url); |
| | | }; |
| | |
| | | ///移除界面 |
| | | EventHandler<MouseEventArgs> removeFromParentView = (sen, e1) => |
| | | { |
| | | |
| | | |
| | | if (updateSelectedMusicThread != null) |
| | | { |
| | | try |
| | |
| | | } |
| | | }; |
| | | ///音量进度条点击事件 |
| | | int startVolume = 0;//之前的音量 |
| | | int startVolume =0;//之前的音量 |
| | | //int endVolume = 0;//现在的音量 |
| | | EventHandler<int> progressClick = (sender, e) => |
| | | { |
| | |
| | | playView.prevBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | playView.prevBtn.IsSelected = false; |
| | | }; |
| | | }; |
| | | ///暂停/播放点击事件 |
| | | playView.playBtn.MouseDownEventHandler += (sender, e) => |
| | | { |
| | |
| | | }; |
| | | |
| | | } |
| | | |
| | | |
| | | System.Threading.Thread timerThread; |
| | | /// <summary> |
| | | /// 定时更新状态 |
| | |
| | | playView.loveBtn.IsSelected = false; |
| | | } |
| | | } |
| | | |
| | | |
| | | playView.regionBtn.Text = A31MusicModel.Current.GetRoomListName(); |
| | | if (A31MusicModel.Current.collection) |
| | | { |
| | | playView.collectIconBtn.IsSelected = true; |
| | | } |
| | | else |
| | | { |
| | | playView.collectIconBtn.IsSelected = false; |
| | | } |
| | | //if (A31MusicModel.Current.A31PlayStatus.IsMute) |
| | | //{ |
| | | // btnMute.IsSelected = true;//静音图标 |
| | | // // btnMute.IsSelected = true;//静音图标 |
| | | // playView.volSeekBar.Progress = 0; |
| | | //} |
| | | //else |
| | | //{ |
| | | // btnMute.IsSelected = false;//静音图标 |
| | | // // btnMute.IsSelected = false;//静音图标 |
| | | // if (1000 < (DateTime.Now - A31MusicModel.ProgressDateTime).TotalMilliseconds) |
| | | // { |
| | | // //声音进度条; |
| | |
| | | if (totalSecond == 0) |
| | | { |
| | | //歌曲进度条 |
| | | //playView.volSeekBar.Progress = 0; |
| | | playView.diyArcSeekBar.Progress = 0; |
| | | } |
| | | else |
| | | { |
| | | //歌曲进度条 |
| | | //playView.volSeekBar.Progress = (int)(playSecond * 100.0 / totalSecond);//+1 |
| | | playView.diyArcSeekBar.Progress = (int)(playSecond * 100.0 / totalSecond);//+1 |
| | | } |
| | | |
| | | } |
| | |
| | | break; |
| | | |
| | | case "BLUETOOTH"://蓝牙 |
| | | // currentsource.UnSelectedImagePath = "MusicIcon/bluetooth1.png"; |
| | | // currentsource.UnSelectedImagePath = "MusicIcon/bluetooth1.png"; |
| | | playView.loveBtn.Alpha = 0.5f; |
| | | playView.loveBtn.Enable = false; |
| | | |
| | |
| | | artistNameBtn.X = songNameBtn.Right; |
| | | artistNameBtn.TextColor = Color.MusicNoTxetColor; |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | catch { } |
| | | |
| | | }); |
| | | } |
| | | }) |
| | |
| | | updateSelectedMusicThread.Start(); |
| | | } |
| | | } |
| | | } |
| | | } |