private void LoadLocalConfiger() { GlobalData.Instance.LocalSetting = _localDataManager.GetSettingConfig() ?? new LocalSetting(); GlobalData.Instance.ConfigManager = new ConfigManager() { AudioInfo = new AudioInfo(), LocalLiveStreamInfo = new LiveStreamInfo(), NetInfo = new NetInfo(), RecordInfo = new RecordInfo(), RemoteLiveStreamInfo = new LiveStreamInfo(), ServerInfo = new ServerInfo(), MainVideoInfo = new VideoInfo(), DocVideoInfo = new VideoInfo() }; var localDataConfig = _localDataManager.GetSettingConfigData(); if (localDataConfig != null) { if (localDataConfig.ServerInfo == null || localDataConfig.ServerInfo.BmsServerPort == 0) { localDataConfig.ServerInfo = new ServerInfo() { ServerIp = GlobalData.Instance.LocalSetting.ServerIp, BmsServerPort = GlobalData.Instance.LocalSetting.BmsServerPort }; _localDataManager.SaveSettingConfigData(localDataConfig); } GlobalData.Instance.ConfigManager = localDataConfig; } else { localDataConfig = GlobalData.Instance.ConfigManager; localDataConfig.ServerInfo = new ServerInfo() { ServerIp = GlobalData.Instance.LocalSetting.ServerIp, BmsServerPort = GlobalData.Instance.LocalSetting.BmsServerPort }; _localDataManager.SaveSettingConfigData(localDataConfig); GlobalData.Instance.ConfigManager = _localDataManager.GetSettingConfigData(); } }
private void SaveSetting() { try { var newIp = $"{ServerIp1}.{ServerIp2}.{ServerIp3}.{ServerIp4}"; IPAddress ip; if (!IPAddress.TryParse(newIp, out ip) || ServerPort < 0 || ServerPort > 65535) { //不合法 } else { if (_configManager == null) { _configManager = new ConfigManager { ServerInfo = new ServerInfo() }; } _configManager.ServerInfo.BmsServerPort = ServerPort; _configManager.ServerInfo.ServerIp = newIp; _localDataManager.SaveSettingConfigData(_configManager); //新IP地址与配置中保存的不一致们需要重启 } } catch (Exception ex) { Log.Logger.Error($"基础设置SaveSetting() exception:{ex}"); MessageQueueManager.Instance.AddError(MessageManager.SaveError); } }
private void SaveSetting() { try { var ip = $"{Ip1}.{Ip2}.{Ip3}.{Ip4}"; var mask = $"{Mask1}.{Mask2}.{Mask3}.{Mask4}"; var gateWay = $"{GateWay1}.{GateWay2}.{GateWay3}.{GateWay4}"; var dns = $"{Dns1}.{Dns2}.{Dns3}.{Dns4}"; _configManager.NetInfo.IpAddress = ip; _configManager.NetInfo.GatWay = gateWay; _configManager.NetInfo.AdapterName = SelectNetWorkCard; _configManager.NetInfo.Dns = dns; _configManager.NetInfo.Mark = mask; _configManager.NetInfo.IsAutoSet = AutoGet; _localDataManager.SaveSettingConfigData(_configManager); } catch (Exception ex) { Log.Logger.Error($"网络设置保存 exception:{ex}"); MessageQueueManager.Instance.AddError(MessageManager.SaveError); } }
private void SaveSetting() { _deviceConfigLoader.SaveConfig(_deviceNameAccessor); //if (_meetingService == null) //{ // _configManager.AudioInfo = new AudioInfo(); //} //if (_meetingService == null) return; //_meetingService.SetDefaultDevice(AudioSourceType, SelectedAudioSource); //_meetingService.SetDefaultDevice(DocSourceType, SelectedDocAudioSource); //_meetingService.SetDefaultDevice(AudioOutPutDeviceType, SelectedAudioOutPutDevice); //_meetingService.SetAudioSampleRate(SelectedSampleRate); //_meetingService.SetAudioBitRate(SelectedAac); //保存设置到本地配置文件 _configManager.AudioInfo.AAC = SelectedAac; _configManager.AudioInfo.AudioOutPutDevice = SelectedAudioOutPutDevice; _configManager.AudioInfo.AudioSammpleDevice = SelectedAudioSource; _configManager.AudioInfo.SampleRate = SelectedSampleRate; _configManager.AudioInfo.DocAudioSammpleDevice = SelectedDocAudioSource; _localDataManager.SaveSettingConfigData(_configManager); }
private void SaveSetting() { try { if (_configManager == null) { _configManager = new ConfigManager { LocalLiveStreamInfo = new LiveStreamInfo(), RemoteLiveStreamInfo = new LiveStreamInfo(), RecordInfo = new RecordInfo() }; } _configManager.LocalLiveStreamInfo.LiveStreamBitRate = SelectedLiveRate; _configManager.LocalLiveStreamInfo.LiveStreamDisplayHeight = int.Parse(SelectedLiveDisplay.Split('*')[1]); _configManager.LocalLiveStreamInfo.LiveStreamDisplayWidth = int.Parse(SelectedLiveDisplay.Split('*')[0]); _configManager.RemoteLiveStreamInfo.LiveStreamBitRate = SelectedRemoteRate; _configManager.RemoteLiveStreamInfo.LiveStreamDisplayHeight = int.Parse(SelectedRemoteDisplay.Split('*')[1]); _configManager.RemoteLiveStreamInfo.LiveStreamDisplayWidth = int.Parse(SelectedRemoteDisplay.Split('*')[0]); _configManager.RecordInfo.RecordBitRate = SelectedLocalBitrate; _configManager.RecordInfo.RecordDirectory = SelectedLocalPath; _configManager.RecordInfo.RecordDisplayWidth = int.Parse(SelectedLocalResolution.Split('*')[0]); _configManager.RecordInfo.RecordDisplayHeight = int.Parse(SelectedLocalResolution.Split('*')[1]); _localDataManager.SaveSettingConfigData(_configManager); } catch (Exception ex) { Log.Logger.Error($"直播设置SaveSetting() exception:{ex}"); MessageQueueManager.Instance.AddError(MessageManager.SaveError); } }
private void SaveSetting() { try { _deviceConfigLoader.SaveConfig(_deviceNameAccessor); var cameraDeviceName = SelectedCameraDevice; var docDeviceName = SelectedDocDevice; var videoVga = SelectedVedioVGA; var docVga = SelectedDocVGA; var videoRate = SelectedVedioRate; _configManager.MainVideoInfo = new VideoInfo(); _configManager.DocVideoInfo = new VideoInfo(); if (string.IsNullOrEmpty(SelectedCameraDevice) && string.IsNullOrEmpty(SelectedDocDevice)) { throw new Exception("未选择任何视频采集源!"); } if (!string.IsNullOrEmpty(SelectedCameraDevice)) { if (!string.IsNullOrEmpty(videoVga)) { var videoVgaWith = int.Parse(videoVga.Split('*')[0]); var videoVgaHeight = int.Parse(videoVga.Split('*')[1]); _configManager.MainVideoInfo.DisplayWidth = videoVgaWith; _configManager.MainVideoInfo.DisplayHeight = videoVgaHeight; } //视频设置 //var result1 = _meetingService.SetDefaultDevice(CameraDeviceType, cameraDeviceName); //if (result1.HasError) // throw new Exception(MessageManager.SaveError); //var result2 = _meetingService.SetVideoBitRate(CameraDeviceType, videoRate); //if (result2.HasError) // throw new Exception(MessageManager.SaveError); //var result3 = _meetingService.SetVideoResolution(CameraDeviceType, videoVgaWith, videoVgaHeight); //if (result3.HasError) // throw new Exception(MessageManager.SaveError); _configManager.MainVideoInfo.VideoDevice = cameraDeviceName; _configManager.MainVideoInfo.VideoBitRate = videoRate; _configManager.MainVideoInfo.ColorSpace = SelectedCameraColorSpace.Colorsapce; } if (!string.IsNullOrEmpty(SelectedDocDevice)) { if (!string.IsNullOrEmpty(docVga)) { var docVgaWith = int.Parse(docVga.Split('*')[0]); var docVgaHeight = int.Parse(docVga.Split('*')[1]); _configManager.DocVideoInfo.DisplayHeight = docVgaHeight; _configManager.DocVideoInfo.DisplayWidth = docVgaWith; } var docRate = SelectedDocRate; //课件设置 //var result4 = _meetingService.SetDefaultDevice(DocDeviceType, docDeviceName); //if (result4.HasError) // throw new Exception(MessageManager.SaveError); //var result5 = _meetingService.SetVideoBitRate(DocDeviceType, docRate); //if (result5.HasError) // throw new Exception(MessageManager.SaveError); //var result6 = _meetingService.SetVideoResolution(DocDeviceType, docVgaWith, docVgaHeight); //if (result6.HasError) // throw new Exception(MessageManager.SaveError); _configManager.DocVideoInfo.VideoBitRate = docRate; _configManager.DocVideoInfo.VideoDevice = docDeviceName; _configManager.DocVideoInfo.ColorSpace = SelectedDocColorSpace.Colorsapce; } if (!string.IsNullOrEmpty(SelectedDocDevice) || !string.IsNullOrEmpty(SelectedCameraDevice)) { _localDataManager.SaveSettingConfigData(_configManager); } } catch (Exception ex) { Log.Logger.Error($"视频设置SaveSetting() exception:{ex}"); MessageQueueManager.Instance.AddError(ex.Message); } }