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/A31MusicModel.cs |   59 +++++++++++++----------------------------------------------
 1 files changed, 13 insertions(+), 46 deletions(-)

diff --git a/HDL_ON/UI/Music/A31MusicModel.cs b/HDL_ON/UI/Music/A31MusicModel.cs
index 5d29dd9..7d510c8 100644
--- a/HDL_ON/UI/Music/A31MusicModel.cs
+++ b/HDL_ON/UI/Music/A31MusicModel.cs
@@ -50,6 +50,8 @@
         public string Name=string.Empty;
         /// <summary>
         /// 涓婁竴娆℃洿鏂扮殑鏃堕棿
+        /// 璁板綍鏁版嵁鍙嶉鐨勬椂闂�(鍥犱负鏈夋椂闂寸綉缁滃樊鏁版嵁涓嶅洖澶嶏紝瀵艰嚧鍒锋柊褰撳墠鎾斁闊充箰鏃堕棿涓嶆纭�)
+        /// ((褰撳墠鏃堕棿)DateTime.Now - (璁板綍鏃堕棿)LastDateTimeLastDateTime).TotalSeconds=璇樊鏃堕棿(绉�)
         /// </summary>
         public DateTime LastDateTime;
         /// <summary>
@@ -62,8 +64,10 @@
         /// </summary>
         public int Port = 49153;
 
-
-        public bool IsEnd;
+        /// <summary>
+        /// 鏄惁鏄挱鏀惧櫒鍒楄〃鏈�鍚庝竴涓�(true)
+        /// </summary>
+        public bool IsEnd=false;
 
         public int A31DeviceType;
 
@@ -144,10 +148,13 @@
         /// </summary>
         public int ServerClientType;
         /// <summary>
-        /// 琛ㄧず浠庣殑鎾斁鍣↖P
+        /// 璁板綍涓绘挱鏀惧櫒IP
         /// </summary>
-        public string ServerIP = string.Empty;
-
+        public string MainPlayIP = string.Empty;
+        /// <summary>
+        /// 璁板綍涓绘挱鏀惧櫒鍚嶇О
+        /// </summary>
+        public string MainPlayName = string.Empty;
 
         public Slaves Slave = new Slaves();
 
@@ -172,47 +179,7 @@
             }
         }
 
-        /// <summary>
-        /// 璋冭妭闊抽噺
-        /// </summary>
-        /// <param name="volume">Volume.</param>
-        public void ControlVolume(int volume)
-        {
-            System.Threading.Tasks.Task.Run(() => {
-                ProgressDateTime = DateTime.Now;
-                try
-                {
-                    if (ServerClientType == -1)
-                    {
-                        new System.Net.WebClient().DownloadData(new Uri("http://" + ServerIP + "/httpapi.asp?command=multiroom:SlaveVolume:" + IPAddress + ":" + volume));
-                    }
-                    else if (ServerClientType == 1)
-                    {
-                        new System.Net.WebClient().DownloadData(new Uri("http://" + IPAddress + "/httpapi.asp?command=setPlayerCmd:slave_vol:" + volume));
-                    }
-                    else
-                    {
-                        var sb = new StringBuilder();
-                        sb.AppendLine("<s:Envelope s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\">");
-                        sb.AppendLine("<s:Body>");
-                        sb.AppendLine("<u:SetVolume xmlns:u=\"urn:schemas-upnp-org:service:RenderingControl:1\">");
-                        sb.AppendLine("<InstanceID>0</InstanceID>");
-                        sb.AppendLine("<Channel>Master</Channel>");
-                        sb.AppendLine("<DesiredVolume>" + volume + "</DesiredVolume>");
-                        sb.AppendLine("</u:SetVolume>");
-                        sb.AppendLine("</s:Body>");
-                        sb.AppendLine("</s:Envelope>");
-
-                        var webClient =new System.Net.WebClient();
-                        webClient.Headers.Add("SOAPACTION", "\"urn:schemas-upnp-org:service:RenderingControl:1#SetVolume\"");
-                        webClient.Headers.Add("CONTENT-TYPE", "text/xml; charset=\"utf-8\"");
-                        webClient.UploadData(new Uri("http://" + IPAddress + ":" + Port + "/upnp/control/rendercontrol1"), "POST", Encoding.UTF8.GetBytes(sb.ToString()));
-                    }
-                }
-                catch { }
-            });
-            
-        }
+       
 
         
     }

--
Gitblit v1.8.0