2022年10月13日13:55:00
音乐添加音量属性
| | |
| | | /// 公共域名就近解析 |
| | | /// </summary> |
| | | |
| | | //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; |
| | | public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm |
| | | public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; |
| | | //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm |
| | | /// <summary> |
| | | /// RegionMark |
| | | /// </summary> |
| | |
| | | case SPK.MusicStandard: |
| | | case SPK.AvMusic: |
| | | { |
| | | foreach (var dic in dicList) |
| | | string song_name = GetKeyValue("song_name", dicList); |
| | | string volume = GetKeyValue("volume", dicList); |
| | | stateStr = song_name + ";" +Language.StringByID(StringId.volumeMusic)+volume; |
| | | if (stateStr.StartsWith(";")) |
| | | { |
| | | if (dic["key"] == "song_name") |
| | | { |
| | | stateStr = dic["value"]?.ToString(); |
| | | } |
| | | stateStr = stateStr.Substring(1, stateStr.Length - 1); |
| | | }else if (stateStr.EndsWith(Language.StringByID(StringId.volumeMusic))) |
| | | { |
| | | stateStr = stateStr.Substring(0, stateStr.Length - 3); |
| | | } |
| | | } |
| | | break; |
| | |
| | | { |
| | | button1.Text = dic["value"]?.ToString(); |
| | | } |
| | | else if (dic["key"] == "volume") |
| | | { |
| | | button2.Text = dic["value"]?.ToString(); |
| | | } |
| | | } |
| | | } |
| | | break; |
| | |
| | | /// <summary> |
| | | /// 大框圆角值 |
| | | /// </summary> |
| | | public int RradiusFrameLayout = 15; |
| | | private int RradiusFrameLayout = 15; |
| | | /// <summary> |
| | | /// 小框圆角值 |
| | | /// </summary> |
| | | public int radiusEditFrameLayout = 4; |
| | | private int radiusEditFrameLayout = 4; |
| | | /// <summary> |
| | | /// 输入框 |
| | | /// </summary> |
| | |
| | | /// <param name="titleId">标题文本</param> |
| | | /// <param name="tnputEditTxet">显示文本</param> |
| | | /// <param name="confirmAction">回调函数</param> |
| | | public void InputBox(int titleId, string tnputEditTxet, Action<string> confirmAction) |
| | | /// <param name="minValue">最小值</param> |
| | | /// <param name="maxValue">最大值</param> |
| | | public void InputBox(int titleId, string tnputEditTxet, Action<string> confirmAction,int minValue=1,int maxValue=100) |
| | | { |
| | | Dialog dialog = new Dialog() |
| | | { |
| | |
| | | } |
| | | else |
| | | { |
| | | var editTextValue = editText.Text.Trim(); |
| | | int intValue = int.Parse(editTextValue); |
| | | if (intValue <= 0 || intValue > 100) |
| | | int intValue = int.Parse(editText.Text.Trim()); |
| | | if (intValue <minValue || intValue > maxValue) |
| | | { |
| | | errorId_IsNullOrEmpty = Language.StringByID(StringId.setvalue); |
| | | errorId_IsNullOrEmpty = Language.StringByID(StringId.setvalue).Replace("1",minValue.ToString()).Replace("000",maxValue.ToString()); |
| | | } |
| | | } |
| | | if (errorId_IsNullOrEmpty!="") |
| | |
| | | btnTip.IsMoreLines = true; |
| | | return; |
| | | } |
| | | |
| | | confirmAction(editText.Text.Trim()); |
| | | string editTextValue= int.Parse(editText.Text.Trim()).ToString(); |
| | | confirmAction(editTextValue); |
| | | dialog.Close(); |
| | | }; |
| | | |
| | |
| | | LogicView.FunTypeView funTypeView = new LogicView.FunTypeView(); |
| | | funTypeView.btnText.TextID = StringId.tishiyin; |
| | | fLayout.AddChidren(funTypeView.FLayoutView()); |
| | | ///音量 |
| | | LogicView.FunTypeView volView = new LogicView.FunTypeView(); |
| | | volView.frameLayout.Y = funTypeView.frameLayout.Bottom; |
| | | volView.btnText.TextID = StringId.volumeMusic; |
| | | fLayout.AddChidren(volView.FLayoutView()); |
| | | |
| | | ///设备延时iewv |
| | | DelayView(fLayout, funTypeView.frameLayout.Bottom); |
| | | DelayView(fLayout, volView.frameLayout.Bottom); |
| | | #endregion |
| | | #region 点击事件 |
| | | ///提示语音点击事件 |
| | |
| | | |
| | | }); |
| | | }; |
| | | ///音量点击事件 |
| | | volView.btnClick.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | selectedState = device.spk + "_volume"; |
| | | new LogicView.TipPopView { }.InputBox(StringId.volumeMusic, volView.btnState.Text, (value) => |
| | | { |
| | | |
| | | //界面显示选中值 |
| | | volView.btnState.Text =value; |
| | | //数据封装 |
| | | AddDictionary("volume", value);//音量 |
| | | },0,100); |
| | | }; |
| | | |
| | | if (edit) |
| | | { |
| | | //显示编辑之前的设备状态 |
| | | GetEditDeviceState(device, index, funTypeView.btnState, null, null, null); |
| | | GetEditDeviceState(device, index, funTypeView.btnState, volView.btnState, null, null); |
| | | } |
| | | |
| | | #endregion |
| | |
| | | if (!_bool) |
| | | { |
| | | //没有开关就默认添加-开-属性 |
| | | Dictionary<string, string> diction = new Dictionary<string, string>(); |
| | | diction.Add("key", "on_off"); |
| | | diction.Add("value", "on"); |
| | | Dictionary<string, string> diction = new Dictionary<string, string> |
| | | { |
| | | { "key", "on_off" }, |
| | | { "value", "on" } |
| | | }; |
| | | dicSateteList.Add(diction); |
| | | } |
| | | } |
| | | break; |
| | | //音乐 |
| | | case SPK.MusicStandard: |
| | | case SPK.AvMusic: |
| | | { |
| | | string volume = "volume"; |
| | | var dicObj = dicSateteList.Find((dic) => dic.ContainsValue(volume)); |
| | | if (dicObj != null) |
| | | { |
| | | //有配置音乐音量属性,要重新排列,音量在前面 |
| | | var dicList = new List<Dictionary<string, string>>(); |
| | | dicList.Add(dicObj);//先添加音量属性 |
| | | var diclist = dicSateteList.FindAll((dic) => !dic.ContainsValue(volume)); |
| | | dicList.AddRange(diclist);//再添加其它属性 |
| | | dicSateteList = dicList;//重新赋值 |
| | | } |
| | | } |
| | | break; |
| | | |
| | | } |
| | | outputDevice.status = dicSateteList; |