| | |
| | | ///加载播放音乐界面的控件方法 |
| | | playView.viewFrameLayout(middLayout); |
| | | #endregion |
| | | #region ---控件的点击事件--- |
| | | |
| | | #region ---界面点击事件--- |
| | | //收藏图标事件 |
| | | playView.collectIconBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | |
| | | playView.playOrderBtn.UnSelectedImagePath = "MusicIcon/single.png"; |
| | | msg += Language.StringByID(StringId.singleMode); |
| | | break; |
| | | |
| | | case ValueProperty.single_cycle: |
| | | modeValueString =ValueProperty.random; |
| | | playView.playOrderBtn.UnSelectedImagePath = "MusicIcon/random.png"; |
| | |
| | | ///下拉刷新 |
| | | myListView.verticalScrolViewLayout.BeginHeaderRefreshingAction += () => |
| | | { |
| | | System.Threading.Tasks.Task.Run(() => |
| | | { |
| | | try |
| | | { |
| | | A31MusicModel.Current.palyLists.Clear(); |
| | | if (A31MusicModel.Current.palyLists.Count == 0) |
| | | { |
| | | SendMethod.mMethod.GetPalyList(A31MusicModel.Current.functionMusic); |
| | | |
| | | } |
| | | } |
| | | catch |
| | | { |
| | | } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | myListView.verticalScrolViewLayout.EndHeaderRefreshing(); |
| | | myListView.verticalScrolViewLayout.RemoveAll(); |
| | | var listName = A31MusicModel.Current.functionMusic.GetAttrState(KeyProperty.playlist_name); |
| | | var musicList = A31MusicModel.Current.GetSongList(listName); |
| | | A31SongPlay.SongListView(myListView.verticalScrolViewLayout, musicList, listName, myListView.popFra); |
| | | }); |
| | | } |
| | | }); |
| | | //结束刷新 |
| | | myListView.verticalScrolViewLayout.EndHeaderRefreshing(); |
| | | |
| | | }; |
| | | ///移除界面 |
| | | EventHandler<MouseEventArgs> removeFromParentView = (sen, e1) => |
| | |
| | | { |
| | | playView.nextBtn.IsSelected = false; |
| | | }; |
| | | ///物理按键的点击事件 |
| | | Volume.VolumeChange = (volume) => |
| | | { |
| | | if (Application.DeviceType == Device.Ios && A31MusicModel.Current.functionMusic.GetAttrState(KeyProperty.source) == "bluetooth") |
| | | { |
| | | return; |
| | | } |
| | | playView.volSeekBar.Progress = volume; |
| | | |
| | | if (startVolume != volume) |
| | | { |
| | | startVolume = volume; |
| | | A31MusicModel.Current.functionMusic.SetAttrState(KeyProperty.volume, startVolume); |
| | | Dictionary<string, string> dic = new Dictionary<string, string>(); |
| | | dic.Add(KeyProperty.volume, startVolume.ToString()); |
| | | SendMethod.mMethod.SendControlCommand(A31MusicModel.Current.functionMusic, dic); |
| | | } |
| | | |
| | | }; |
| | | /////物理按键的点击事件 |
| | | //Volume.VolumeChange = (volume) => |
| | | //{ |
| | | // if (Application.DeviceType == Device.Ios && A31MusicModel.Current.functionMusic.GetAttrState(KeyProperty.source) == "bluetooth") |
| | | // { |
| | | // return; |
| | | // } |
| | | // playView.volSeekBar.Progress = volume; |
| | | // if (startVolume != volume) |
| | | // { |
| | | // startVolume = volume; |
| | | // A31MusicModel.Current.functionMusic.SetAttrState(KeyProperty.volume, startVolume); |
| | | // Dictionary<string, string> dic = new Dictionary<string, string>(); |
| | | // dic.Add(KeyProperty.volume, startVolume.ToString()); |
| | | // SendMethod.mMethod.SendControlCommand(A31MusicModel.Current.functionMusic, dic); |
| | | // } |
| | | //}; |
| | | #endregion |
| | | } |
| | | /// <summary> |
| | |
| | | { |
| | | //更新总时间 |
| | | //总共有多少秒 |
| | | int totalSecond = int.Parse(A31MusicModel.Current.functionMusic.GetAttrState(KeyProperty.song_time))/1000; |
| | | int totalSecond = int.Parse(A31MusicModel.Current.functionMusic.GetAttrState(KeyProperty.song_time)); |
| | | //分钟 |
| | | int totalMusicMinute = totalSecond / 60; |
| | | //秒钟 |
| | |
| | | |
| | | switch (A31MusicModel.Current.functionMusic.GetAttrState("source")) |
| | | { |
| | | |
| | | case "QPLAY"://QQ音乐 |
| | | playView.loveBtn.Alpha = 0.5f; |
| | | playView.loveBtn.Enable = false; |
| | | break; |
| | | case "AIRPLAY"://酷狗音乐 |
| | | playView.loveBtn.Alpha = 0.5f; |
| | | playView.loveBtn.Enable = false; |
| | | playView.diyArcSeekBar.IsClickable = false; |
| | | break; |
| | | //sdcard/audio_in/ftp/radio/bluetooth |
| | | case "SONGLIST-NETWORK"://本地音乐 |
| | | break; |
| | | case "SONGLIST-LOCAL"://USB |