From 49248e3bdff0458f8f6f4156d1425bd6f6074e32 Mon Sep 17 00:00:00 2001
From: lss <lsc@hdlchina.com.cn>
Date: 星期二, 17 五月 2022 13:17:21 +0800
Subject: [PATCH] Merge branch 'dev' into lss

---
 HDL_ON/UI/UI2/FuntionControlView/Music/A31MusicSourcePage.cs |  225 +++++++++++++++++--------------------------------------
 1 files changed, 70 insertions(+), 155 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/Music/A31MusicSourcePage.cs b/HDL_ON/UI/UI2/FuntionControlView/Music/A31MusicSourcePage.cs
index 3db0642..8dba2e9 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Music/A31MusicSourcePage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Music/A31MusicSourcePage.cs
@@ -33,7 +33,7 @@
             #region 鍩虹淇℃伅锛� 鎾斁鍣� 钃濈墮 鍖哄煙锛�
             FrameLayout fL1 = new FrameLayout
             {
-                Height = Application.GetRealHeight(202),
+                Height = Application.GetRealHeight(202-50),
                 Width = Application.GetRealWidth(375),
             };
             middViewLayout.AddChidren(fL1);
@@ -50,17 +50,11 @@
             View.MusicSourceView playNameView = new View.MusicSourceView();
             playNameView.fLayout.Y = musicIfonView.fLayout.Bottom;
             playNameView.textBtn.TextID = StringId.playerName;
-            playNameView.inputTextBtn.Text = A31MusicModel.Current.Name;
+            playNameView.inputTextBtn.Text = A31MusicModel.Current.functionMusic.name;
             playNameView.FrameLayoutView(fL1, false);
 
-            View.MusicSourceView bluetoothNameView = new View.MusicSourceView();
-            bluetoothNameView.fLayout.Y = playNameView.fLayout.Bottom;
-            bluetoothNameView.textBtn.TextID = StringId.bluetoothName;
-            bluetoothNameView.inputTextBtn.Text = A31MusicModel.Current.Name;
-            bluetoothNameView.FrameLayoutView(fL1, false);
-
             View.MusicSourceView areaText = new View.MusicSourceView();
-            areaText.fLayout.Y = bluetoothNameView.fLayout.Bottom;
+            areaText.fLayout.Y = playNameView.fLayout.Bottom;
             areaText.FrameLayoutView(fL1, false);
             areaText.nextLevelBtn.X = Application.GetRealWidth(339);
             areaText.nextLevelBtn.Y = Application.GetRealHeight(17);
@@ -70,7 +64,7 @@
             areaText.lineBtn.BackgroundColor = MusicColor.WhiteColor;
             areaText.textBtn.X = Application.GetRealWidth(16);
             areaText.textBtn.TextID = StringId.region;
-            areaText.inputTextBtn.Text = A31MusicModel.Current.GetRoomListName();
+            areaText.inputTextBtn.Text = A31MusicModel.Current.functionMusic.GetRoomListName();
 
             #endregion
 
@@ -80,7 +74,7 @@
                 Height = Application.GetRealHeight(152),
                 Width = Application.GetRealWidth(375),
             };
-            middViewLayout.AddChidren(fL2);
+            //middViewLayout.AddChidren(fL2);
 
             View.MusicSourceView playListView = new View.MusicSourceView();
             playListView.fLayout.Height = Application.GetRealHeight(44);
@@ -111,7 +105,7 @@
                 Height = Application.GetRealHeight(352),
                 Width = Application.GetRealWidth(375),
             };
-            middViewLayout.AddChidren(fL3);
+            //middViewLayout.AddChidren(fL3);
 
             View.MusicSourceView selectedSourceView = new View.MusicSourceView();
             selectedSourceView.fLayout.Height = Application.GetRealHeight(44);
@@ -120,43 +114,27 @@
             selectedSourceView.textBtn.TextSize = TextSize.Text16;
             selectedSourceView.inputTextBtn.Visible = false;
             selectedSourceView.nextLevelBtn.Visible = false;
-            selectedSourceView.FrameLayoutView(fL3, false);
+            //selectedSourceView.FrameLayoutView(fL3, false);
 
-            View.MusicSourceView localMusicSourceView = new View.MusicSourceView();
-            localMusicSourceView.fLayout.Y = selectedSourceView.fLayout.Bottom;
-            localMusicSourceView.iconBtn.UnSelectedImagePath = "MusicIcon/localMusic.png";
-            localMusicSourceView.textBtn.TextID = StringId.localMusic;
-            localMusicSourceView.FrameLayoutView(fL3);
+            View.MusicSourceView musicSourceView = new View.MusicSourceView();
+            musicSourceView.fLayout.Y = selectedSourceView.fLayout.Bottom;
+            musicSourceView.iconBtn.UnSelectedImagePath = "MusicIcon/localMusic.png";
+            musicSourceView.textBtn.TextID = StringId.localMusic;
+            //musicSourceView.FrameLayoutView(fL3);
 
-            View.MusicSourceView usbSourceView = new View.MusicSourceView();
-            usbSourceView.fLayout.Y = localMusicSourceView.fLayout.Bottom;
-            usbSourceView.iconBtn.UnSelectedImagePath = "MusicIcon/usb.png";
-            usbSourceView.textBtn.TextID = StringId.usb;
-            usbSourceView.FrameLayoutView(fL3);
-
-            View.MusicSourceView radioSourceView = new View.MusicSourceView();
-            radioSourceView.fLayout.Y = usbSourceView.fLayout.Bottom;
-            radioSourceView.iconBtn.UnSelectedImagePath = "MusicIcon/radio.png";
-            radioSourceView.textBtn.TextID = StringId.radio;
-            //radioSourceView.FrameLayoutView(fL3);鏆傛椂闅愯棌鍦ㄧ嚎鐢靛彴
-
-            View.MusicSourceView qqMusicSourceView = new View.MusicSourceView();
-            qqMusicSourceView.fLayout.Y = usbSourceView.fLayout.Bottom;
-            qqMusicSourceView.iconBtn.UnSelectedImagePath = "MusicIcon/qqMusic.png";
-            qqMusicSourceView.textBtn.TextID = StringId.qqMusic;
-            qqMusicSourceView.FrameLayoutView(fL3);
+       
 
             View.MusicSourceView bluetoothSourceView = new View.MusicSourceView();
-            bluetoothSourceView.fLayout.Y = qqMusicSourceView.fLayout.Bottom;
+            bluetoothSourceView.fLayout.Y = musicSourceView.fLayout.Bottom;
             bluetoothSourceView.iconBtn.UnSelectedImagePath = "MusicIcon/bluetooth.png";
             bluetoothSourceView.textBtn.TextID = StringId.bluetooth;
-            bluetoothSourceView.FrameLayoutView(fL3);
+            //bluetoothSourceView.FrameLayoutView(fL3);
 
             View.MusicSourceView lineSourceView = new View.MusicSourceView();
             lineSourceView.fLayout.Y = bluetoothSourceView.fLayout.Bottom;
             lineSourceView.iconBtn.UnSelectedImagePath = "MusicIcon/line.png";
             lineSourceView.textBtn.TextID = StringId.line;
-            lineSourceView.FrameLayoutView(fL3);
+            //lineSourceView.FrameLayoutView(fL3);
 
 
             #endregion
@@ -164,34 +142,69 @@
             #endregion
 
             #region  鎵�鏈夌偣鍑讳簨浠�
+            ///浜嬩欢
+            musicSourceView.clickBtn.MouseUpEventHandler += (sender, e) =>
+            {
+                A31MusicFileList a31MusicFileList = new A31MusicFileList();
+                MainPage.BasePageView.AddChidren(a31MusicFileList);
+                a31MusicFileList.Show();
+                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+                Loading loading = new Loading();
+                a31MusicFileList.AddChidren(loading);
+                loading.Start();
+                System.Threading.Tasks.Task.Run(() =>
+                {
+                    try
+                    {
+                        if (A31MusicModel.Current.palyLists.Count == 0)
+                        {
+                           SendMethod.mMethod.GetPalyList(A31MusicModel.Current.functionMusic);
+                           
+                        }
+                    }
+                    catch
+                    {
+                    }
+                    finally
+                    {
+                        Application.RunOnMainThread(() =>
+                        {
+                            loading.Hide();
+                            a31MusicFileList.FileView();
+                        });
+                    }
+                });
+            };
+
+
             ///鎾斁鍣ㄤ慨鏀瑰悕绉颁簨浠�
             playNameView.clickBtn.MouseUpEventHandler += (sender, e) =>
             {
-                new View.TipView().InputBox(StringId.modifyName, A31MusicModel.Current.Name, StringId.nameNull, (playerName) =>
+                new View.TipView().InputBox(StringId.modifyName, A31MusicModel.Current.functionMusic.name, StringId.nameNull, (playerName) =>
                 {
                     playNameView.inputTextBtn.Text = playerName;
-                    A31MusicModel.Current.Name = playerName;
-                    string url = "http://" + A31MusicModel.Current.IPAddress + "/httpapi.asp?command=setDeviceName:" + A31MusicModel.Current.Name;
-                    SendMethod.SendCommand(url);
+                    A31MusicModel.Current.functionMusic.name = playerName;
+                    //鍙戦�佸懡浠�
+                    System.Threading.Tasks.Task.Run(() =>
+                    {
+                        try
+                        {
+                            SendMethod.mMethod.EditDeviceName(A31MusicModel.Current.functionMusic.deviceId,playerName);
+                        }
+                        catch { }
+
+                    });
+
                 });
 
             };
-            ///钃濈墮淇敼鍚嶇О浜嬩欢
-            bluetoothNameView.clickBtn.MouseUpEventHandler += (sender, e) =>
-            {
-                new View.TipView().InputBox(StringId.modifyName, A31MusicModel.Current.Name, StringId.nameNull, (bluetoothName) =>
-                {
-                    bluetoothNameView.inputTextBtn.Text = bluetoothName;
-                    SendMethod.ModifyBluetoothName("MCU+PAS+BT" + bluetoothName.Trim() + "*&");
-                });
-
-            };
+           
             ///鍖哄煙淇敼鐨勪簨浠�
             areaText.clickBtn.MouseUpEventHandler += (sender, e) =>
             {
-                ChooseRoomPage chooseRoomPage = new ChooseRoomPage(A31MusicModel.Current, () =>
+                ChooseRoomPage chooseRoomPage = new ChooseRoomPage(A31MusicModel.Current.functionMusic, () =>
                 {
-                    areaText.inputTextBtn.Text = A31MusicModel.Current.GetRoomListName();
+                    areaText.inputTextBtn.Text = A31MusicModel.Current.functionMusic.GetRoomListName();
                     A31MusicModel.Save();
                 });
                 MainPage.BasePageView.AddChidren(chooseRoomPage);
@@ -223,117 +236,19 @@
                 a31MyList.UpdateSelectedFile();
                 MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
             };
-            ///鏈湴闊充箰浜嬩欢
-            localMusicSourceView.clickBtn.MouseUpEventHandler += (sender, e) =>
-            {
-                A31LocalMusicList a31LocalMusicList = new A31LocalMusicList();
-                MainPage.BasePageView.AddChidren(a31LocalMusicList);
-                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
-                a31LocalMusicList.Show();
-                a31LocalMusicList.UpdateSelectedMusic();
-            };
-            ///USB浜嬩欢
-            usbSourceView.clickBtn.MouseUpEventHandler += (sender, e) =>
-            {
-                A31USBMusicList usbMusic = new A31USBMusicList();
-                MainPage.BasePageView.AddChidren(usbMusic);
-                usbMusic.UIView();
-                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
-                Loading loading = new Loading();
-                usbMusic.AddChidren(loading);
-                loading.Start();
-                System.Threading.Tasks.Task.Run(() =>
-                {
-                    try
-                    {
-                        if (A31MusicModel.Current.USBList.Count == 0)
-                        {
-                            //杩涙潵璇讳竴娆�(娉ㄦ剰:鎾斁鍦板潃鍙兘浼氭敼鍙橈紝瀵艰嚧鎾斁涓嶄簡闊充箰;瑙e喅:杩涙潵閮藉幓鍘昏鍙栨渶鏂版暟鎹�)
-                            var list = SendMethod.GetUsbList(A31MusicModel.Current);
-                            A31MusicModel.Current.USBList.AddRange(list);
-                        }
-                    }
-                    catch
-                    {
-                    }
-                    finally
-                    {
-                        Application.RunOnMainThread(() =>
-                        {
-                            loading.Hide();
-                            usbMusic.Show();
-                            usbMusic.UpdateSelectedMusic();
-                        });
-                    }
-                });
-            };
-            ///鍦ㄧ嚎鐢靛彴浜嬩欢
-            radioSourceView.clickBtn.MouseUpEventHandler += (sender, e) =>
-            {
-                Loading loading = new Loading();
-                this.AddChidren(loading);
-                loading.Start();
-                System.Threading.Tasks.Task.Run(() =>
-                {
-                    var radioList = SendMethod.ReadRadioList("http://opml.radiotime.com/Browse.ashx?partnerId=yvcOjvJP");
-                    Application.RunOnMainThread(() =>
-                    {
-                        loading.Hide();
-                        A31Radio a31Radio = new A31Radio();
-                        MainPage.BasePageView.AddChidren(a31Radio);
-                        MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
-                        a31Radio.Show(radioList);
-                    });
-                });
-            };
-
-            ///QQ闊充箰浜嬩欢
-            qqMusicSourceView.clickBtn.MouseUpEventHandler += (sender, e) =>
-            {
-                //string str = "com.tencent.qqmusic";
-                //if (Application.DeviceType == Device.Ios)
-                //{
-                //    str = "qqmusic:";
-                //}
-                //CommonClass.OpenApp(str);
-
-                bool bol = false;
-                string url = "";
-                try
-                {
-#if __IOS__
-                    bol = HDLUtils.OpenApp("qqmusic://");
-                    url = "https://apps.apple.com/cn/app/qq%E9%9F%B3%E4%B9%90-%E8%AE%A9%E7%94%9F%E6%B4%BB%E5%85%85%E6%BB%A1%E9%9F%B3%E4%B9%90/id414603431";
-
-#else
-                    bol = HDLUtils.OpenAppWithPackageName("com.tencent.qqmusic");
-                    //url = "http://music.qq.com/";
-                    url = "market://details?id=com.tencent.qqmusic";
-#endif
-                    if (!bol)
-                    {
-                        new View.TipView().TipBox1(StringId.tip, StringId.qqMsuicTip, () =>
-                        {
-                            HDLUtils.OpenUrl(url);
-                        });
-                    }
-                }
-                catch { }
-            };
+          
+     
+          
 
             ///钃濈墮浜嬩欢
             bluetoothSourceView.clickBtn.MouseUpEventHandler += (sender, e) =>
             {
                 this.RemoveFromParent();
-                string url = "http://" + A31MusicModel.Current.IPAddress + "/httpapi.asp?command=setPlayerCmd:switchmode:bluetooth";
-                SendMethod.SendCommand(url);
             };
             ///绾胯矾杈撳叆浜嬩欢
             lineSourceView.clickBtn.MouseUpEventHandler += (sender, e) =>
             {
                 this.RemoveFromParent();
-                string url = "http://" + A31MusicModel.Current.IPAddress + "/httpapi.asp?command=setPlayerCmd:switchmode:line-in";
-                SendMethod.SendCommand(url);
             };
 
 

--
Gitblit v1.8.0