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/A31PlayMusicPage.cs |  187 +++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 165 insertions(+), 22 deletions(-)

diff --git a/HDL_ON/UI/Music/A31PlayMusicPage.cs b/HDL_ON/UI/Music/A31PlayMusicPage.cs
index 23465d6..b6ef8f9 100644
--- a/HDL_ON/UI/Music/A31PlayMusicPage.cs
+++ b/HDL_ON/UI/Music/A31PlayMusicPage.cs
@@ -64,17 +64,17 @@
                     playView.loveBtn.IsSelected = !playView.loveBtn.IsSelected;
                     if (playView.loveBtn.IsSelected)
                     {
-                        if (null == A31MusicModel.Current.CnLoveRadioInfoList.Find((musicInfo) =>
+                        if (null == A31MusicModel.Current.LoveRadioInfoList.Find((musicInfo) =>
                         {
                             return url == musicInfo.URL;
                         }))
                         {
-                            A31MusicModel.Current.CnLoveRadioInfoList.Add(new MusicInfo { Title = song, URL = url, });
+                            A31MusicModel.Current.LoveRadioInfoList.Add(new MusicInfo { Title = song, URL = url, });
                         }
                     }
                     else
                     {
-                        A31MusicModel.Current.CnLoveRadioInfoList.RemoveAll((musicInfo) =>
+                        A31MusicModel.Current.LoveRadioInfoList.RemoveAll((musicInfo) =>
                         {
                             return url == musicInfo.URL;
                         });
@@ -156,7 +156,7 @@
                     Width = Application.GetRealWidth(344),
                     Height = Application.GetRealHeight(460),
                     BackgroundColor = Color.WhiteColor,
-                    Radius=(uint)Application.GetRealHeight(12),
+                    Radius = (uint)Application.GetRealHeight(12),
                 };
                 popFra.AddChidren(dialogFra);
                 dialogFra.AddChidren(loading);//dialogFra鍒锋柊鍥炬爣鐖舵帶浠�
@@ -210,7 +210,7 @@
                     Y = Application.GetRealHeight(15),
                     Width = Application.GetRealWidth(28 + 12),//28
                     Height = Application.GetRealHeight(20),
-                    TextID =StringId.cancelMusic,
+                    TextID = StringId.cancelMusic,
                     TextColor = Color.MusicNoTxetColor,
                     TextSize = TextSize.Text14,
                     TextAlignment = TextAlignment.CenterLeft,
@@ -261,7 +261,7 @@
                             A31MusicModel.Current.CurrentPlayMusicInfoList = new List<MusicInfo>();
                             return;
                         }
-                        var playString = SendMethod.GetCurrentPlayList();
+                        var playString = SendMethod.GetCurrentPlayList(A31MusicModel.Current);
                         A31MusicModel.Current.CurrentPlayMusicInfoList = new List<MusicInfo>();
                         var se = System.Security.SecurityElement.FromString(playString);
                         while (se.Children != null)
@@ -313,12 +313,11 @@
                 });
 
             };
-
             ///闊抽噺杩涘害鏉$偣鍑讳簨浠�
             EventHandler<int> progressClick = (sender, e) =>
             {
                 playView.volValueBtn.Text = playView.volSeekBar.Progress + "%";
-                A31MusicModel.Current.ControlVolume(playView.volSeekBar.Progress);
+                SendMethod.ControlVolume(playView.volSeekBar.Progress, A31MusicModel.Current);
                 A31MusicModel.Current.A31PlayStatus.vol = playView.volSeekBar.Progress.ToString();
             };
             playView.volSeekBar.OnProgressChangedEvent += progressClick;
@@ -327,7 +326,7 @@
             playView.prevBtn.MouseDownEventHandler += (sender, e) =>
             {
                 playView.prevBtn.IsSelected = true;
-                SendMethod.Previous();
+                SendMethod.Previous(A31MusicModel.Current);
             };
             playView.prevBtn.MouseUpEventHandler += (sender, e) =>
             {
@@ -339,13 +338,13 @@
                 if (playView.playBtn.IsSelected)
                 {
                     playView.playBtn.IsSelected = false;
-                    SendMethod.Pause();
+                    SendMethod.Pause(A31MusicModel.Current);
                     A31MusicModel.Current.A31PlayStatus.status = "pause";
                 }
                 else
                 {
                     playView.playBtn.IsSelected = true;
-                    SendMethod.Play();
+                    SendMethod.Play(A31MusicModel.Current);
                     A31MusicModel.Current.A31PlayStatus.status = "play";
                 }
             };
@@ -353,7 +352,7 @@
             playView.nextBtn.MouseDownEventHandler += (sender, e) =>
             {
                 playView.nextBtn.IsSelected = true;
-                SendMethod.Next();
+                SendMethod.Next(A31MusicModel.Current);
             };
             playView.nextBtn.MouseUpEventHandler += (sender, e) =>
             {
@@ -367,12 +366,11 @@
                     return;
                 }
                 playView.volSeekBar.Progress = volume;
-                A31MusicModel.Current.ControlVolume(playView.volSeekBar.Progress);
+                SendMethod.ControlVolume(playView.volSeekBar.Progress, A31MusicModel.Current);
                 A31MusicModel.Current.A31PlayStatus.vol = playView.volSeekBar.Progress.ToString();
             };
 
         }
-
         System.Threading.Thread timerThread;
         /// <summary>
         /// 瀹氭椂鏇存柊鐘舵��
@@ -403,22 +401,21 @@
 
                             switch (A31MusicModel.Current.A31PlayStatus.loop)
                             {
-
+                                case "0"://鍒楄〃寰幆
+                                    playView.playOrderBtn.UnSelectedImagePath = "MusicIcon/list.png";
+                                    break;
                                 case "1"://鍗曟洸椤虹幆
                                     playView.playOrderBtn.UnSelectedImagePath = "MusicIcon/single.png";
                                     break;
                                 case "2"://闅忔満鎾斁
                                     playView.playOrderBtn.UnSelectedImagePath = "MusicIcon/random.png";
                                     break;
-                                case "0"://鍒楄〃寰幆
-                                    playView.playOrderBtn.UnSelectedImagePath = "MusicIcon/list.png";
-                                    break;
                             }
 
 
                             if (A31MusicModel.Current.A31PlayStatus.Source == "RADIO-NETWORK")
                             {
-                                var v = A31MusicModel.Current.CnLoveRadioInfoList.Find((like) =>
+                                var v = A31MusicModel.Current.LoveRadioInfoList.Find((like) =>
                                 {
                                     return like.URL == A31MusicModel.Current.A31PlayStatus.TrackURL;
                                 });
@@ -509,7 +506,8 @@
                             }
                             playView.songNameTextView.Text = (A31MusicModel.Current.A31PlayStatus.Title == null ? "Unkown" : A31MusicModel.Current.A31PlayStatus.Title);
                             playView.singerBtn.Text = (A31MusicModel.Current.A31PlayStatus.Artist == null ? "Unkown" : A31MusicModel.Current.A31PlayStatus.Artist.Trim());
-
+                            //鏇存柊婧愮殑鐣岄潰
+                            showSourcePage();
                         }
                         catch (Exception e)
                         {
@@ -521,6 +519,150 @@
             })
             { IsBackground = true };
             timerThread.Start();
+        }
+        /// <summary>
+        /// 鏇存柊涓嶅悓闊充箰婧愮晫闈㈠浘鏍囩姸鎬�
+        /// </summary>
+        void showSourcePage()
+        {
+            playView.loveBtn.Alpha = 1;
+            playView.loveBtn.Enable = true;
+
+            playView.playlistBtn.Alpha = 1;
+            playView.playlistBtn.Enable = true;
+
+            playView.prevBtn.Alpha = 1;
+            playView.prevBtn.Enable = true;
+
+            playView.nextBtn.Alpha = 1;
+            playView.nextBtn.Enable = true;
+
+            playView.playOrderBtn.Alpha = 1;
+            playView.playOrderBtn.Enable = true;
+
+            //btnPlay.Alpha = 1;
+            //btnPlay.Enable = true;
+
+            playView.volSeekBar.IsClickable = true;
+
+            switch (A31MusicModel.Current.A31PlayStatus.Source)
+            {
+
+                case "QPLAY"://QQ闊充箰
+                    //currentsource.UnSelectedImagePath = "MusicIcon/qqmusic1.png";
+                    playView.loveBtn.Alpha = 0.5f;
+                    playView.loveBtn.Enable = false;
+                    break;
+                case "AIRPLAY"://閰风嫍闊充箰
+                    //currentsource.UnSelectedImagePath = "MusicIcon/kumusic.png";
+                    playView.loveBtn.Alpha = 0.5f;
+                    playView.loveBtn.Enable = false;
+                    playView.volSeekBar.IsClickable = false;
+                    break;
+                case "SONGLIST-NETWORK"://鏈湴闊充箰
+                    //currentsource.UnSelectedImagePath = "MusicIcon/musicMusic1.png";
+                    break;
+                case "SONGLIST-LOCAL"://USB
+                    //currentsource.UnSelectedImagePath = "MusicIcon/USB1.png";
+                    break;
+                case "RADIO-NETWORK"://鍦ㄧ嚎鐢靛彴
+                    //currentsource.UnSelectedImagePath = "MusicIcon/local1.png";
+                    playView.playlistBtn.Alpha = 1;
+                    playView.playlistBtn.Enable = true;
+
+                    playView.prevBtn.Alpha = 0.5f;
+                    playView.prevBtn.Enable = false;
+
+                    playView.nextBtn.Alpha = 0.5f;
+                    playView.nextBtn.Enable = false;
+
+                    playView.playOrderBtn.Alpha = 0.5f;
+                    playView.playOrderBtn.Enable = false;
+                    break;
+
+                case "STATION-NETWORK"://Pandora鐢靛彴
+                    playView.volSeekBar.IsClickable = false;
+                    //currentsource.UnSelectedImagePath = "MusicIcon/pandora1.png";
+                    playView.loveBtn.Alpha = 0.5f;
+                    playView.loveBtn.Enable = false;
+
+                    playView.prevBtn.Alpha = 0.5f;
+                    playView.prevBtn.Enable = false;
+
+                    playView.playOrderBtn.Alpha = 0.5f;
+                    playView.playOrderBtn.Enable = false;
+                    break;
+
+                case "BLUETOOTH"://钃濈墮
+                   // currentsource.UnSelectedImagePath = "MusicIcon/bluetooth1.png";
+                    playView.loveBtn.Alpha = 0.5f;
+                    playView.loveBtn.Enable = false;
+
+                    playView.playlistBtn.Alpha = 0.5f;
+                    playView.playlistBtn.Enable = false;
+
+                    playView.prevBtn.Alpha = 0.5f;
+                    playView.prevBtn.Enable = false;
+
+                    playView.nextBtn.Alpha = 0.5f;
+                    playView.nextBtn.Enable = false;
+
+                    playView.playOrderBtn.Alpha = 0.5f;
+                    playView.playOrderBtn.Enable = false;
+
+                    //btnPlay.Alpha = 0.5f;
+                    //btnPlay.Enable = false;
+                    break;
+
+
+                case "LINE-IN"://绾胯矾杈撳叆
+                    // currentsource.UnSelectedImagePath = "MusicIcon/muiscline1.png";
+                    playView.loveBtn.Alpha = 0.5f;
+                    playView.loveBtn.Enable = false;
+
+                    playView.playlistBtn.Alpha = 0.5f;
+                    playView.playlistBtn.Enable = false;
+
+                    playView.prevBtn.Alpha = 0.5f;
+                    playView.prevBtn.Enable = false;
+
+                    playView.nextBtn.Alpha = 0.5f;
+                    playView.nextBtn.Enable = false;
+
+                    playView.playOrderBtn.Alpha = 0.5f;
+                    playView.playOrderBtn.Enable = false;
+
+                    //btnPlay.Alpha = 0.5f;
+                    //btnPlay.Enable = false;
+                    break;
+
+                default:
+                    //currentsource.UnSelectedImagePath = "MusicIcon/dlna.png";
+                    playView.volSeekBar.IsClickable = false;
+                    playView.loveBtn.Alpha = 0.5f;
+                    playView.loveBtn.Enable = false;
+
+                    playView.playlistBtn.Alpha = 0.5f;
+                    playView.playlistBtn.Enable = false;
+
+                    playView.prevBtn.Alpha = 0.5f;
+                    playView.prevBtn.Enable = false;
+
+                    playView.nextBtn.Alpha = 0.5f;
+                    playView.nextBtn.Enable = false;
+
+                    playView.playOrderBtn.Alpha = 0.5f;
+                    playView.playOrderBtn.Enable = false;
+                    break;
+            }
+            //if (A31MusicModel.Current.A31PlayStatus.playSource == "UPnPServer")
+            //{
+            //    currentsource.UnSelectedImagePath = "MusicIcon/dlna.png";
+            //}
+            //else if (A31MusicModel.Current.A31PlayStatus.playSource == "Tidal")
+            //{
+            //    currentsource.UnSelectedImagePath = "MusicIcon/Tidal1.png";
+            //}
         }
         /// <summary>
         /// 鏄剧ず褰撳墠鎾斁闊充箰View
@@ -637,7 +779,7 @@
                             A31MusicModel.Current.A31PlayStatus.Title = songBtn.Text;
                             System.Threading.Tasks.Task.Run(() =>
                             {
-                                SendMethod.ListMusicPlay(playListName, clickBtn.Tag);
+                                SendMethod.ListMusicPlay(playListName, clickBtn.Tag, A31MusicModel.Current);
                             });
                         });
                     });
@@ -691,7 +833,8 @@
 
                     });
                 }
-            });
+            })
+            { IsBackground = true };
             updateSelectedMusicThread.Start();
         }
     }

--
Gitblit v1.8.0