| | |
| | | |
| | | public void Show() |
| | | { |
| | | |
| | | #region 界面布局 |
| | | this.BackgroundColor = MusicColor.ViewColor; |
| | | var topView = new TopView(); |
| | |
| | | { |
| | | |
| | | var a31player = A31MusicModel.A31MusicModelList[i]; |
| | | //if (a31player.functionMusic.online == false) |
| | | //if (a31player.functionMusic.isOnline() == false) |
| | | //{ |
| | | // //不在线不显示 |
| | | // continue; |
| | |
| | | { |
| | | |
| | | var a31player = A31MusicModel.A31MusicModelList[i]; |
| | | if (a31player.functionMusic.online == false) |
| | | if (a31player.functionMusic.isOnline() == false) |
| | | { |
| | | //不在线不读取 |
| | | continue; |
| | |
| | | musicView.singerBtn.Text = player.functionMusic.GetAttrState(KeyProperty.song_name); |
| | | musicView.songNameBtn.Text = player.functionMusic.GetAttrState(KeyProperty.song_name); |
| | | musicView.musicNameBtn.Text = player.functionMusic.name; |
| | | musicView.collectIconBtn.Visible = false;//先暂时隐藏收藏功能 |
| | | //musicView.collectIconBtn.Visible = false;//先暂时隐藏收藏功能 |
| | | ///收藏事件 |
| | | musicView.collectIconBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | |
| | | { |
| | | player.functionMusic.collect = false; |
| | | } |
| | | player.functionMusic.CollectFunction(); |
| | | }; |
| | | |
| | | |
| | |
| | | //更新状态线程 |
| | | var musicThread = new System.Threading.Thread(() => |
| | | { |
| | | while (true) |
| | | try |
| | | { |
| | | if (!player.functionMusic.online) |
| | | while (true) |
| | | { |
| | | ///不在线不读状态 |
| | | continue; |
| | | if (!player.functionMusic.isOnline()) |
| | | { |
| | | ///不在线不读状态 |
| | | 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(() => |
| | | { |
| | | 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; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | string ee = e.Message; |
| | | } |
| | | }); |
| | | } |
| | | //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) |
| | | { |
| | | |
| | | 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; |
| | | } |
| | | }); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | string ee = e.Message; |
| | | } |
| | | }) |
| | | { IsBackground = true, Name = "A31" }; |
| | |
| | | catch { } |
| | | }); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | } |