| | |
| | | } |
| | | catch { } |
| | | } |
| | | |
| | | |
| | | } |
| | | View.PlayView playView = new View.PlayView(); |
| | | |
| | | |
| | | |
| | | public void Show() |
| | | { |
| | | ///1秒定时更新状态 |
| | |
| | | playView.viewFrameLayout(middLayout); |
| | | #endregion |
| | | |
| | | |
| | | ///切换播放模式点击事件; |
| | | playView.playOrderBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | string msg = Language.StringByID(StringId.switchTo); |
| | | switch (A31MusicModel.Current.A31PlayStatus.loop) |
| | | { |
| | | //0列表循环,1单曲循环,2随机播放; |
| | | case "0": |
| | | A31MusicModel.Current.A31PlayStatus.loop = "1"; |
| | | playView.playOrderBtn.UnSelectedImagePath = "MusicIcon/single.png"; |
| | | msg += Language.StringByID(StringId.singleMode); |
| | | break; |
| | | |
| | | case "1": |
| | | A31MusicModel.Current.A31PlayStatus.loop = "2"; |
| | | playView.playOrderBtn.UnSelectedImagePath = "MusicIcon/random.png"; |
| | | msg += Language.StringByID(StringId.randomMode); |
| | | break; |
| | | case "2": |
| | | A31MusicModel.Current.A31PlayStatus.loop = "0"; |
| | | playView.playOrderBtn.UnSelectedImagePath = "MusicIcon/list.png"; |
| | | msg += Language.StringByID(StringId.listMode); |
| | | break; |
| | | } |
| | | new PublicAssmebly().TipMsgAutoClose(msg, false,1000); |
| | | string url = "http://" + A31MusicModel.Current.IPAddress + "/httpapi.asp?command=setPlayerCmd:" + "loopmode:" + A31MusicModel.Current.A31PlayStatus.loop; |
| | | SendMethod.SendCommand(url); |
| | | }; |
| | | ///添加喜爱点击事件; |
| | | playView.loveBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | |
| | | } |
| | | A31MusicModel.Save(); |
| | | }; |
| | | ///切换播放模式点击事件; |
| | | playView.playOrderBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | string msg = Language.StringByID(StringId.switchTo); |
| | | switch (A31MusicModel.Current.A31PlayStatus.loop) |
| | | { |
| | | //0列表循环,1单曲循环,2随机播放; |
| | | case "0": |
| | | A31MusicModel.Current.A31PlayStatus.loop = "1"; |
| | | playView.playOrderBtn.UnSelectedImagePath = "MusicIcon/single.png"; |
| | | msg += Language.StringByID(StringId.singleMode); |
| | | break; |
| | | |
| | | case "1": |
| | | A31MusicModel.Current.A31PlayStatus.loop = "2"; |
| | | playView.playOrderBtn.UnSelectedImagePath = "MusicIcon/random.png"; |
| | | msg += Language.StringByID(StringId.randomMode); |
| | | break; |
| | | case "2": |
| | | A31MusicModel.Current.A31PlayStatus.loop = "0"; |
| | | playView.playOrderBtn.UnSelectedImagePath = "MusicIcon/list.png"; |
| | | msg += Language.StringByID(StringId.listMode); |
| | | break; |
| | | } |
| | | new PublicAssmebly().TipMsgAutoClose(msg, false); |
| | | string url = "http://" + A31MusicModel.Current.IPAddress + "/httpapi.asp?command=setPlayerCmd:" + "loopmode:" + A31MusicModel.Current.A31PlayStatus.loop; |
| | | SendMethod.SendCommand(url); |
| | | }; |
| | | ///我的列表点击事件 |
| | | playView.playlistBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | |
| | | }; |
| | | ///音量进度条点击事件 |
| | | int startVolume =0;//之前的音量 |
| | | //int endVolume = 0;//现在的音量 |
| | | EventHandler<int> progressClick = (sender, e) => |
| | | { |
| | | playView.volValueBtn.Text = playView.volSeekBar.Progress + "%"; |
| | |
| | | }; |
| | | |
| | | } |
| | | |
| | | System.Threading.Thread timerThread; |
| | | /// <summary> |
| | | /// 定时更新状态 |
| | |
| | | { |
| | | while (true) |
| | | { |
| | | //if (startVolume != endVolume) |
| | | //{ |
| | | // startVolume = endVolume; |
| | | // SendMethod.ControlVolume(endVolume, A31MusicModel.Current); |
| | | // A31MusicModel.Current.A31PlayStatus.vol = endVolume.ToString(); |
| | | //} |
| | | |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | try |
| | |
| | | //更新播放器音量给系统音量 |
| | | Volume.MusicVolume = playView.volSeekBar.Progress; |
| | | //当前播放音乐时间 |
| | | int playSecond = int.Parse(A31MusicModel.Current.A31PlayStatus.curpos) / 1000+(int)(DateTime.Now - A31MusicModel.Current.LastDateTime).TotalSeconds; |
| | | |
| | | int playSecond = int.Parse(A31MusicModel.Current.A31PlayStatus.curpos) / 1000 + (int)(DateTime.Now - A31MusicModel.Current.LastDateTime).TotalSeconds; |
| | | |
| | | int playMusicMinute = playSecond / 60; |
| | | //秒钟 |
| | | int playMusicSecond = playSecond % 60; |