陈嘉乐
2020-06-05 c26c06ef4a22d6fb9e59dc734abca92fa8a23c47
HDL_ON/UI/Music/MusicMain.cs
@@ -45,7 +45,7 @@
        /// <summary>
        ///  显示加载界面
        /// </summary>
        public static Loading Loading = new Loading();
        public static Loading loading = new Loading();
        VerticalRefreshLayout verticalRefresh;
        public void Show()
@@ -72,11 +72,10 @@
            verticalRefresh.BeginHeaderRefreshingAction += () =>
            {
                SeachMusic();
                verticalRefresh.EndHeaderRefreshing();
                SeachMusic(false);
            };
            this.AddChidren(Loading);
            this.AddChidren(loading);
            if (A31MusicModel.A31MusicModelList.Count == 0)
            {
@@ -107,7 +106,7 @@
                        if (obj == null)
                        {
                            ///这里要读取主从关系
                            //readServerOrClientMode();
                            readServerOrClientMode();
                            A31MusicModel.Save();
                            return;
                        }
@@ -137,7 +136,7 @@
            if (Yes)
            {
                //为了第一次进来log一下;
                Loading.Start();
                loading.Start();
            }
            SendMethod.Seach((obj) =>
            {
@@ -145,12 +144,17 @@
                {
                    readServerOrClientMode();
                    A31MusicModel.Save();
                    if (!Yes)
                    {
                        ///等待跑完在关闭
                        verticalRefresh.EndHeaderRefreshing();
                    }
                    Application.RunOnMainThread(() =>
                    {
                        if (Yes)
                        {
                            //为了第一次进来log一下;
                            Loading.Hide();
                            loading.Hide();
                        }
                        verticalRefresh.RemoveAll();
                        for (int i = 0; i < A31MusicModel.A31MusicModelList.Count; i++)
@@ -197,14 +201,20 @@
            musicView.View(verticalRefresh);
            musicView.singerBtn.Text = a31player.A31PlayStatus.Artist;
            musicView.songNameBtn.Text = a31player.A31PlayStatus.Title;
            musicView.musicNameBtn.Text = a31player.Name;
            musicView.musicNameBtn.Text = new View.DialogView { }.NamePlayer(a31player);
            musicView.regionBtn.TextID = StringId.region;
            EventHandler<MouseEventArgs> clickMergence = (sender, e) =>
            {
                new View.DialogView { }.PlayMergence();
                if (a31player.ServerClientType == 0)
                {
                    new View.DialogView { }.PlayMergence();
                }
                else if (a31player.ServerClientType == 1)
                {
                    new View.DialogView { }.DetachPlayMergence(a31player);
                }
            };
            musicView.mergeBjBtn.MouseUpEventHandler += clickMergence;
            musicView.mergeBtn.MouseUpEventHandler += clickMergence;
@@ -272,14 +282,7 @@
                    {
                        musicView.singerBtn.Text = a31player.A31PlayStatus.Artist;
                        musicView.songNameBtn.Text = a31player.A31PlayStatus.Title;
                        if (a31player.ServerClientType == 1)
                        {
                            musicView.musicNameBtn.Text = a31player.MainPlayName;
                        }
                        else
                        {
                            musicView.musicNameBtn.Text = a31player.Name;
                        }
                        musicView.musicNameBtn.Text = new View.DialogView { }.NamePlayer(a31player);
                        if (a31player.A31PlayStatus.status == "play")
                        {
                            musicView.playBtn.IsSelected = true;
@@ -312,11 +315,11 @@
                    {
                        a31player.ServerClientType = 0;
                        var result = SendMethod.OpenWeb("http://" + a31player.IPAddress + "/httpapi.asp?command=multiroom:getSlaveList");
                        if (result == null)
                        if (result == null && result == "Failed")
                        {
                            result = SendMethod.OpenWeb("http://" + a31player.IPAddress + "/httpapi.asp?command=multiroom:getSlaveList");
                        }
                        if (result != null)
                        if (result != null && result != "Failed")
                        {
                            a31player.Slave = Newtonsoft.Json.JsonConvert.DeserializeObject<Slaves>(result);
                        }
@@ -357,7 +360,7 @@
                                        UniqueDeviceName = slave.uuid.Replace("uuid:", ""),
                                        Name = slave.name,
                                        IsCanShow = false,
                                        IsOnLine = false,
                                        IsOnLine = false,//true作用为了读取从播放器的音量
                                    });
                                }
                                //如果找到就更新为从的
@@ -369,7 +372,7 @@
                                    tempA31Player.Name = slave.name;
                                    tempA31Player.UniqueDeviceName = slave.uuid.Replace("uuid:", "");
                                    tempA31Player.IsCanShow = false;
                                    tempA31Player.IsOnLine = false;
                                    tempA31Player.IsOnLine = false;//true作用为了读取从播放器的音量
                                }
                            }
@@ -383,10 +386,7 @@
                }
            }
            catch (Exception e)
            {
                var ss = e.Message;
            }
            catch { }
        }
    }