From 05fd07b753b9cc043b48569d514af3d829bd039c Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期四, 28 五月 2020 13:08:33 +0800
Subject: [PATCH] 2020-05-28-1

---
 HDL_ON/UI/Music/A31MyList.cs                   |   28 ++--
 HDL_ON/UI/Music/A31LoveMusicList.cs            |    2 
 HDL_ON/UI/Music/A31PlayMusicPage.cs            |    3 
 .vs/HDL_APP_Project/xs/sqlite3/storage.ide-shm |    0 
 HDL_ON/UI/Music/A31MusicSourcePage.cs          |    3 
 .DS_Store                                      |    0 
 HDL_ON/UI/Music/A31LoveList.cs                 |  284 +++++++++++++++++++++++++++++++++++++++++++++-
 .vs/HDL_APP_Project/xs/sqlite3/storage.ide     |    0 
 .vs/HDL_APP_Project/xs/UserPrefs.xml           |   34 ++---
 .vs/HDL_APP_Project/xs/sqlite3/storage.ide-wal |    0 
 10 files changed, 307 insertions(+), 47 deletions(-)

diff --git a/.DS_Store b/.DS_Store
index 10860c0..a2788f2 100644
--- a/.DS_Store
+++ b/.DS_Store
Binary files differ
diff --git a/.vs/HDL_APP_Project/xs/UserPrefs.xml b/.vs/HDL_APP_Project/xs/UserPrefs.xml
index 1284165..3d0be76 100644
--- a/.vs/HDL_APP_Project/xs/UserPrefs.xml
+++ b/.vs/HDL_APP_Project/xs/UserPrefs.xml
@@ -1,16 +1,16 @@
 锘�<Properties StartupConfiguration="{09712674-2A38-407B-B1E2-560B2C352F9A}|Default">
-  <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/Music/View/MusicView.cs">
+  <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/Music/MusicMain.cs">
     <Files>
-      <File FileName="HDL_ON/UI/Music/A31PlayMusicPage.cs" Line="494" Column="37" />
-      <File FileName="../鏃х増鏈琈usic/MyMusic.cs" Line="385" Column="21" />
-      <File FileName="HDL_ON/UI/Music/A31MusicModel.cs" Line="176" Column="1" />
-      <File FileName="HDL_ON/UI/Music/A31USBMusicList.cs" Line="91" Column="58" />
-      <File FileName="HDL_ON/UI/Music/A31MyList.cs" Line="257" Column="30" />
-      <File FileName="HDL_ON/UI/Music/A31MyListMusic.cs" Line="207" Column="61" />
-      <File FileName="HDL_ON/UI/Music/A31MusicSourcePage.cs" Line="204" Column="40" />
-      <File FileName="HDL_ON/UI/Music/MusicMain.cs" Line="215" Column="28" />
-      <File FileName="HDL_ON/UI/Music/SendMethod.cs" Line="298" Column="23" />
-      <File FileName="HDL_ON/UI/Music/View/MusicView.cs" Line="102" Column="23" />
+      <File FileName="HDL_ON/UI/Music/A31PlayMusicPage.cs" Line="545" Column="1" />
+      <File FileName="../鏃х増鏈琈usic/MyMusic.cs" />
+      <File FileName="HDL_ON/UI/Music/A31MusicModel.cs" Line="136" Column="71" />
+      <File FileName="HDL_ON/UI/Music/A31MyList.cs" Line="329" Column="75" />
+      <File FileName="HDL_ON/UI/Music/A31MusicSourcePage.cs" Line="208" Column="22" />
+      <File FileName="HDL_ON/UI/Music/A31LoveList.cs" Line="172" Column="14" />
+      <File FileName="HDL_ON/UI/Music/A31LoveMusicList.cs" Line="347" Column="61" />
+      <File FileName="HDL_ON/UI/Music/A31LoveRadioList.cs" Line="49" Column="10" />
+      <File FileName="HDL_ON/UI/Music/A31MyListMusic.cs" Line="395" Column="46" />
+      <File FileName="HDL_ON/UI/Music/MusicMain.cs" Line="1" Column="1" />
     </Files>
     <Pads>
       <Pad Id="ProjectPad">
@@ -20,16 +20,8 @@
               <Node name="Common" expanded="True" />
               <Node name="UI" expanded="True">
                 <Node name="Music" expanded="True">
-                  <Node name="View" expanded="True">
-                    <Node name="MusicView.cs" selected="True" />
-                  </Node>
-                </Node>
-              </Node>
-            </Node>
-            <Node name="HDL-ON_Android" expanded="True">
-              <Node name="Assets" expanded="True">
-                <Node name="Phone" expanded="True">
-                  <Node name="MusicIcon" expanded="True" />
+                  <Node name="View" expanded="True" />
+                  <Node name="MusicMain.cs" selected="True" />
                 </Node>
               </Node>
             </Node>
diff --git a/.vs/HDL_APP_Project/xs/sqlite3/storage.ide b/.vs/HDL_APP_Project/xs/sqlite3/storage.ide
index c9e950d..90bbd93 100644
--- a/.vs/HDL_APP_Project/xs/sqlite3/storage.ide
+++ b/.vs/HDL_APP_Project/xs/sqlite3/storage.ide
Binary files differ
diff --git a/.vs/HDL_APP_Project/xs/sqlite3/storage.ide-shm b/.vs/HDL_APP_Project/xs/sqlite3/storage.ide-shm
index fbfa6e6..52cf3ee 100644
--- a/.vs/HDL_APP_Project/xs/sqlite3/storage.ide-shm
+++ b/.vs/HDL_APP_Project/xs/sqlite3/storage.ide-shm
Binary files differ
diff --git a/.vs/HDL_APP_Project/xs/sqlite3/storage.ide-wal b/.vs/HDL_APP_Project/xs/sqlite3/storage.ide-wal
index 26ff6fa..db9ac21 100644
--- a/.vs/HDL_APP_Project/xs/sqlite3/storage.ide-wal
+++ b/.vs/HDL_APP_Project/xs/sqlite3/storage.ide-wal
Binary files differ
diff --git a/HDL_ON/UI/Music/A31LoveList.cs b/HDL_ON/UI/Music/A31LoveList.cs
index 4937a67..6dc4eb7 100644
--- a/HDL_ON/UI/Music/A31LoveList.cs
+++ b/HDL_ON/UI/Music/A31LoveList.cs
@@ -1,5 +1,6 @@
 锘縰sing System;
 using System.Collections.Generic;
+using System.Text;
 using Shared;
 namespace HDL_ON.UI.Music
 {
@@ -20,10 +21,10 @@
             topView.topNameBtn.TextID = StringId.myLove;
             topView.clickBackBtn.MouseUpEventHandler += (sender, e) =>
             {
-                //if (updateSelectedMusicThread != null || updateSelectedMusicThread.IsAlive)
-                //{
-                //    updateSelectedMusicThread.Abort();
-                //}
+                if (updateSelectedMusicThread != null || updateSelectedMusicThread.IsAlive)
+                {
+                    updateSelectedMusicThread.Abort();
+                }
                 this.RemoveFromParent();
             };
 
@@ -38,7 +39,9 @@
             FileView();
             #endregion
         }
-
+        /// <summary>
+        /// 鍔犺浇鏂囦欢澶筕iew鐨勬柟娉�
+        /// </summary>
         void FileView()
         {
             for (int i = 0; i < 2; i++)
@@ -72,10 +75,7 @@
                 };
                 addFlieRow.AddChidren(playIconBtn);
 
-                playIconBtn.MouseUpEventHandler += (sender, e) =>
-                {
-                    //鐐瑰嚮鎸夐挳闅忔満鎾斁闊充箰
-                };
+
                 //鏂囦欢鍚嶆帶浠�
                 Button fileNameBtn = new Button
                 {
@@ -92,13 +92,30 @@
                 {
                     fileIconBtn.UnSelectedImagePath = "MusicIcon/loveMusic.png";
                     fileNameBtn.TextID = StringId.a31Music;
+                    playIconBtn.Tag = Language.StringByID(StringId.a31Music);//璁板綍鍒楄〃鍚�
                 }
                 else
                 {
                     fileIconBtn.UnSelectedImagePath = "MusicIcon/loveRadio.png";
                     fileNameBtn.TextID = StringId.radioLove;
+                    playIconBtn.Tag = Language.StringByID(StringId.radioLove);//璁板綍鍒楄〃鍚�
                 }
+                //鐐瑰嚮鎸夐挳闅忔満鎾斁闊充箰
+                playIconBtn.MouseUpEventHandler += (sender, e) =>
+                {
+                    //鐐瑰嚮鎸夐挳闅忔満鎾斁闊充箰
+                    if (fileNameBtn.Text == Language.StringByID(StringId.a31Music))
+                    {
+                        ///鍠滅埍闊充箰鍒楄〃
+                        SelectedPaly(fileNameBtn.Text, A31MusicModel.Current.LoveMusicInfoList, playIconBtn);
+                    }
+                    else
+                    {
+                        ///鍠滅埍鐢靛彴鍒楄〃
+                        SelectedPaly(fileNameBtn.Text, A31MusicModel.Current.LoveRadioInfoList, playIconBtn);
+                    }
 
+                };
                 Button clickBtn = new Button
                 {
                     X = fileIconBtn.Right + Application.GetRealWidth(16),
@@ -131,5 +148,254 @@
 
             }
         }
+        /// <summary>
+        /// 鏆傚仠/鎾斁鍥炬爣鐐瑰嚮鎾斁
+        /// </summary>
+        /// <param name="listName"></param>
+        /// <param name="listMusic"></param>
+        /// <param name="playIconBtn"></param>
+        void SelectedPaly(string listName, List<MusicInfo> listMusic, Button playIconBtn)
+        {
+
+            ///鏌ユ壘褰撳墠鎾斁闊充箰鏄惁杩欎釜鍒楄〃
+            if (playIconBtn.IsSelected)
+            {
+                if (listName == A31MusicModel.Current.A31PlayStatus.Artist && A31MusicModel.Current.A31PlayStatus.status == "play")
+                {
+
+                    SendMethod.Pause(A31MusicModel.Current);
+                    A31MusicModel.Current.A31PlayStatus.status = "pause";
+                }
+
+            }
+            else
+            {
+                if (listMusic.Count == 0)
+                {
+                    return;
+                }
+                if (listName == A31MusicModel.Current.A31PlayStatus.Artist && A31MusicModel.Current.A31PlayStatus.status != "play")
+                {
+                    SendMethod.Play(A31MusicModel.Current);
+                    A31MusicModel.Current.A31PlayStatus.status = "play";
+                }
+                else
+                {
+                    ///鍙栭殢鏈烘暟;
+                    var ra = new Random { }.Next(0, listMusic.Count);
+                    ///鏌ユ壘褰撳墠鐨勯煶涔�;
+                    var songs = listMusic[ra];
+                    //鐐瑰嚮鎸夐挳闅忔満鎾斁闊充箰
+                    System.Threading.Tasks.Task.Run(() =>
+                    {
+                        System.Threading.Thread.Sleep(50);
+                        Application.RunOnMainThread(() =>
+                        {
+                            //绉婚櫎鐣岄潰
+                            System.Threading.Tasks.Task.Run(() =>
+                            {
+                                PushList(songs, listName, listMusic);
+                            });
+                        });
+                    });
+                }
+
+            }
+        }
+        System.Threading.Thread updateSelectedMusicThread;
+        /// <summary>
+        /// 瀹氭椂鏇存柊鏂囦欢澶规挱鏀剧姸鎬�
+        /// </summary>
+        public void UpdateSelectedFile()
+        {
+            updateSelectedMusicThread = new System.Threading.Thread(() =>
+            {
+                while (this.Parent != null)
+                {
+                    System.Threading.Thread.Sleep(1000);
+                    Application.RunOnMainThread(() =>
+                    {
+                        try
+                        {
+                            for (int i = 0; i < middViewLayout.ChildrenCount; i++)
+                            {
+                                RowLayout view = (RowLayout)middViewLayout.GetChildren(i);
+                                var playBtn = (Button)view.GetChildren(1);//鐩存帴FrameLayout鐖舵帶浠舵壘鍒拌鎺т欢Button
+                                ///鏌ユ壘褰撳墠鎾斁闊充箰鏄惁杩欎釜鍒楄〃
+                                if (A31MusicModel.Current.A31PlayStatus.Artist == playBtn.Tag.ToString() && A31MusicModel.Current.A31PlayStatus.status == "play")
+                                {
+                                    playBtn.IsSelected = true;
+                                }
+                                else
+                                {
+                                    playBtn.IsSelected = false;
+                                }
+                            }
+                        }
+                        catch { }
+
+                    });
+                }
+            })
+            { IsBackground = true };
+            updateSelectedMusicThread.Start();
+        }
+        /// <summary>
+        /// 鎺ㄩ�佹挱鏀惧懡浠�
+        /// </summary>
+        /// <param name="musicInfo">鎾斁闊充箰</param>
+        /// <param name="listName">鍒楄〃鍚嶇О</param>
+        /// <param name="musicList">鎺ㄩ�佸垪琛�(榛樿鎺�50棣�)</param>
+        public void PushList(MusicInfo musicInfo, string listName, List<MusicInfo> musicList)
+        {
+
+            //鏈�澶у彂閫佺殑鏉℃暟
+            int maxCount = 50;
+            //鎵惧嚭褰撳墠鐐瑰嚮闊充箰鐨勭储寮�
+            int statIndex = musicList.FindIndex((obj) => { return obj == musicInfo; });
+            //鐐瑰嚮鍚庨潰杩樻湁澶氬皯鏉¢煶涔�
+            int count = musicList.Count - statIndex;
+            int endIndex = 0;
+            if (maxCount < count)
+            {
+                //濡傛灉鍚庨潰鐨勯煶涔愬ぇ浜庢渶澶ф暟锛岃缃悗闈㈡暟鎹殑鏈�澶х储寮� 
+                endIndex = statIndex + maxCount - 1;
+            }
+            else
+            {
+                //濡傛灉鍚庨潰鏁版嵁涓嶅锛屽氨鐢ㄦ�绘暟鍑忓幓鏈�澶ф潯鏁帮紝寰楀埌寮�濮嬬储寮�
+                statIndex = musicList.Count - maxCount - 1;
+                endIndex = musicList.Count - 1;
+            }
+            //濡傛灉寮�濮嬬储寮曞皬浜�0锛岄偅灏辫缃负绗竴鏉¢煶涔�
+            if (statIndex < 0)
+            {
+                statIndex = 0;
+            }
+
+            StringBuilder sb = new StringBuilder();
+            sb.AppendLine("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
+            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:CreateQueue xmlns:u=\"urn:schemas-wiimu-com:service:PlayQueue:1\">");
+            sb.AppendLine("<QueueContext>&lt;?xml version=\"1.0\"?&gt;");
+            sb.AppendLine("&lt;PlayList&gt;");
+            sb.AppendLine("&lt;ListName&gt;DLNA" + listName + "&lt;/ListName&gt;");
+            sb.AppendLine("&lt;ListInfo&gt;");
+            sb.AppendLine("&lt;Radio&gt;0&lt;/Radio&gt;");//
+            sb.AppendLine("&lt;SourceName&gt;UPnPServer&lt;/SourceName&gt;");//          
+            sb.AppendLine("&lt;MarkSearch&gt;0&lt;/MarkSearch&gt;");
+            sb.AppendLine("&lt;TrackNumber&gt;" + (endIndex - statIndex + 1) + "&lt;/TrackNumber&gt;");
+            sb.AppendLine("&lt;Quality&gt;0&lt;/Quality&gt;");
+            sb.AppendLine("&lt;UpdateTime&gt;5367&lt;/UpdateTime&gt;");
+            sb.AppendLine("&lt;LastPlayIndex&gt;2&lt;/LastPlayIndex&gt;");
+            sb.AppendLine("&lt;SwitchPageMode&gt;0&lt;/SwitchPageMode&gt;");
+            sb.AppendLine("&lt;CurrentPage&gt;0&lt;/CurrentPage&gt;");
+            sb.AppendLine("&lt;TotalPages&gt;0&lt;/TotalPages&gt;");
+            sb.AppendLine("&lt;/ListInfo&gt;");
+            sb.AppendLine("&lt;Tracks&gt;");
+
+            int number = 1;
+
+            for (int i = statIndex, Tracknumber = 1; i <= endIndex; i++, Tracknumber++)
+            {
+                var tempMusicInfo = musicList[i];
+
+                if (musicInfo == tempMusicInfo)
+                {
+                    number = Tracknumber;
+                }
+
+                if (tempMusicInfo.SourceType == "Local")
+                {
+                    tempMusicInfo.URL = "http://" + new Shared.Net.NetWiFi().IpAddress + ":" + com.hdl.on.Server.Port + "/" + tempMusicInfo.ID;
+                }
+
+
+                sb.AppendLine("&lt;Track" + Tracknumber + "&gt;");
+                sb.AppendLine("&lt;URL&gt;" + tempMusicInfo.URL + "&lt;/URL&gt;");
+                sb.AppendLine("&lt;Metadata&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;");
+                sb.AppendLine("&amp;lt;DIDL-Lite xmlns:dc=&amp;quot;http://purl.org/dc/elements/1.1/&amp;quot; xmlns:upnp=&amp;quot;urn:schemas-upnp-org:metadata-1-0/upnp/&amp;quot; xmlns:song=&amp;quot;www.wiimu.com/song/&amp;quot; xmlns=&amp;quot;urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/&amp;quot;&amp;gt;");
+                sb.AppendLine("&amp;lt;upnp:class&amp;gt;object.item.audioItem.musicTrack&amp;lt;/upnp:class&amp;gt;");
+                sb.AppendLine("&amp;lt;item id=&amp;quot;0&amp;quot;&amp;gt;");
+                sb.AppendLine("&amp;lt;song:subid&amp;gt;&amp;lt;/song:subid&amp;gt;");
+                sb.AppendLine("&amp;lt;song:description&amp;gt;unknown&amp;lt;/song:description&amp;gt;");
+                sb.AppendLine("&amp;lt;song:skiplimit&amp;gt;6&amp;lt;/song:skiplimit&amp;gt;");
+                sb.AppendLine("&amp;lt;song:id&amp;gt;" + tempMusicInfo.ID + "&amp;lt;/song:id&amp;gt;");
+                sb.AppendLine("&amp;lt;song:like&amp;gt;0&amp;lt;/song:like&amp;gt;");
+                sb.AppendLine("&amp;lt;song:singerid&amp;gt;0&amp;lt;/song:singerid&amp;gt;");
+                sb.AppendLine("&amp;lt;song:albumid&amp;gt;" + tempMusicInfo.AlbumId + "&amp;lt;/song:albumid&amp;gt;");
+
+                sb.AppendLine("&amp;lt;res protocolInfo=&amp;quot;http-get:*:audio/mpeg:DLNA.ORG_PN=MP3;DLNA.ORG_OP=01;&amp;quot; duration=&amp;quot;" + "0:0:0.0" + "&amp;quot;&amp;gt;" + tempMusicInfo.URL + "&amp;lt;/res&amp;gt;");
+
+                sb.AppendLine("&amp;lt;dc:title&amp;gt;" + tempMusicInfo.Title + "&amp;lt;/dc:title&amp;gt;");
+                sb.AppendLine("&amp;lt;dc:creator&amp;gt;DJ Sanny J&amp;lt;/dc:creator&amp;gt;");
+                sb.AppendLine("&amp;lt;upnp:artist&amp;gt;" + listName + "&amp;lt;/upnp:artist&amp;gt;");
+                sb.AppendLine("&amp;lt;upnp:album&amp;gt;" + tempMusicInfo.Album + "&amp;lt;/upnp:album&amp;gt;");
+                sb.AppendLine("&amp;lt;upnp:albumArtURI&amp;gt;unknown&amp;lt;/upnp:albumArtURI&amp;gt;");
+                sb.AppendLine("&amp;lt;/item&amp;gt;");
+                sb.AppendLine("&amp;lt;/DIDL-Lite&amp;gt;");
+                sb.AppendLine("&lt;/Metadata&gt;");
+                sb.AppendLine("&lt;Id&gt;" + tempMusicInfo.ID + "&lt;/Id&gt;");
+                sb.AppendLine("&lt;Source&gt;STATION-NETWORK&lt;/Source&gt;");//UPnPServer
+                sb.AppendLine("&lt;Key&gt;" + tempMusicInfo.URL + "&lt;/Key&gt;");
+                sb.AppendLine("&lt;/Track" + Tracknumber + "&gt;");
+            }
+            sb.AppendLine("&lt;/Tracks&gt;");
+            sb.AppendLine("&lt;/PlayList&gt;");
+            sb.AppendLine("</QueueContext>");
+            sb.AppendLine("</u:CreateQueue>");
+            sb.AppendLine("</s:Body>");
+            sb.AppendLine("</s:Envelope>");
+
+            SendMusicLists(A31MusicModel.Current.IPAddress, A31MusicModel.Current.Port, "CreateQueue", sb.ToString());
+
+            StringBuilder playString = new StringBuilder();
+            playString.AppendLine("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
+            playString.AppendLine("<s:Envelope s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\">");
+            playString.AppendLine("<s:Body>");
+            playString.AppendLine("<u:PlayQueueWithIndex xmlns:u=\"urn:schemas-wiimu-com:service:PlayQueue:1\">");
+            playString.AppendLine("<QueueName>DLNA" + listName + "</QueueName>");
+            playString.AppendLine("<Index>" + number + "</Index>");
+            playString.AppendLine("</u:PlayQueueWithIndex>");
+            playString.AppendLine("</s:Body>");
+            playString.AppendLine("</s:Envelope>");
+
+            Play(A31MusicModel.Current.IPAddress, A31MusicModel.Current.Port, playString.ToString());
+        }
+
+        void SendMusicLists(string ip, int port, string soapAction, string listInfo)
+        {
+            System.Net.WebClient webClient = new System.Net.WebClient();
+            webClient.Headers.Add("SOAPACTION", "\"urn:schemas-wiimu-com:service:PlayQueue:1#" + soapAction + "\"");
+            webClient.Headers.Add("CONTENT-TYPE", "text/xml; charset=\"utf-8\"");
+            try
+            {
+                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
+            {
+
+            }
+        }
+
+        void Play(string ip, int port, string info)
+        {
+            System.Net.WebClient webClient = new System.Net.WebClient();
+            webClient.Headers.Add("SOAPACTION", "\"urn:schemas-wiimu-com:service:PlayQueue:1#PlayQueueWithIndex\"");
+            webClient.Headers.Add("CONTENT-TYPE", "text/xml; charset=\"utf-8\"");
+            try
+            {
+                byte[] recevieBytes = webClient.UploadData(new Uri("http://" + ip + ":" + port + "/upnp/control/PlayQueue1"), "POST", System.Text.Encoding.UTF8.GetBytes(info));
+                var s = System.Text.Encoding.UTF8.GetString(recevieBytes, 0, recevieBytes.Length);
+            }
+            catch
+            {
+
+            }
+        }
+
+       
     }
 }  
diff --git a/HDL_ON/UI/Music/A31LoveMusicList.cs b/HDL_ON/UI/Music/A31LoveMusicList.cs
index 8e099af..9f97cd0 100644
--- a/HDL_ON/UI/Music/A31LoveMusicList.cs
+++ b/HDL_ON/UI/Music/A31LoveMusicList.cs
@@ -340,7 +340,7 @@
 
                 sb.AppendLine("&amp;lt;dc:title&amp;gt;" + tempMusicInfo.Title + "&amp;lt;/dc:title&amp;gt;");
                 sb.AppendLine("&amp;lt;dc:creator&amp;gt;DJ Sanny J&amp;lt;/dc:creator&amp;gt;");
-                sb.AppendLine("&amp;lt;upnp:artist&amp;gt;" + tempMusicInfo.Artist + "&amp;lt;/upnp:artist&amp;gt;");
+                sb.AppendLine("&amp;lt;upnp:artist&amp;gt;" + listName + "&amp;lt;/upnp:artist&amp;gt;");
                 sb.AppendLine("&amp;lt;upnp:album&amp;gt;" + tempMusicInfo.Album + "&amp;lt;/upnp:album&amp;gt;");
                 sb.AppendLine("&amp;lt;upnp:albumArtURI&amp;gt;unknown&amp;lt;/upnp:albumArtURI&amp;gt;");
                 sb.AppendLine("&amp;lt;/item&amp;gt;");
diff --git a/HDL_ON/UI/Music/A31MusicSourcePage.cs b/HDL_ON/UI/Music/A31MusicSourcePage.cs
index ee04479..cb3d9b2 100644
--- a/HDL_ON/UI/Music/A31MusicSourcePage.cs
+++ b/HDL_ON/UI/Music/A31MusicSourcePage.cs
@@ -194,6 +194,7 @@
                 MainPage.BasePageView.AddChidren(a31LoveList);
                 MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                 a31LoveList.Show();
+                a31LoveList.UpdateSelectedFile();
             };
             ///鎴戠殑鍒楄〃浜嬩欢
             myListView.clickBtn.MouseUpEventHandler += (sender, e) =>
@@ -201,7 +202,7 @@
                 A31MyList a31MyList = new A31MyList();
                 MainPage.BasePageView.AddChidren(a31MyList);
                 a31MyList.Show();
-                a31MyList.UpdateSelectedMusic();
+                a31MyList.UpdateSelectedFile();
                 MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
             };
             ///鏈湴闊充箰浜嬩欢
diff --git a/HDL_ON/UI/Music/A31MyList.cs b/HDL_ON/UI/Music/A31MyList.cs
index 033c614..92d8d3f 100644
--- a/HDL_ON/UI/Music/A31MyList.cs
+++ b/HDL_ON/UI/Music/A31MyList.cs
@@ -68,7 +68,7 @@
 
         }
         /// <summary>
-        ///
+        /// 鍔犺浇鏂囦欢澶筕iew鐨勬柟娉�
         /// </summary>
         void FileView()
         {
@@ -109,16 +109,12 @@
                 playIconBtn.MouseUpEventHandler = (sender, e) =>
                 {
 
-                    if (list.MusicInfoList.Count == 0)
-                    {
-                        return;
-                    }
+                   
 
                     ///鏌ユ壘褰撳墠鎾斁闊充箰鏄惁杩欎釜鍒楄〃
-                    var music = list.MusicInfoList.Find((c) => (c.URL == A31MusicModel.Current.A31PlayStatus.TrackURL) && (list.ListName == A31MusicModel.Current.A31PlayStatus.Artist));
                     if (playIconBtn.IsSelected)
                     {
-                        if (music != null && A31MusicModel.Current.A31PlayStatus.status == "play")
+                        if (list.ListName == A31MusicModel.Current.A31PlayStatus.Artist && A31MusicModel.Current.A31PlayStatus.status == "play")
                         {
 
                             SendMethod.Pause(A31MusicModel.Current);
@@ -128,7 +124,12 @@
                     }
                     else
                     {
-                        if (music != null && A31MusicModel.Current.A31PlayStatus.status != "play")
+                        if (list.MusicInfoList.Count == 0)
+                        {
+                            return;
+                        }
+
+                        if (list.ListName == A31MusicModel.Current.A31PlayStatus.Artist && A31MusicModel.Current.A31PlayStatus.status != "play")
                         {
                             SendMethod.Play(A31MusicModel.Current);
                             A31MusicModel.Current.A31PlayStatus.status = "play";
@@ -239,10 +240,10 @@
             }
         }
         /// <summary>
-        /// 瀹氭椂鏇存柊褰撳墠鎾斁闊充箰
+        /// 瀹氭椂鏇存柊鏂囦欢澶规挱鏀剧姸鎬�
         /// </summary>
         System.Threading.Thread updateSelectedMusicThread;
-        public void UpdateSelectedMusic()
+        public void UpdateSelectedFile()
         {
             updateSelectedMusicThread = new System.Threading.Thread(() =>
             {
@@ -259,8 +260,7 @@
                                 var playBtn = (Button)view.GetChildren(1);//鐩存帴FrameLayout鐖舵帶浠舵壘鍒拌鎺т欢Button
                                 var listIfon = playBtn.Tag as FileListInfo;//寮哄埗杞崲涓篎ileListInfo绫诲瀷;
                                 ///鏌ユ壘褰撳墠鎾斁闊充箰鏄惁杩欎釜鍒楄〃
-                                var musics = listIfon.MusicInfoList.Find((c) => c.URL == A31MusicModel.Current.A31PlayStatus.TrackURL);
-                                if (musics!=null&&A31MusicModel.Current.A31PlayStatus.Artist == listIfon.ListName && A31MusicModel.Current.A31PlayStatus.status == "play")
+                                if (A31MusicModel.Current.A31PlayStatus.Artist == listIfon.ListName && A31MusicModel.Current.A31PlayStatus.status == "play")
                                 {
                                     playBtn.IsSelected = true;
                                 }
@@ -274,10 +274,10 @@
 
                     });
                 }
-            });
+            })
+            { IsBackground = true };
             updateSelectedMusicThread.Start();
         }
-
         /// <summary>
         /// 鎺ㄩ�佹挱鏀惧懡浠�
         /// </summary>
diff --git a/HDL_ON/UI/Music/A31PlayMusicPage.cs b/HDL_ON/UI/Music/A31PlayMusicPage.cs
index 0f9f6a9..b6ef8f9 100644
--- a/HDL_ON/UI/Music/A31PlayMusicPage.cs
+++ b/HDL_ON/UI/Music/A31PlayMusicPage.cs
@@ -833,7 +833,8 @@
 
                     });
                 }
-            });
+            })
+            { IsBackground = true };
             updateSelectedMusicThread.Start();
         }
     }

--
Gitblit v1.8.0