From c2348ebb81ca12b72eee6fbe9eee47925c1a5b07 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期三, 06 九月 2023 12:02:54 +0800
Subject: [PATCH] Merge branch 'wxr-2.1' into wxr-2.0
---
HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs | 117 +++++++++++++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 107 insertions(+), 10 deletions(-)
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs b/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs
index 681f9a9..62dc7d0 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs
@@ -29,10 +29,10 @@
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
@@ -79,13 +79,13 @@
if (sceneFunction.localFunction.spk == SPK.LightRGB || sceneFunction.localFunction.spk == SPK.GroupControl)
{
- //var colorfulStatus = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Colorful);
- //if (colorfulStatus != null)
- //{
- // isColorful = true;
- // LoadColorfulRow(colorfulStatus);
- // isColorful = colorfulStatus.value == "on";
- //}
+ var colorfulStatus = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Colorful);
+ if (colorfulStatus != null)
+ {
+ isColorful = true;
+ LoadColorfulRow(colorfulStatus);
+ isColorful = colorfulStatus.value == "on";
+ }
}
foreach (var attr in sceneFunction.status)
{
@@ -126,6 +126,12 @@
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;
}
}
@@ -537,6 +543,45 @@
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;
+
}
};
@@ -2396,8 +2441,60 @@
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
}
}
--
Gitblit v1.8.0