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 | 67 ++++++++------------------------- 1 files changed, 17 insertions(+), 50 deletions(-) diff --git a/HDL_ON/UI/Music/A31MusicModel.cs b/HDL_ON/UI/Music/A31MusicModel.cs index b165e95..7d510c8 100644 --- a/HDL_ON/UI/Music/A31MusicModel.cs +++ b/HDL_ON/UI/Music/A31MusicModel.cs @@ -47,9 +47,11 @@ /// <summary> /// 闊充箰鎾斁鍣ㄥ悕绉� /// </summary> - public string Name; + 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; @@ -94,7 +98,7 @@ public bool IsOnLine = true; /// <summary> - /// 鍠滅埍鍒楄〃 + /// 鍠滅埍闊充箰鍒楄〃 /// </summary> public List<MusicInfo> LoveMusicInfoList = new List<MusicInfo>(); @@ -114,9 +118,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鐢靛彴鎵�鏈夊垪琛� @@ -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