From a09b0a281e9038cb137a40aec37c868654704dec Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期二, 09 六月 2020 17:33:35 +0800
Subject: [PATCH] 2020-06-09-3
---
HDL_ON/UI/Music/SendMethod.cs | 17 ++++++-----------
1 files changed, 6 insertions(+), 11 deletions(-)
diff --git a/HDL_ON/UI/Music/SendMethod.cs b/HDL_ON/UI/Music/SendMethod.cs
index b9b530d..60ec371 100644
--- a/HDL_ON/UI/Music/SendMethod.cs
+++ b/HDL_ON/UI/Music/SendMethod.cs
@@ -153,22 +153,17 @@
try
{
- if (a31MusicModel.ServerClientType == -1)
+ if (a31MusicModel.ServerClientType == 1)
{
- var result = OpenWeb("http://" + a31MusicModel.MainPlayIP + "/httpapi.asp?command=multiroom:getSlaveList");
- if (result != null)
+ var result = OpenWeb("http://" + a31MusicModel.IPAddress + "/httpapi.asp?command=multiroom:getSlaveList");
+ if (result != null && result != "Failed")
{
var slaves = Newtonsoft.Json.JsonConvert.DeserializeObject<Slaves>(result);
- if (slaves != null && slaves.slave_list != null)
+ if (slaves != null && slaves.slave_list != null && slaves.slave_list.Count != 0)
{
- var slave = slaves.slave_list.Find((obj) => obj.uuid.Replace("uuid:", "") == a31MusicModel.UniqueDeviceName);
- if (slave != null)
- {
- a31MusicModel.A31PlayStatus.vol = slave.volume;
- }
+ a31MusicModel.Slave = slaves;
}
}
- return;
}
WebClient webClient = new WebClient();
@@ -176,7 +171,7 @@
webClient.Headers.Add("CONTENT-TYPE", "text/xml; charset=\"utf-8\"");
var recevieBytes = webClient.UploadData(new Uri("http://" + a31MusicModel.IPAddress + ":" + a31MusicModel.Port + "/upnp/control/rendertransport1"), "POST", System.Text.Encoding.UTF8.GetBytes("<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?><s:Envelope s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\"><s:Body><u:GetInfoEx xmlns:u=\"urn:schemas-upnp-org:service:AVTransport:1\"><InstanceID>0</InstanceID></u:GetInfoEx></s:Body></s:Envelope>"));
- a31MusicModel.LastDateTime = DateTime.Now;
+ a31MusicModel.LastDateTime = DateTime.Now;//璁板綍鏁版嵁鍙嶉鐨勬椂闂�(鍥犱负鏈夋椂闂寸綉缁滃樊鏁版嵁涓嶅洖澶嶏紝瀵艰嚧褰撳墠鎾斁闊充箰鏃堕棿鏄剧ず涓嶆纭�)
var se = System.Security.SecurityElement.FromString(System.Text.Encoding.UTF8.GetString(recevieBytes)).SearchForChildByTag("s:Body").SearchForChildByTag("u:GetInfoExResponse");
--
Gitblit v1.8.0