陈嘉乐
2020-06-16 7167334c0e89dd84827d59e726123d14776e3a09
HDL_ON/UI/Music/A31PlayMusicPage.cs
@@ -26,11 +26,10 @@
                }
                catch { }
            }
        }
        View.PlayView playView = new View.PlayView();
        public void Show()
        {
            ///1秒定时更新状态
@@ -64,6 +63,35 @@
            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) =>
            {
@@ -118,34 +146,6 @@
                }
                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) =>
            {
@@ -345,6 +345,7 @@
            };
            ///音量进度条点击事件
            int startVolume =0;//之前的音量
            //int endVolume = 0;//现在的音量
            EventHandler<int> progressClick = (sender, e) =>
            {
                playView.volValueBtn.Text = playView.volSeekBar.Progress + "%";
@@ -412,6 +413,7 @@
            };
        }
        System.Threading.Thread timerThread;
        /// <summary>
        /// 定时更新状态
@@ -422,13 +424,6 @@
            {
                while (true)
                {
                    //if (startVolume != endVolume)
                    //{
                    //    startVolume = endVolume;
                    //    SendMethod.ControlVolume(endVolume, A31MusicModel.Current);
                    //    A31MusicModel.Current.A31PlayStatus.vol = endVolume.ToString();
                    //}
                    Application.RunOnMainThread(() =>
                    {
                        try
@@ -520,8 +515,8 @@
                            //更新播放器音量给系统音量
                            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;