| | |
| | | |
| | | public SceneFunctionInfoEditPage(Scene s, SceneFunction fc, Action action) |
| | | { |
| | | |
| | | |
| | | bodyView = this; |
| | | scene = s; |
| | | sceneFunction = fc.localFunction.ConvertSceneFunction(); |
| | | sceneFunction = fc.localFunction.ConvertSceneFunction(); |
| | | foreach (var ll in sceneFunction.status) |
| | | { |
| | | try |
| | |
| | | break; |
| | | case FunctionAttributeKey.Signal: |
| | | LoadFunctionRow(sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Signal)); |
| | | break; |
| | | case FunctionAttributeKey.SongName: |
| | | LoadFunctionRow(sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.SongName)); |
| | | break; |
| | | case FunctionAttributeKey.Volume: |
| | | LoadFunctionRow(sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Volume)); |
| | | break; |
| | | } |
| | | } |
| | |
| | | sceneStatus.value = p.GetValue(dic, valueStr); |
| | | }); |
| | | break; |
| | | case FunctionAttributeKey.Volume: |
| | | BrightnessView(btnFunctionText.Text, btnFunctionName.Text, (volume, uintStr) => |
| | | { |
| | | btnFunctionText.Text = volume; |
| | | sceneStatus.value = volume; |
| | | }); |
| | | break; |
| | | case FunctionAttributeKey.SongName: |
| | | MusicListView(btnFunctionText.Text, (playListName, song) => |
| | | { |
| | | btnFunctionText.Text = song.name; |
| | | sceneStatus.value = song.name; |
| | | //追加属性 |
| | | var oldList = new List<SceneFunctionStatus>(); |
| | | for (int i = 0; i < sceneFunction.status.Count; i++) |
| | | { |
| | | var status = sceneFunction.status[i]; |
| | | if (status.key == FunctionAttributeKey.PlaylistName) |
| | | { |
| | | //控制需要(界面不需要显示) |
| | | sceneFunction.status.RemoveAt(i); |
| | | sceneFunction.status.Insert(i, new SceneFunctionStatus { key = FunctionAttributeKey.PlaylistName, value = playListName }); |
| | | } |
| | | else if (status.key == FunctionAttributeKey.Url) |
| | | { |
| | | //存在url就一起发过去 |
| | | if (!string.IsNullOrEmpty(song.url)) |
| | | { |
| | | //控制需要(界面不需要显示) |
| | | sceneFunction.status.RemoveAt(i); |
| | | sceneFunction.status.Insert(i, new SceneFunctionStatus { key = FunctionAttributeKey.Url, value = song.url }); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | }); |
| | | break; |
| | | |
| | | } |
| | | }; |
| | | |
| | |
| | | pif.SingleSelectionShow(this, list, titleName, oldStateValue, action); |
| | | } |
| | | |
| | | #endregion |
| | | /// <summary> |
| | | /// 音乐列表界面 |
| | | /// </summary> |
| | | /// <param name="oldStateValue">旧状态值</param> |
| | | /// <param name="action">回调</param> |
| | | void MusicListView(string oldStateValue, Action<string, Music.SongInfo> action) |
| | | { |
| | | Loading loading = new Loading(); |
| | | this.AddChidren(loading); |
| | | loading.Start(); |
| | | System.Threading.Tasks.Task.Run(() => |
| | | { |
| | | try |
| | | { |
| | | var palyList = Music.SendMethod.Current.GetSingleSongList(new Function { sid = sceneFunction.sid }, "hdl_special", ""); |
| | | List<string> songNameList = new List<string>(); |
| | | for (int i = 0; i < palyList.songs.Count; i++) |
| | | { |
| | | var song = palyList.songs[i]; |
| | | songNameList.Add(song.name); |
| | | } |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | loading.Hide(); |
| | | var publicInterface = new UI2.Intelligence.Automation.PublicInterface(); |
| | | publicInterface.FrameOrVv(this, songNameList, new List<string> { oldStateValue }, palyList.group, (index) => |
| | | { |
| | | if (index > palyList.songs.Count) |
| | | { |
| | | index = 0; |
| | | } |
| | | var song = palyList.songs[index]; |
| | | action?.Invoke(palyList.group, song); |
| | | |
| | | //界面显示选中值 |
| | | //funTypeView.btnState.Text = songSelecetd.name; |
| | | ////数据封装 |
| | | //AddDictionary("playlist_name", palyList.group);//列表名 |
| | | //AddDictionary("song_name", songSelecetd.name);//歌曲名 |
| | | //if (!string.IsNullOrEmpty(songSelecetd.url)) |
| | | //{ |
| | | // //存在url就一起发送过去 |
| | | // AddDictionary("url", songSelecetd.url); |
| | | //} |
| | | |
| | | }, false); |
| | | |
| | | }); |
| | | } |
| | | catch { } |
| | | |
| | | }); |
| | | } |
| | | #endregion |
| | | } |
| | | } |
| | | |