From 7167334c0e89dd84827d59e726123d14776e3a09 Mon Sep 17 00:00:00 2001 From: 陈嘉乐 <cjl@hdlchina.com.cn> Date: 星期二, 16 六月 2020 11:14:13 +0800 Subject: [PATCH] 2020-06-16-1 --- HDL_ON/UI/Music/A31PlayMusicPage.cs | 75 +++++++++++++++++-------------------- 1 files changed, 35 insertions(+), 40 deletions(-) diff --git a/HDL_ON/UI/Music/A31PlayMusicPage.cs b/HDL_ON/UI/Music/A31PlayMusicPage.cs index 7805a56..b5c0cbe 100644 --- a/HDL_ON/UI/Music/A31PlayMusicPage.cs +++ b/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; -- Gitblit v1.8.0