| | |
| | | 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刷新图标父控件 |
| | |
| | | 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, |
| | |
| | | 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) |
| | |
| | | }); |
| | | |
| | | }; |
| | | |
| | | ///音量图标点击事件 |
| | | playView.volIconBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | if (A31MusicModel.Current.ServerClientType == 1 && A31MusicModel.Current.Slave.slave_list.Count != 0) |
| | | { ///主播放器 |
| | | new View.DialogView { }.PlayerVolumeView(A31MusicModel.Current); |
| | | } |
| | | }; |
| | | ///音量进度条点击事件 |
| | | 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; |
| | |
| | | playView.prevBtn.MouseDownEventHandler += (sender, e) => |
| | | { |
| | | playView.prevBtn.IsSelected = true; |
| | | SendMethod.Previous(); |
| | | SendMethod.Previous(A31MusicModel.Current); |
| | | }; |
| | | playView.prevBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | playView.prevBtn.IsSelected = false; |
| | | }; |
| | | }; |
| | | ///暂停/播放点击事件 |
| | | playView.playBtn.MouseDownEventHandler += (sender, e) => |
| | | { |
| | | 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"; |
| | | } |
| | | }; |
| | |
| | | playView.nextBtn.MouseDownEventHandler += (sender, e) => |
| | | { |
| | | playView.nextBtn.IsSelected = true; |
| | | SendMethod.Next(); |
| | | SendMethod.Next(A31MusicModel.Current); |
| | | }; |
| | | playView.nextBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | |
| | | 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> |
| | | /// 定时更新状态 |
| | |
| | | //更新播放器音量给系统音量 |
| | | Volume.MusicVolume = playView.volSeekBar.Progress; |
| | | //当前播放音乐时间 |
| | | int playSecond = int.Parse(A31MusicModel.Current.A31PlayStatus.curpos) / 1000;// + (int)(DateTime.Now - A31MusicModel.Current.LastDateTime).TotalSeconds; |
| | | //currentMusiceA31.musicPalyTime = (playSecond*10).ToString(); |
| | | //分钟 |
| | | int playSecond = int.Parse(A31MusicModel.Current.A31PlayStatus.curpos) / 1000+(int)(DateTime.Now - A31MusicModel.Current.LastDateTime).TotalSeconds; |
| | | |
| | | int playMusicMinute = playSecond / 60; |
| | | //秒钟 |
| | | int playMusicSecond = playSecond % 60; |
| | |
| | | } |
| | | 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) |
| | | { |
| | |
| | | }) |
| | | { 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 |
| | |
| | | A31MusicModel.Current.A31PlayStatus.Title = songBtn.Text; |
| | | System.Threading.Tasks.Task.Run(() => |
| | | { |
| | | SendMethod.ListMusicPlay(playListName, clickBtn.Tag); |
| | | SendMethod.ListMusicPlay(playListName, clickBtn.Tag, A31MusicModel.Current); |
| | | }); |
| | | }); |
| | | }); |
| | |
| | | |
| | | }); |
| | | } |
| | | }); |
| | | }) |
| | | { IsBackground = true }; |
| | | updateSelectedMusicThread.Start(); |
| | | } |
| | | } |