wxr
2024-10-14 b847c06d8617efb2cbbad6f11b0344b779138e92
HDL_ON/UI/UI2/FuntionControlView/Music/MusicMain.cs
@@ -283,40 +283,54 @@
            //更新状态线程
            var musicThread = new System.Threading.Thread(() =>
            {
                while (true)
                try
                {
                    if (!player.functionMusic.isOnline())
                    while (true)
                    {
                        ///不在线不读状态
                        continue;
                    }
                    //SendMethod.ReadStatus(player);
                    SendMethod.Current.GetDeviceStatus(ref player, new List<string> { player.functionMusic.deviceId }, player.functionMusic.sid);
                    System.Threading.Thread.Sleep(1000);
                    Application.RunOnMainThread(() =>
                    {
                        musicView.singerBtn.Text = player.functionMusic.GetAttrState(KeyProperty.song_name);
                        musicView.songNameBtn.Text = player.functionMusic.GetAttrState(KeyProperty.song_name);
                        musicView.musicNameBtn.Text = player.functionMusic.name;
                        if (player.functionMusic.GetAttrState(KeyProperty.on_off) == ValueProperty.on)
                        if (!player.functionMusic.isOnline())
                        {
                            musicView.playBtn.IsSelected = true;
                            ///不在线不读状态
                            continue;
                        }
                        else
                        //SendMethod.ReadStatus(player);
                        SendMethod.Current.GetDeviceStatus(ref player, new List<string> { player.functionMusic.deviceId }, player.functionMusic.sid);
                        System.Threading.Thread.Sleep(1000);
                        Application.RunOnMainThread(() =>
                        {
                            musicView.playBtn.IsSelected = false;
                        }
                        musicView.regionBtn.Text = player.functionMusic.GetRoomListName();
                            try
                            {
                                musicView.singerBtn.Text = player.functionMusic.GetAttrState(KeyProperty.song_name);
                                musicView.songNameBtn.Text = player.functionMusic.GetAttrState(KeyProperty.song_name);
                                musicView.musicNameBtn.Text = player.functionMusic.name;
                                if (player.functionMusic.GetAttrState(KeyProperty.on_off) == ValueProperty.on)
                                {
                                    musicView.playBtn.IsSelected = true;
                                }
                                else
                                {
                                    musicView.playBtn.IsSelected = false;
                                }
                                musicView.regionBtn.Text = player.functionMusic.GetRoomListName();
                        if (player.functionMusic.collect)
                        {
                            musicView.collectIconBtn.IsSelected = true;
                        }
                        else
                        {
                            musicView.collectIconBtn.IsSelected = false;
                        }
                    });
                                if (player.functionMusic.collect)
                                {
                                    musicView.collectIconBtn.IsSelected = true;
                                }
                                else
                                {
                                    musicView.collectIconBtn.IsSelected = false;
                                }
                            }
                            catch (Exception e)
                            {
                                string ee = e.Message;
                            }
                        });
                    }
                }
                catch (Exception e)
                {
                    string ee = e.Message;
                }
            })
            { IsBackground = true, Name = "A31" };