| | |
| | | a31MusicModel.A31PlayStatus.loop = se.SearchForTextOfTag("LoopMode"); |
| | | a31MusicModel.A31PlayStatus.Source = se.SearchForTextOfTag("PlayMedium"); |
| | | a31MusicModel.A31PlayStatus.playSource = se.SearchForTextOfTag("TrackSource"); |
| | | a31MusicModel.A31PlayStatus.TrackURL = se.SearchForTextOfTag("TrackURI"); |
| | | a31MusicModel.A31PlayStatus.TrackURL = se.SearchForTextOfTag("TrackURI").Replace("&", "&"); |
| | | |
| | | } |
| | | catch (Exception ex) |
| | |
| | | } |
| | | finally |
| | | { |
| | | #region 更新其他界面音乐状态 |
| | | #region 更新其他界面音乐状态 |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | //秀桡加的 |
| | | a31MusicModel.on_off = a31MusicModel.A31PlayStatus.status == "play" ? "on" : "off"; |
| | | Console.WriteLine($"music 88ikgugjghgjkgkjhgkjhgkg {a31MusicModel.on_off}"); |
| | | Console.WriteLine($"music : {a31MusicModel.sid} : {a31MusicModel.on_off}"); |
| | | //HomePage. |
| | | HomePage.UpdataFunctionStates(a31MusicModel); |
| | | foreach (var e in A31MusicModel.A31MusicModelList) |
| | | { |
| | | //if() |
| | | RoomPage.UpdataStates(a31MusicModel); |
| | | } |
| | | }); |
| | | #endregion |
| | | } |
| | |
| | | foreach (SecurityElement track in SecurityElement.FromString(se.Text).SearchForChildByTag("Tracks").Children) |
| | | { |
| | | MusicInfo musicInfo = new MusicInfo(); |
| | | musicInfo.URL = track.SearchForTextOfTag("URL"); |
| | | musicInfo.URL = track.SearchForTextOfTag("URL").Replace("&", "&"); |
| | | var metadata = track.SearchForTextOfTag("Metadata").Replace("&", "&"); |
| | | var item = SecurityElement.FromString(metadata).SearchForChildByTag("item"); |
| | | musicInfo.Title = item.SearchForTextOfTag("dc:title"); |
| | | musicInfo.Artist = item.SearchForTextOfTag("upnp:artist"); |
| | | musicInfo.Album = item.SearchForTextOfTag("upnp:album"); |
| | | musicInfo.Title = item.SearchForTextOfTag("dc:title").Replace("&", "&"); |
| | | musicInfo.Artist = item.SearchForTextOfTag("upnp:artist").Replace("&", "&"); |
| | | musicInfo.Album = item.SearchForTextOfTag("upnp:album").Replace("&", "&"); |
| | | musicInfo.Duration = item.SearchForTextOfTag("res"); |
| | | musicInfo.AlbumId = item.SearchForTextOfTag("song:albumid"); |
| | | musicInfo.AlbumId = item.SearchForTextOfTag("song:albumid").Replace("&", "&"); |
| | | musicInfoList.Add(musicInfo); |
| | | } |
| | | return musicInfoList; |
| | |
| | | /// <param name="musicInfo">播放音乐</param> |
| | | /// <param name="listName">列表名称</param> |
| | | /// <param name="musicList">推送列表(默认推50首)</param> |
| | | public static void PushList(MusicInfo musicInfo, string listName, List<MusicInfo> musicList, A31MusicModel a31player) |
| | | public static void PushList(MusicInfo musicInfo, string listName, List<MusicInfo> musicList, A31MusicModel a31player,string musicSource) |
| | | { |
| | | |
| | | //最大发送的条数 |
| | |
| | | tempMusicInfo.URL = "http://" + new Shared.Net.NetWiFi().IpAddress + ":" + com.hdl.on.Server.Port + "/" + tempMusicInfo.ID; |
| | | } |
| | | |
| | | |
| | | sb.AppendLine("<Track" + Tracknumber + ">"); |
| | | sb.AppendLine("<URL>" + tempMusicInfo.URL + "</URL>"); |
| | | sb.AppendLine("<Metadata>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;"); |
| | |
| | | |
| | | sb.AppendLine("&lt;dc:title&gt;" + tempMusicInfo.Title + "&lt;/dc:title&gt;"); |
| | | sb.AppendLine("&lt;dc:creator&gt;DJ Sanny J&lt;/dc:creator&gt;"); |
| | | sb.AppendLine("&lt;upnp:artist&gt;" + tempMusicInfo.Artist + "&lt;/upnp:artist&gt;"); |
| | | if (musicSource== "我的列表") { |
| | | sb.AppendLine("&lt;upnp:artist&gt;" + listName + "&lt;/upnp:artist&gt;"); |
| | | } |
| | | else { |
| | | sb.AppendLine("&lt;upnp:artist&gt;" + tempMusicInfo.Artist + "&lt;/upnp:artist&gt;"); |
| | | } |
| | | sb.AppendLine("&lt;upnp:album&gt;" + tempMusicInfo.Album + "&lt;/upnp:album&gt;"); |
| | | sb.AppendLine("&lt;upnp:albumArtURI&gt;unknown&lt;/upnp:albumArtURI&gt;"); |
| | | sb.AppendLine("&lt;/item&gt;"); |
| | |
| | | byte[] recevieBytes = webClient.UploadData(new Uri("http://" + ip + ":" + port + "/upnp/control/PlayQueue1"), "POST", System.Text.Encoding.UTF8.GetBytes(listInfo)); |
| | | var s = System.Text.Encoding.UTF8.GetString(recevieBytes, 0, recevieBytes.Length); |
| | | } |
| | | catch |
| | | catch(Exception e) |
| | | { |
| | | |
| | | var d = e.Message; |
| | | } |
| | | } |
| | | |