From c209a50cabf524c146fb2d02ce09cfc46c7c2f70 Mon Sep 17 00:00:00 2001 From: 陈嘉乐 <cjl@hdlchina.com.cn> Date: 星期二, 26 五月 2020 13:49:02 +0800 Subject: [PATCH] 2020-05-26-1 --- HDL_ON/UI/Music/A31MusicModel.cs | 50 +++++--------------------------------------------- 1 files changed, 5 insertions(+), 45 deletions(-) diff --git a/HDL_ON/UI/Music/A31MusicModel.cs b/HDL_ON/UI/Music/A31MusicModel.cs index b165e95..b83e0cf 100644 --- a/HDL_ON/UI/Music/A31MusicModel.cs +++ b/HDL_ON/UI/Music/A31MusicModel.cs @@ -47,7 +47,7 @@ /// <summary> /// 闊充箰鎾斁鍣ㄥ悕绉� /// </summary> - public string Name; + public string Name=string.Empty; /// <summary> /// 涓婁竴娆℃洿鏂扮殑鏃堕棿 /// </summary> @@ -94,7 +94,7 @@ public bool IsOnLine = true; /// <summary> - /// 鍠滅埍鍒楄〃 + /// 鍠滅埍闊充箰鍒楄〃 /// </summary> public List<MusicInfo> LoveMusicInfoList = new List<MusicInfo>(); @@ -114,9 +114,9 @@ public List<MusicInfo> vTunerList = new List<MusicInfo>(); /// <summary> - /// 鐢靛彴鎵�鏈夊垪琛� + /// 鍠滅埍鐢靛彴鍒楄〃 /// </summary> - public List<MusicInfo> CnLoveRadioInfoList = new List<MusicInfo>(); + public List<MusicInfo> LoveRadioInfoList = new List<MusicInfo>(); /// <summary> /// Pandora鐢靛彴鎵�鏈夊垪琛� @@ -172,47 +172,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