private void SaveSettings() { using (Settings xmlwriter = new MPSettings()) { xmlwriter.SetValue("movieplayer", "osdtimeout", _displayTimeout); xmlwriter.SetValue("movieplayer", "zapdelay", _zapDelay); xmlwriter.SetValue("movieplayer", "zaptimeout", _zapTimeout); } }
public override void SaveSettings() { using (Settings xmlwriter = new MPSettings()) { xmlwriter.SetValueAsBool("filemenu", "enabled", chbEnabled.Checked); xmlwriter.SetValue("filemenu", "pincode", Util.Utils.EncryptPassword(textPinCodeBox.Text)); xmlwriter.SetValue("filemenu", "trashcan", textTrashcanFolder.Text); } }
public override void SaveSettings() { using (Settings xmlwriter = new MPSettings()) { xmlwriter.SetValue("movieplayer", "osdtimeout", textBoxDisplayTimeout.Text); xmlwriter.SetValue("movieplayer", "zapdelay", textBoxZapDelay.Text); xmlwriter.SetValue("movieplayer", "zaptimeout", textBoxZapTimeout.Text); } }
private void SaveSettings() { using (Settings xmlwriter = new MPSettings()) { xmlwriter.SetValue("gui", "language", _btnLanguage.Label); xmlwriter.SetValue("skin", "name", _btnSkin.Label); xmlwriter.SetValueAsBool("gui", "myprefix", _btnLanguagePrefix.Selected); } Config.SkinName = _btnSkin.Label; }
private void SaveSettings() { using (Settings xmlwriter = new MPSettings()) { xmlwriter.SetValue("MPDomoticz", "ServerAdress", _serveradress); xmlwriter.SetValue("MPDomoticz", "ServerPort", _serverport); xmlwriter.SetValue("MPDomoticz", "Username", _username); xmlwriter.SetValue("MPDomoticz", "Password", _password); xmlwriter.SetValue("MPDomoticz", "RefreshInterval", RefreshInterval); } }
/// <summary> /// /// </summary> public override void SaveSettings() { using (Settings xmlwriter = new MPSettings()) { xmlwriter.SetValueAsBool("dvdplayer", "pixelratiocorrection", pixelRatioCheckBox.Checked); xmlwriter.SetValue("dvdplayer", "armode", aspectRatioComboBox.Text); xmlwriter.SetValue("dvdplayer", "displaymode", displayModeComboBox.Text); xmlwriter.SetValue("dvdplayer", "defaultar", defaultZoomModeComboBox.SelectedItem); } }
private void mpButtonOK_Click(object sender, EventArgs e) { this.DialogResult = DialogResult.OK; using (Settings xmlwriter = new MPSettings()) { xmlwriter.SetValue("WOL", "WolTimeout", mpUpDownWolTimeout.Value); xmlwriter.SetValue("WOL", "WolResendTime", mpUpDownWolResend.Value); xmlwriter.SetValue("WOL", "WaitTimeAfterWOL", mpUpDownWaitTime.Value); } this.Hide(); }
/// <summary> /// /// </summary> public override void SaveSettings() { using (Settings xmlwriter = new MPSettings()) { xmlwriter.SetValue("dvdplayer", "path", fileNameTextBox.Text); xmlwriter.SetValue("dvdplayer", "arguments", parametersTextBox.Text); xmlwriter.SetValueAsBool("dvdplayer", "internal", !internalPlayerCheckBox.Checked); xmlwriter.SetValueAsBool("dvdplayer", "mediainfoused", useMediaInfo.Checked); } }
public void SaveSettings() { using (Settings writer = new MPSettings()) { writer.SetValueAsBool("psclientplugin", "homeonly", homeOnlyCheckBox.Checked); writer.SetValueAsBool("psclientplugin", "extensivelogging", extLogCheckBox.Checked); writer.SetValue("psclientplugin", "shutdownmode", shutModeComboBox.SelectedIndex.ToString()); writer.SetValueAsBool("psclientplugin", "forceshutdown", forceCheckBox.Checked); writer.SetValueAsBool("psclientplugin", "shutdownenabled", enableShutdownCheckBox.Checked); writer.SetValue("psclientplugin", "idletimeout", idleNumericUpDown.Value); } }
public override void SaveSettings() { using (Settings xmlwriter = new MPSettings()) { xmlwriter.SetValue("general", "loglevel", cbDebug.SelectedIndex); xmlwriter.SetValue("general", "ThreadPriority", mpThreadPriority.SelectedItem.ToString()); xmlwriter.SetValueAsBool("general", "watchdogEnabled", checkBoxEnableWatchdog.Checked); xmlwriter.SetValueAsBool("general", "restartOnError", checkBoxAutoRestart.Checked); xmlwriter.SetValue("general", "restart delay", numericUpDownDelay.Value); } }
private void SaveSettings() { using (Settings xmlreader = new MPSettings()) { xmlreader.SetValue("tvservice", "hostname", _serverHostName); xmlreader.SetValue("tvservice", "preferredlanguages", _preferredLanguages); xmlreader.SetValueAsBool("tvservice", "preferac3", _preferAC3); xmlreader.SetValueAsBool("tvservice", "rebuildgraphOnNewAudioSpecs", _rebuildGraphOnNewAudioSpecs); xmlreader.SetValueAsBool("tvservice", "rebuildgraphOnNewVideoSpecs", _rebuildGraphOnNewVideoSpecs); xmlreader.SetValueAsBool("tvservice", "avoidSeeking", _avoidSeeking); } }
private void SaveSettings() { // Don't save setting if skin value was not set if (_btnSkin != null && _btnSkin.Label != "Skin:") { using (Settings xmlwriter = new MPSettings()) { xmlwriter.SetValue("gui", "language", _btnLanguage.Label); xmlwriter.SetValue("skin", "name", _btnSkin.Label); xmlwriter.SetValueAsBool("gui", "myprefix", _btnLanguagePrefix.Selected); } Config.SkinName = _btnSkin.Label; } }
public override void DoModal(int dwParentId) { int nagCount; using (Settings xmlreader = new MPSettings()) { nagCount = xmlreader.GetValueAsInt("general", "skinobsoletecount", 0); } //if (chkIgnore != null) //{ chkIgnore.Visible = nagCount > 4; //} GUIPropertyManager.SetProperty("#userskin", _userSkin); _timeLeft = 0; timeStart = DateTime.Now; UpdateCountDown(0); base.DoModal(dwParentId); GUIPropertyManager.SetProperty("#userskin", ""); GUIPropertyManager.SetProperty("#countdownseconds", ""); if (RevertToUserSkin) { nagCount++; } using (Settings xmlwriter = new MPSettings()) { xmlwriter.SetValueAsBool("general", "dontshowskinversion", chkIgnore.Selected); xmlwriter.SetValue("general", "skinobsoletecount", nagCount); } }
private void SaveSettings() { using (Settings xmlreader = new MPSettings()) { xmlreader.SetValue("tvservice", "hostname", _hostName); } }
private void SaveSettings() { using (Settings xmlwriter = new MPSettings()) { xmlwriter.SetValueAsBool("filemenu", "enabled", btnFileMenu.Selected); xmlwriter.SetValue("filemenu", "pincode", Utils.EncryptPassword(_pin)); } }
public override void SaveSettings() { using (Settings xmlwriter = new MPSettings()) { xmlwriter.SetValue("gui", "ScrollSpeedRight", HorizontalScrollSpeedUpDown.Value); xmlwriter.SetValue("gui", "ScrollSpeedDown", VerticalScrollSpeedUpDown.Value); xmlwriter.SetValue("gui", "listLoopDelay", listLoopDelayUpDown.Value); } }
private void SaveSettings() { using (Settings xmlreader = new MPSettings()) { xmlreader.SetValueAsBool("myradio", "showallchannelsgroup", _showAllChannelsGroup); xmlreader.SetValueAsBool("myradio", "rememberlastgroup", _rememberLastGroup); xmlreader.SetValue("myradio", "rootgroup", _rootGroup); xmlreader.SetValueAsBool ("myradio", "autoturnonradio",_autoTurnOnRadio); } }
public void SetValue(string key, string value, bool encrypt = false) { using (Settings settings = new MPSettings()) { if (encrypt) value = EncryptionUtils.SymEncryptLocalPC(value); if (string.IsNullOrWhiteSpace(value)) settings.RemoveEntry(PluginConfiguration.CFG_SECTION, key); else settings.SetValue(PluginConfiguration.CFG_SECTION, key, value); } }
public static void Dispose() { if (_instance == null) { return; } if (_instance._mixer != null) { using (Settings writer = new MPSettings()) { writer.SetValue("volume", "lastknown", _instance._mixer.Volume); } _instance._mixer.SafeDispose(); _instance._mixer = null; } _instance = null; GUIGraphicsContext.VolumeHandler = null; }
public void OnServiceInfo(int page, byte type, byte langb1, byte langb2, byte langb3) { lock (this) { if (page < 100) { page += 800; } Log.Debug("Page {0} is of type {1} and in lang {2}{3}{4}", page, type, (char)langb1, (char)langb2, (char)langb3); StringBuilder sbuf = new StringBuilder(); sbuf.Append((char)langb1); sbuf.Append((char)langb2); sbuf.Append((char)langb3); try { using (MPSettings xmlreader = new MPSettings()) { // The setting "dvbdefttxtsubtitles" is used to be able to pass the page number to SubtitleSelector when it is available. // It's a runtime value and it would be better not to use MPSettings here if possible? // 999;999 = PageNo;Index. PageNo = found page. Index = index of the selected subtitle languages. The lower, the better. string defLang = xmlreader.GetValueAsString("tvservice", "dvbdefttxtsubtitles", "999;999"); string prefLang = xmlreader.GetValueAsString("tvservice", "preferredsublanguages", ""); int langIndex = 0; foreach (string lang in prefLang.Split(';')) { if (lang.Trim() == sbuf.ToString().Trim() && type == 2) { if (langIndex <= Convert.ToInt16(defLang.Split(';')[1])) { xmlreader.SetValue("tvservice", "dvbdefttxtsubtitles", page.ToString() + ";" + langIndex); Log.Debug("Found preferred subtitle language {0} on page {1} with index {2}", lang, page, langIndex); } } langIndex += 1; } } } catch { } ttxtDecoder.OnServiceInfo(page, type, sbuf.ToString()); } }
private void OnAspectRatioDisplayMode() { AspectRatioDisplayMode aspectRatioDisplayMode = AspectRatioDisplayMode.DisplayContentDefault; using (Settings xmlreader = new MPSettings()) { string aspectRatioDisplayModeText = xmlreader.GetValueAsString("dvdplayer", "displaymode", "Default"); aspectRatioDisplayMode = GetAspectRatioDisplayMode(aspectRatioDisplayModeText); } GUIDialogMenu dlg = (GUIDialogMenu)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_MENU); if (dlg == null) { return; } dlg.Reset(); dlg.SetHeading(GUILocalizeStrings.Get(496)); //Menu dlg.Add("Default"); dlg.Add("16:9"); dlg.Add("4:3 Pan Scan"); dlg.Add("4:3 Letterbox"); // set the focus to currently used mode dlg.SelectedLabel = (int)aspectRatioDisplayMode; // show dialog and wait for result dlg.DoModal(GetID); if (dlg.SelectedId == -1) { OnAspectRatio(); return; } aspectRatioDisplayMode = GetAspectRatioDisplayMode(dlg.SelectedLabelText); using (Settings xmlwriter = new MPSettings()) { string aspectRatioDisplayModetext = GetAspectRatioDisplayMode(aspectRatioDisplayMode); xmlwriter.SetValue("dvdplayer", "displaymode", aspectRatioDisplayModetext); } OnAspectRatio(); }
/// <summary> /// Run the MusicDBReorg, when it's schedule is due. /// </summary> private void Run() { Log.Debug("MusicDBReorg.Run: thread started"); while (_run) { if (ShouldRunSchedule()) { // Start the Music DB Reorganization _reorgRunning = true; Log.Info("MusicDBReorg.Run: schedule is due:{0}", DateTime.Now.ToString()); try { LoadShares(); mDB.MusicDatabaseReorg(m_Shares); } catch (Exception ex) { Log.Error("MusicDBReorg.Run: Reorg failed:{0}", ex.Message); } // store last run using (Settings writer = new MPSettings()) { writer.SetValue("musicdbreorg", "lastrun", DateTime.Now.Day); } Log.Info("MusicDBReorg.Run: Reorg finished:{0}", DateTime.Now.ToString()); _reorgRunning = false; } else { // stay Idle for a minute checking if we have to stop every second int timeout = 60000; while (_run && timeout > 0) { Thread.Sleep(1000); timeout -= 1000; } } } Log.Debug("MusicDBReorg.Run: thread stopped"); }
public static void Dispose() { if (_instance == null) { return; } if (_instance._mixer != null) { using (Settings writer = new MPSettings()) { writer.SetValue("volume", "lastknown", _instance._mixer.Volume); } _instance._mixer.ControlChanged -= mixer_ControlChanged; _instance._mixer.SafeDispose(); _instance._mixer = null; } _instance = null; }
public override void SaveSettings() { if (_init == false) { return; } using (Settings xmlwriter = new MPSettings()) { xmlwriter.SetValue("mytv", "defaultar", defaultZoomModeComboBox.SelectedItem); xmlwriter.SetValueAsBool("mytv", "allowarnormal", cbAllowNormal.Checked); xmlwriter.SetValueAsBool("mytv", "allowaroriginal", cbAllowOriginal.Checked); xmlwriter.SetValueAsBool("mytv", "allowarzoom", cbAllowZoom.Checked); xmlwriter.SetValueAsBool("mytv", "allowarzoom149", cbAllowZoom149.Checked); xmlwriter.SetValueAsBool("mytv", "allowarstretch", cbAllowStretch.Checked); xmlwriter.SetValueAsBool("mytv", "allowarnonlinear", cbAllowNonLinearStretch.Checked); xmlwriter.SetValueAsBool("mytv", "allowarletterbox", cbAllowLetterbox.Checked); } }
private void OnAspectRatioCorrectionMode() { AspectRatioCorrectionMode aspectRatioCorrectionMode = AspectRatioCorrectionMode.Followstream; using (Settings xmlreader = new MPSettings()) { string aspectRatioCorrectionModeText = xmlreader.GetValueAsString("dvdplayer", "armode", "Follow stream"); aspectRatioCorrectionMode = GetAspectRatioCorrectionMode(aspectRatioCorrectionModeText); } GUIDialogMenu dlg = (GUIDialogMenu)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_MENU); if (dlg == null) { return; } dlg.Reset(); dlg.SetHeading(GUILocalizeStrings.Get(496)); //Menu dlg.Add("Crop"); dlg.Add("Letterbox"); dlg.Add("Stretch"); dlg.Add("Follow Stream"); // set the focus to currently used mode dlg.SelectedLabel = (int)aspectRatioCorrectionMode; // show dialog and wait for result dlg.DoModal(GetID); if (dlg.SelectedId == -1) { OnAspectRatio(); return; } aspectRatioCorrectionMode = GetAspectRatioCorrectionMode(dlg.SelectedLabelText); using (Settings xmlwriter = new MPSettings()) { string aspectRatioCorrectionModetext = GetAspectRatioCorrectionMode(aspectRatioCorrectionMode); xmlwriter.SetValue("dvdplayer", "armode", aspectRatioCorrectionModetext); } OnAspectRatio(); }
protected override void SaveSettings() { base.SaveSettings(); using (Settings xmlwriter = new MPSettings()) { xmlwriter.SetValue(SerializeName, "layout", (int)currentLayout); xmlwriter.SetValueAsBool(SerializeName, "sortasc", m_bSortAscending); switch (currentSortMethod) { case SortMethod.Name: xmlwriter.SetValue("myradio", "sort", "name"); break; case SortMethod.Type: xmlwriter.SetValue("myradio", "sort", "type"); break; case SortMethod.Genre: xmlwriter.SetValue("myradio", "sort", "genre"); break; case SortMethod.Bitrate: xmlwriter.SetValue("myradio", "sort", "bitrate"); break; case SortMethod.Number: xmlwriter.SetValue("myradio", "sort", "number"); break; } xmlwriter.SetValue("myradio", "lastgroup", lastFolder); if (_currentChannel != null) { xmlwriter.SetValue("myradio", "channel", _currentChannel.DisplayName); } } }
private void SaveSettings() { // save settings using (Settings writer = new MPSettings()) { int hours, minutes; hours = Int32.Parse(hoursTextBox.Text); minutes = Int32.Parse(minutesTextBox.Text); VerifySchedule(ref hours, ref minutes); writer.SetValue("musicdbreorg", "hours", hours); writer.SetValue("musicdbreorg", "minutes", minutes); writer.SetValueAsBool("musicdbreorg", "monday", cbMonday.Checked); writer.SetValueAsBool("musicdbreorg", "tuesday", cbTuesday.Checked); writer.SetValueAsBool("musicdbreorg", "wednesday", cbWednesday.Checked); writer.SetValueAsBool("musicdbreorg", "thursday", cbThursday.Checked); writer.SetValueAsBool("musicdbreorg", "friday", cbFriday.Checked); writer.SetValueAsBool("musicdbreorg", "saturday", cbSaturday.Checked); writer.SetValueAsBool("musicdbreorg", "sunday", cbSunday.Checked); } }
private bool SaveMapping(string xmlFile) { if (m_bchangedsettings == true) { try { string directory = InputHandler.CustomizedMappingsDirectory; DirectoryInfo dir = Directory.CreateDirectory(directory); doc.Save(directory + "\\" + xmlFile); } catch { Log.Info("MAP: Error accessing directory \"InputDeviceMappings\\custom\""); } } using (Settings xmlwriter = new MPSettings()) { xmlwriter.SetValue("remote", "remotenumberindex" + m_sRemoteClass, mpRemotenumber.SelectedIndex); } return(true); }
private void SaveExtensions() { ArrayList aExtensions = new ArrayList(); foreach (var lItem in extensionsListcontrol.ListItems) { aExtensions.Add(lItem.Label); } aExtensions.Sort(); string extensions = string.Empty; foreach (string aExtension in aExtensions) { extensions = extensions + aExtension + ","; } extensions = extensions.Remove(extensions.LastIndexOf(",")); using (Profile.Settings xmlwriter = new MPSettings()) { xmlwriter.SetValue(_section, "extensions", extensions); } switch (_section) { case "movies": GUIVideoFiles.ResetExtensions(aExtensions); break; case "music": GUIMusicFiles.ResetExtensions(aExtensions); break; case "pictures": Pictures.GUIPictures.ResetExtensions(aExtensions); break; } }
private void OnAACAudioCodec() { string strAACAudioCodec = ""; using (Settings xmlreader = new MPSettings()) { strAACAudioCodec = xmlreader.GetValueAsString("movieplayer", "aacaudiocodec", ""); } ArrayList availableAACAudioFilters = FilterHelper.GetFilters(MediaType.Audio, MediaSubType.AAC); availableAACAudioFilters.Sort(); GUIDialogMenu dlg = (GUIDialogMenu)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_MENU); if (dlg != null) { dlg.Reset(); dlg.SetHeading(GUILocalizeStrings.Get(496)); //Menu int selected = 0; int count = 0; foreach (string codec in availableAACAudioFilters) { dlg.Add(codec); //delete if (codec == strAACAudioCodec) { selected = count; } count++; } dlg.SelectedLabel = selected; } dlg.DoModal(GetID); if (dlg.SelectedLabel < 0) { return; } using (Settings xmlwriter = new MPSettings()) { xmlwriter.SetValue("movieplayer", "aacaudiocodec", (string)availableAACAudioFilters[dlg.SelectedLabel]); } }
private void OnDVDNavigator() { string strDVDNavigator = ""; using (Settings xmlreader = new MPSettings()) { strDVDNavigator = xmlreader.GetValueAsString("dvdplayer", "navigator", "DVD Navigator"); } ArrayList availableDVDNavigators = FilterHelper.GetDVDNavigators(); availableDVDNavigators.Sort(); GUIDialogMenu dlg = (GUIDialogMenu)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_MENU); if (dlg != null) { dlg.Reset(); dlg.SetHeading(GUILocalizeStrings.Get(496)); //Menu int selected = 0; int count = 0; foreach (string codec in availableDVDNavigators) { dlg.Add(codec); if (codec == strDVDNavigator) { selected = count; } count++; } dlg.SelectedLabel = selected; } dlg.DoModal(GetID); if (dlg.SelectedLabel < 0) { return; } using (Settings xmlwriter = new MPSettings()) { xmlwriter.SetValue("dvdplayer", "navigator", (string)availableDVDNavigators[dlg.SelectedLabel]); } }
public override void SaveSettings() { if (_init == false) { return; } using (Settings xmlwriter = new MPSettings()) { // // Set codecs // xmlwriter.SetValue("mytv", "audiocodec", audioCodecComboBox.Text); xmlwriter.SetValue("mytv", "videocodec", videoCodecComboBox.Text); xmlwriter.SetValue("mytv", "h264videocodec", h264videoCodecComboBox.Text); xmlwriter.SetValue("mytv", "hevcvideocodec", hevcvideoCodecComboBox.Text); xmlwriter.SetValue("mytv", "audiorenderer", audioRendererComboBox.Text); xmlwriter.SetValue("mytv", "aacaudiocodec", aacAudioCodecComboBox.Text); xmlwriter.SetValue("mytv", "ddplusaudiocodec", ddplusAudioCodecComboBox.Text); } }
private void OnAudioRenderer() { string strAudioRenderer = ""; using (Settings xmlreader = new MPSettings()) { strAudioRenderer = xmlreader.GetValueAsString("mytv", "audiorenderer", "Default DirectSound Device"); } ArrayList availableAudioFilters = FilterHelper.GetAudioRenderers(); GUIDialogMenu dlg = (GUIDialogMenu)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_MENU); if (dlg != null) { dlg.Reset(); dlg.SetHeading(GUILocalizeStrings.Get(496)); //Menu int selected = 0; int count = 0; foreach (string codec in availableAudioFilters) { dlg.Add(codec); //delete if (codec == strAudioRenderer) { selected = count; } count++; } dlg.SelectedLabel = selected; } dlg.DoModal(GetID); if (dlg.SelectedLabel < 0) { return; } using (Settings xmlwriter = new MPSettings()) { xmlwriter.SetValue("mytv", "audiorenderer", (string)availableAudioFilters[dlg.SelectedLabel]); } }
public void RevertSkin() { //int ActiveWindowID = GUIWindowManager.ActiveWindow; // Change skin back to OutdatedSkinName GUIGraphicsContext.Skin = _userSkin; GUITextureManager.Clear(); GUITextureManager.Init(); GUIFontManager.LoadFonts(GUIGraphicsContext.Skin + @"\fonts.xml"); GUIFontManager.InitializeDeviceObjects(); GUIExpressionManager.ClearExpressionCache(); GUIControlFactory.ClearReferences(); GUIControlFactory.LoadReferences(GUIGraphicsContext.Skin + @"\references.xml"); GUIWindowManager.OnResize(); //GUIWindowManager.ActivateWindow(ActiveWindowID); using (Settings xmlreader = new MPSettings()) { xmlreader.SetValue("general", "skinobsoletecount", 0); bool autosize = xmlreader.GetValueAsBool("gui", "autosize", true); if (autosize && !GUIGraphicsContext.Fullscreen) { try { GUIGraphicsContext.form.ClientSize = new Size(GUIGraphicsContext.SkinSize.Width, GUIGraphicsContext.SkinSize.Height); //Form.ActiveForm.ClientSize = new Size(GUIGraphicsContext.SkinSize.Width, GUIGraphicsContext.SkinSize.Height); } catch (Exception ex) { Log.Error("OnSkinChanged exception:{0}", ex.ToString()); Log.Error(ex); } } } if (BassMusicPlayer.Player != null && BassMusicPlayer.Player.VisualizationWindow != null) { BassMusicPlayer.Player.VisualizationWindow.Reinit(); } }
private void OnAspectRatio() { Geometry.Type aspectRatio = Geometry.Type.Normal; using (Settings xmlreader = new MPSettings()) { string aspectRatioText = xmlreader.GetValueAsString("dvdplayer", "defaultar", "Normal"); aspectRatio = Utils.GetAspectRatio(aspectRatioText); } GUIDialogMenu dlg = (GUIDialogMenu)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_MENU); if (dlg == null) { return; } dlg.Reset(); dlg.AddLocalizedString(943); // Normal dlg.AddLocalizedString(944); // Original dlg.AddLocalizedString(947); // Zoom dlg.AddLocalizedString(1190); // Zoom 14:9 dlg.AddLocalizedString(942); // Stretch dlg.AddLocalizedString(945); // Letterbox dlg.AddLocalizedString(946); // Non linear stretch // set the focus to currently used mode dlg.SelectedLabel = (int)aspectRatio; // show dialog and wait for result dlg.DoModal(GetID); if (dlg.SelectedId == -1) { return; } aspectRatio = Utils.GetAspectRatioByLangID(dlg.SelectedId); using (Settings xmlwriter = new MPSettings()) { string aspectRatioText = Utils.GetAspectRatio(aspectRatio); xmlwriter.SetValue("dvdplayer", "defaultar", aspectRatioText); } }
private void SaveSettings() { if (!_settingsSaved) { _settingsSaved = true; using (Settings xmlwriter = new MPSettings()) { if (btnClassic.Selected) { xmlwriter.SetValue("volume", "handler", 0); } else if (btnWinXP.Selected) { xmlwriter.SetValue("volume", "handler", 1); } else if (btnLogarithmic.Selected) { xmlwriter.SetValue("volume", "handler", 2); } else if (btnCustom.Selected) { xmlwriter.SetValue("volume", "handler", 3); } else if (btnVistaWin7.Selected) { xmlwriter.SetValue("volume", "handler", 4); } bool useDigital = btnWave.Selected; if (_useMixing) { useDigital = true; } xmlwriter.SetValueAsBool("volume", "digital", useDigital); xmlwriter.SetValue("volume", "table", _customVolume); xmlwriter.SetValueAsBool("volume", "defaultVolumeOSD", btnEnableOSDVolume.Selected); VolumeHandler.Instance.IsEnabledVolumeOSD = btnEnableOSDVolume.Selected; } } }
private void SaveSettings() { using (Settings xmlwriter = new MPSettings()) { switch (_currentSortMethod) { case SortMethod.Channel: xmlwriter.SetValue(SettingsSection, "sort", "channel"); break; case SortMethod.Date: xmlwriter.SetValue(SettingsSection, "sort", "date"); break; case SortMethod.Name: xmlwriter.SetValue(SettingsSection, "sort", "name"); break; } switch (_currentProgramType) { case ScheduleType.Recording: xmlwriter.SetValue(SettingsSection, "programtype", "recordings"); break; case ScheduleType.Alert: xmlwriter.SetValue(SettingsSection, "programtype", "alerts"); break; case ScheduleType.Suggestion: xmlwriter.SetValue(SettingsSection, "programtype", "suggestions"); break; } xmlwriter.SetValueAsBool(SettingsSection, "sortascending", m_bSortAscending); xmlwriter.SetValueAsBool(SettingsSection, "groupbyschedule", _groupBySchedButton.Selected); } }
public override void SaveSettings() { Int32 regValue; int OutPutModeIndex; using (RegistryKey subkey = Registry.CurrentUser.CreateSubKey(@"Software\InterVideo\Common\AudioDec\MediaPortal")) { if (subkey != null) { switch (comboBoxSpeakerConfig.SelectedIndex) { //2 Speakers case 0: #region 2 Speaker regValue = 1; subkey.SetValue("AUDIOCHAN", regValue); OutPutModeIndex = comboBoxOutPutMode.SelectedIndex; if (OutPutModeIndex == 0) { regValue = 0; subkey.SetValue("AUDIO", regValue); } if (OutPutModeIndex == 1) { regValue = 1; subkey.SetValue("AUDIO", regValue); } if (OutPutModeIndex == 2) { regValue = 2; subkey.SetValue("AUDIO", regValue); } #endregion break; //4 Speakers case 1: #region 4 Speaker regValue = 3; subkey.SetValue("AUDIOCHAN", regValue); regValue = 4; subkey.SetValue("AUDIO", regValue); #endregion break; //6 Speakers case 2: #region 6 Speaker (5.1) regValue = 4; subkey.SetValue("AUDIOCHAN", regValue); regValue = 5; subkey.SetValue("AUDIO", regValue); #endregion break; //7 Speakers case 3: #region 7 Speaker (6.1) regValue = 5; subkey.SetValue("AUDIOCHAN", regValue); regValue = 6; subkey.SetValue("AUDIO", regValue); #endregion break; //8 Speakers case 4: #region 8 Speaker (7.1) regValue = 8; subkey.SetValue("AUDIOCHAN", regValue); regValue = 7; subkey.SetValue("AUDIO", regValue); #endregion break; // SPDIF Out case 5: #region S/PDIF Out regValue = 6; subkey.SetValue("AUDIOCHAN", regValue); regValue = 7; subkey.SetValue("AUDIO", regValue); #endregion break; } } } using (RegistryKey subkey = Registry.CurrentUser.CreateSubKey(@"Software\InterVideo\Common\VideoDec\MediaPortal")) { if (subkey != null) { Int32 regDxVA; if (checkBoxDxVA.Checked) { regDxVA = 1; } else { regDxVA = 0; } subkey.SetValue("DXVA", regDxVA); using (Settings xmlwriter = new MPSettings()) { xmlwriter.SetValue("videocodec", "intervideo", regDxVA); } Int32 regHWMC; if (checkBoxHWMC.Checked) { regHWMC = 1; } else { regHWMC = 0; } subkey.SetValue("HWMC", regHWMC); int DeInterlace; Int32 regDeInterlace; DeInterlace = comboBoxDeInterlace.SelectedIndex; if (DeInterlace == 0) { regDeInterlace = 0; subkey.SetValue("BOBWEAVE", regDeInterlace); } if (DeInterlace == 1) { regDeInterlace = 1; subkey.SetValue("BOBWEAVE", regDeInterlace); } if (DeInterlace == 2) { regDeInterlace = 2; subkey.SetValue("BOBWEAVE", regDeInterlace); } if (DeInterlace == 3) { regDeInterlace = 3; subkey.SetValue("BOBWEAVE", regDeInterlace); } } } }
public override void SaveSettings() { using (Settings xmlwriter = new MPSettings()) { //Use Internel Menu xmlwriter.SetValueAsBool("bdplayer", "useInternalBDPlayer", useInternalBDPlayer.Checked); xmlwriter.SetValue("bdplayer", "audiolanguage", defaultAudioLanguageComboBox.Text); xmlwriter.SetValue("bdplayer", "subtitlelanguage", defaultSubtitleLanguageComboBox.Text); xmlwriter.SetValue("bdplayer", "audiotype", preferredAudioTypeComboBox.Text); xmlwriter.SetValue("bdplayer", "regioncode", RegionCodeComboBox.SelectedItem); xmlwriter.SetValue("bdplayer", "parentalcontrol", ParentalControlUpDown.Value.ToString()); xmlwriter.SetValueAsBool("bdplayer", "subtitlesenabled", SubsEnabled.Checked); } }
public void SaveSettings(string section) { if (AddOpticalDiskDrives) { AddStaticShares(DriveType.DVD, "DVD"); } using (Profile.Settings xmlwriter = new MPSettings()) { string defaultShare = string.Empty; for (int index = 0; index < 128; index++) { string shareName = String.Format("sharename{0}", index); string sharePath = String.Format("sharepath{0}", index); string sharePin = String.Format("pincode{0}", index); string shareType = String.Format("sharetype{0}", index); string shareServer = String.Format("shareserver{0}", index); string shareLogin = String.Format("sharelogin{0}", index); string sharePwd = String.Format("sharepassword{0}", index); string sharePort = String.Format("shareport{0}", index); string shareRemotePath = String.Format("shareremotepath{0}", index); string shareViewPath = String.Format("shareview{0}", index); xmlwriter.RemoveEntry(section, shareName); xmlwriter.RemoveEntry(section, sharePath); xmlwriter.RemoveEntry(section, sharePin); xmlwriter.RemoveEntry(section, shareType); xmlwriter.RemoveEntry(section, shareServer); xmlwriter.RemoveEntry(section, shareLogin); xmlwriter.RemoveEntry(section, sharePwd); xmlwriter.RemoveEntry(section, sharePort); xmlwriter.RemoveEntry(section, shareRemotePath); xmlwriter.RemoveEntry(section, shareViewPath); if (section == "music" || section == "movies") { string shareScan = String.Format("sharescan{0}", index); xmlwriter.RemoveEntry(section, shareScan); } if (section == "movies") { string thumbs = String.Format("videothumbscreate{0}", index); xmlwriter.RemoveEntry(section, thumbs); string movieFolder = String.Format("eachfolderismovie{0}", index); xmlwriter.RemoveEntry(section, movieFolder); } string shareNameData = string.Empty; string sharePathData = string.Empty; string sharePinData = string.Empty; bool shareTypeData = false; string shareServerData = string.Empty; string shareLoginData = string.Empty; string sharePwdData = string.Empty; int sharePortData = 21; string shareRemotePathData = string.Empty; int shareLayout = (int)MediaPortal.GUI.Library.GUIFacadeControl.Layout.List; bool shareScanData = false; //ThumbsCreate (default true) bool thumbsCreate = true; bool folderIsMovie = false; if (_shareListControl != null && _shareListControl.Count > index) { ShareData shareData = _shareListControl[index].AlbumInfoTag as ShareData; if (shareData != null && !String.IsNullOrEmpty(shareData.Name)) { shareNameData = shareData.Name; sharePathData = shareData.Folder; sharePinData = shareData.PinCode; shareTypeData = shareData.IsRemote; shareServerData = shareData.Server; shareLoginData = shareData.LoginName; sharePwdData = shareData.PassWord; sharePortData = shareData.Port; shareRemotePathData = shareData.RemoteFolder; shareLayout = (int)shareData.DefaultLayout; shareScanData = shareData.ScanShare; // ThumbsCreate thumbsCreate = shareData.CreateThumbs; folderIsMovie = shareData.EachFolderIsMovie; if (shareNameData == _defaultShare) { defaultShare = shareNameData; } xmlwriter.SetValue(section, shareName, shareNameData); xmlwriter.SetValue(section, sharePath, sharePathData); xmlwriter.SetValue(section, sharePin, Util.Utils.EncryptPin(sharePinData)); xmlwriter.SetValueAsBool(section, shareType, shareTypeData); xmlwriter.SetValue(section, shareServer, shareServerData); xmlwriter.SetValue(section, shareLogin, shareLoginData); xmlwriter.SetValue(section, sharePwd, sharePwdData); xmlwriter.SetValue(section, sharePort, sharePortData.ToString()); xmlwriter.SetValue(section, shareRemotePath, shareRemotePathData); xmlwriter.SetValue(section, shareViewPath, shareLayout); if (section == "music" || section == "movies") { string shareScan = String.Format("sharescan{0}", index); xmlwriter.SetValueAsBool(section, shareScan, shareScanData); } if (section == "movies") { string thumbs = String.Format("videothumbscreate{0}", index); xmlwriter.SetValueAsBool(section, thumbs, thumbsCreate); string folderMovie = String.Format("eachfolderismovie{0}", index); xmlwriter.SetValueAsBool(section, folderMovie, folderIsMovie); } } } } xmlwriter.SetValue(section, "default", defaultShare); xmlwriter.SetValueAsBool(section, "rememberlastfolder", RememberLastFolder); xmlwriter.SetValueAsBool(section, "AddOpticalDiskDrives", AddOpticalDiskDrives); xmlwriter.SetValueAsBool(section, "SwitchRemovableDrives", SwitchRemovableDrives); } // Set new shares for internal plugins switch (section) { case "movies": GUIVideoFiles.ResetShares(); break; case "music": GUIMusicFiles.ResetShares(); break; case "pictures": GUIPictures.ResetShares(); break; } }
/// <summary> /// Saves movie player settings and codec info. /// </summary> public override void SaveSettings() { if (_init == false) { return; } using (Settings xmlwriter = new MPSettings()) { xmlwriter.SetValueAsBool("movieplayer", "autodecodersettings", autoDecoderSettings.Checked); xmlwriter.SetValueAsBool("movieplayer", "forcesourcesplitter", ForceSourceSplitter.Checked); xmlwriter.SetValueAsBool("movieplayer", "usemoviecodects", mpCheckBoxTS.Checked); xmlwriter.SetValue("movieplayer", "audiorenderer", audioRendererComboBox.Text); // Set codecs xmlwriter.SetValue("movieplayer", "mpeg2audiocodec", audioCodecComboBox.Text); xmlwriter.SetValue("movieplayer", "mpeg2videocodec", videoCodecComboBox.Text); xmlwriter.SetValue("movieplayer", "h264videocodec", h264videoCodecComboBox.Text); xmlwriter.SetValue("movieplayer", "vc1ivideocodec", vc1ivideoCodecComboBox.Text); xmlwriter.SetValue("movieplayer", "vc1videocodec", vc1videoCodecComboBox.Text); xmlwriter.SetValue("movieplayer", "xvidvideocodec", xvidvideoCodecComboBox.Text); xmlwriter.SetValue("movieplayer", "aacaudiocodec", aacAudioCodecComboBox.Text); xmlwriter.SetValue("movieplayer", "splitterfilter", SplitterComboBox.Text); xmlwriter.SetValue("movieplayer", "splitterfilefilter", SplitterFileComboBox.Text); xmlwriter.SetValueAsBool("movieplayer", "settinglavplitter", settingLAVSlitter); } }
private static void SetRemoteControlHostName() { string hostName; using (Settings xmlreader = new MPSettings()) { hostName = xmlreader.GetValueAsString("tvservice", "hostname", ""); if (string.IsNullOrEmpty(hostName) || hostName == "localhost") { try { hostName = Dns.GetHostName(); Log.Info("TVHome: No valid hostname specified in mediaportal.xml!"); xmlreader.SetValue("tvservice", "hostname", hostName); hostName = "localhost"; Settings.SaveCache(); } catch (Exception ex) { Log.Info("TVHome: Error resolving hostname - {0}", ex.Message); return; } } } RemoteControl.HostName = hostName; Log.Info("Remote control:master server :{0}", RemoteControl.HostName); }
public override void SaveSettings() { CheckAndResetSettings(); bool rtsp = singleSeat ? mpUseRtspCheckBox.Checked : !mpUseRtspCheckBox.Checked; using (Settings xmlwriter = new MPSettings()) { xmlwriter.SetValueAsBool("tvservice", "usertsp", rtsp); xmlwriter.SetValue("tvservice", "recordingpath", textBoxRecording.Text); xmlwriter.SetValue("tvservice", "timeshiftingpath", textBoxTimeshifting.Text); xmlwriter.SetValueAsBool("tvservice", "AdvancedOptions", true); } DebugSettings.DoNotAllowSlowMotionDuringZapping = mpDoNotAllowSlowMotionDuringZappingCheckBox.Checked; }
protected void SaveSettings(string section) { if (AddOpticalDiskDrives) { AddStaticShares(DriveType.DVD, "DVD"); } using (Settings xmlwriter = new MPSettings()) { string defaultShare = string.Empty; for (int index = 0; index < MaximumShares; index++) { string shareName = String.Format("sharename{0}", index); string sharePath = String.Format("sharepath{0}", index); string sharePin = String.Format("pincode{0}", index); string shareType = String.Format("sharetype{0}", index); string shareServer = String.Format("shareserver{0}", index); string shareLogin = String.Format("sharelogin{0}", index); string sharePwd = String.Format("sharepassword{0}", index); string sharePort = String.Format("shareport{0}", index); string shareRemotePath = String.Format("shareremotepath{0}", index); string shareViewPath = String.Format("shareview{0}", index); xmlwriter.RemoveEntry(section, shareName); xmlwriter.RemoveEntry(section, sharePath); xmlwriter.RemoveEntry(section, sharePin); xmlwriter.RemoveEntry(section, shareType); xmlwriter.RemoveEntry(section, shareServer); xmlwriter.RemoveEntry(section, shareLogin); xmlwriter.RemoveEntry(section, sharePwd); xmlwriter.RemoveEntry(section, sharePort); xmlwriter.RemoveEntry(section, shareRemotePath); xmlwriter.RemoveEntry(section, shareViewPath); if (section == "music" || section == "movies") { string shareScan = String.Format("sharescan{0}", index); xmlwriter.RemoveEntry(section, shareScan); } string shareNameData = string.Empty; string sharePathData = string.Empty; string sharePinData = string.Empty; bool shareTypeData = false; string shareServerData = string.Empty; string shareLoginData = string.Empty; string sharePwdData = string.Empty; int sharePortData = 21; string shareRemotePathData = string.Empty; int shareLayout = (int)MediaPortal.GUI.Library.GUIFacadeControl.Layout.List; bool shareScanData = false; if (CurrentShares != null && CurrentShares.Count > index) { ShareData shareData = CurrentShares[index].Tag as ShareData; if (shareData != null && !String.IsNullOrEmpty(shareData.Name)) { shareNameData = shareData.Name; sharePathData = shareData.Folder; sharePinData = shareData.PinCode; shareTypeData = shareData.IsRemote; shareServerData = shareData.Server; shareLoginData = shareData.LoginName; sharePwdData = shareData.PassWord; sharePortData = shareData.Port; shareRemotePathData = shareData.RemoteFolder; shareLayout = (int)shareData.DefaultLayout; shareScanData = shareData.ScanShare; if (CurrentShares[index] == DefaultShare) { defaultShare = shareNameData; } xmlwriter.SetValue(section, shareName, shareNameData); xmlwriter.SetValue(section, sharePath, sharePathData); xmlwriter.SetValue(section, sharePin, Util.Utils.EncryptPin(sharePinData)); xmlwriter.SetValueAsBool(section, shareType, shareTypeData); xmlwriter.SetValue(section, shareServer, shareServerData); xmlwriter.SetValue(section, shareLogin, shareLoginData); xmlwriter.SetValue(section, sharePwd, sharePwdData); xmlwriter.SetValue(section, sharePort, sharePortData.ToString()); xmlwriter.SetValue(section, shareRemotePath, shareRemotePathData); xmlwriter.SetValue(section, shareViewPath, shareLayout); if (section == "music" || section == "movies") { string shareScan = String.Format("sharescan{0}", index); xmlwriter.SetValueAsBool(section, shareScan, shareScanData); } } } } xmlwriter.SetValue(section, "default", defaultShare); xmlwriter.SetValueAsBool(section, "rememberlastfolder", RememberLastFolder); xmlwriter.SetValueAsBool(section, "AddOpticalDiskDrives", AddOpticalDiskDrives); xmlwriter.SetValueAsBool(section, "SwitchRemovableDrives", SwitchRemovableDrives); } }
/// <summary> /// Saves movie player settings and codec info. /// </summary> public override void SaveSettings() { if (_init == false) { return; } using (Settings xmlwriter = new MPSettings()) { xmlwriter.SetValueAsBool("movieplayer", "autodecodersettings", autoDecoderSettings.Checked); xmlwriter.SetValueAsBool("movieplayer", "forcesourcesplitter", ForceSourceSplitter.Checked); xmlwriter.SetValueAsBool("movieplayer", "usemoviecodects", mpCheckBoxTS.Checked); xmlwriter.SetValue("movieplayer", "audiorenderer", audioRendererComboBox.Text); // Set codecs xmlwriter.SetValue("movieplayer", "mpeg2audiocodec", audioCodecComboBox.Text); xmlwriter.SetValue("movieplayer", "mpeg2videocodec", videoCodecComboBox.Text); xmlwriter.SetValue("movieplayer", "h264videocodec", h264videoCodecComboBox.Text); xmlwriter.SetValue("movieplayer", "hevcvideocodec", hevcvideoCodecComboBox.Text); xmlwriter.SetValue("movieplayer", "vc1ivideocodec", vc1ivideoCodecComboBox.Text); xmlwriter.SetValue("movieplayer", "vc1videocodec", vc1videoCodecComboBox.Text); xmlwriter.SetValue("movieplayer", "xvidvideocodec", xvidvideoCodecComboBox.Text); xmlwriter.SetValue("movieplayer", "aacaudiocodec", aacAudioCodecComboBox.Text); xmlwriter.SetValue("movieplayer", "splitterfilter", SplitterComboBox.Text); xmlwriter.SetValue("movieplayer", "splitterfilefilter", SplitterFileComboBox.Text); xmlwriter.SetValueAsBool("movieplayer", "settinglavplitter", settingLAVSlitter); } }
/// <summary> /// Saves the Settings /// </summary> internal static void SaveSettings() { FileLog.Info("Saving Settings"); using (Settings xmlwriter = new MPSettings()) { xmlwriter.SetValue(cTrailers, cSettingsVersion, SettingsVersion); xmlwriter.SetValue(cTrailers, cWebMaxRetries, WebMaxRetries); xmlwriter.SetValue(cTrailers, cWebTimeout, WebTimeout); xmlwriter.SetValue(cTrailers, cWebTimeoutIncrement, WebTimeoutIncrement); xmlwriter.SetValue(cTrailers, cWebRequestCacheMinutes, WebRequestCacheMinutes.ToString()); xmlwriter.SetValueAsBool(cTrailers, cProviderLocalSearch, ProviderLocalSearch); xmlwriter.SetValueAsBool(cTrailers, cProviderTMDb, ProviderTMDb); xmlwriter.SetValueAsBool(cTrailers, cProviderOnlineVideoSearch, ProviderOnlineVideoSearch); xmlwriter.SetValue(cTrailers, cOnlineVideosYouTubeMovieSearchString, OnlineVideosYouTubeMovieSearchString); xmlwriter.SetValue(cTrailers, cOnlineVideosYouTubeShowSearchString, OnlineVideosYouTubeShowSearchString); xmlwriter.SetValue(cTrailers, cOnlineVideosYouTubeSeasonSearchString, OnlineVideosYouTubeSeasonSearchString); xmlwriter.SetValue(cTrailers, cOnlineVideosYouTubeEpisodeSearchString, OnlineVideosYouTubeEpisodeSearchString); xmlwriter.SetValue(cTrailers, cOnlineVideosYouTubeEpisodeSpecialSearchString, OnlineVideosYouTubeEpisodeSpecialSearchString); xmlwriter.SetValueAsBool(cTrailers, cOnlineVideosYouTubeEnabled, OnlineVideosYouTubeEnabled); xmlwriter.SetValueAsBool(cTrailers, cOnlineVideosITunesEnabled, OnlineVideosITunesEnabled); xmlwriter.SetValueAsBool(cTrailers, cOnlineVideosIMDbEnabled, OnlineVideosIMDbEnabled); xmlwriter.SetValueAsBool(cTrailers, cSearchLocalInSubFolder, SearchLocalInSubFolder); xmlwriter.SetValue(cTrailers, cSearchLocalAdditionalSubFolders, SearchLocalAdditionalSubFolders); xmlwriter.SetValueAsBool(cTrailers, cSearchLocalInDedicatedDirectory, SearchLocalInDedicatedDirectory); xmlwriter.SetValue(cTrailers, cSearchLocalDedicatedDirectories, SearchLocalDedicatedDirectories); xmlwriter.SetValue(cTrailers, cSearchLocalDedicatedSubDirectories, SearchLocalDedicatedSubDirectories); xmlwriter.SetValue(cTrailers, cSearchLocalDedicatedDirectorySearchPatterns, SearchLocalDedicatedDirectorySearchPatterns); xmlwriter.SetValueAsBool(cTrailers, cSearchLocalInCurrentMediaFolder, SearchLocalInCurrentMediaFolder); xmlwriter.SetValue(cTrailers, cSearchLocalCurrentMediaFolderSearchPatterns, SearchLocalCurrentMediaFolderSearchPatterns); xmlwriter.SetValueAsBool(cTrailers, cSearchLocalAggressiveSearch, SearchLocalAggressiveSearch); xmlwriter.SetValueAsBool(cTrailers, cSkipOnlineProvidersIfLocalFound, SkipOnlineProvidersIfLocalFound); xmlwriter.SetValueAsBool(cTrailers, cAutoPlayOnSingleLocalOrOnlineTrailer, AutoPlayOnSingleLocalOrOnlineTrailer); xmlwriter.SetValueAsBool(cTrailers, cAutoDownloadTrailersMovingPictures, AutoDownloadTrailersMovingPictures); xmlwriter.SetValueAsBool(cTrailers, cAutoDownloadTrailersMyFilms, AutoDownloadTrailersMyFilms); xmlwriter.SetValueAsBool(cTrailers, cAutoDownloadTrailersMyVideos, AutoDownloadTrailersMyVideos); xmlwriter.SetValue(cTrailers, cAutoDownloadStartDelay, AutoDownloadStartDelay); xmlwriter.SetValue(cTrailers, cAutoDownloadInterval, AutoDownloadInterval); xmlwriter.SetValue(cTrailers, cAutoDownloadUpdateInterval, AutoDownloadUpdateInterval); xmlwriter.SetValue(cTrailers, cAutoDownloadDirectory, AutoDownloadDirectory); xmlwriter.SetValue(cTrailers, cAutoDownloadQuality, AutoDownloadQuality); xmlwriter.SetValueAsBool(cTrailers, cAutoDownloadTrailers, AutoDownloadTrailers); xmlwriter.SetValueAsBool(cTrailers, cAutoDownloadTeasers, AutoDownloadTeasers); xmlwriter.SetValueAsBool(cTrailers, cAutoDownloadFeaturettes, AutoDownloadFeaturettes); xmlwriter.SetValueAsBool(cTrailers, cAutoDownloadClips, AutoDownloadClips); xmlwriter.SetValueAsBool(cTrailers, cAutoDownloadCleanup, AutoDownloadCleanup); xmlwriter.SetValue(cTrailers, cPreferredLanguage, PreferredLanguage); xmlwriter.SetValueAsBool(cTrailers, cFallbackToEnglishLanguage, FallbackToEnglishLanguage); xmlwriter.SetValueAsBool(cTrailers, cAlwaysGetEnglishTrailers, AlwaysGetEnglishTrailers); xmlwriter.SetValueAsBool(cTrailers, cReShowMenuAfterTrailerPlay, ReShowMenuAfterTrailerPlay); } Settings.SaveCache(); FileLog.Info("Saving Persistent File Cache"); SaveFileCache(cTVDbExternalIDs, (TVDbIds ?? "{}".FromJsonArray <ExternalID>()).ToList().ToJson()); SaveFileCache(cIMDbExternalIDs, (IMDbIds ?? "{}".FromJsonArray <ExternalID>()).ToList().ToJson()); SaveFileCache(cTVRageExternalIDs, (TVRageIds ?? "{}".FromJsonArray <ExternalID>()).ToList().ToJson()); }
public override void SaveSettings() { using (Settings xmlwriter = new MPSettings()) { #region Player Settings xmlwriter.SetValue("audioplayer", "playerId", audioPlayerComboBox.SelectedIndex); xmlwriter.SetValue("audioplayer", "sounddevice", (soundDeviceComboBox.SelectedItem as SoundDeviceItem).Name); xmlwriter.SetValue("audioplayer", "sounddeviceid", (soundDeviceComboBox.SelectedItem as SoundDeviceItem).ID); xmlwriter.SetValue("audioplayer", "crossfade", trackBarCrossfade.Value); xmlwriter.SetValue("audioplayer", "buffering", trackBarBuffering.Value); xmlwriter.SetValueAsBool("audioplayer", "useSkipSteps", UseSkipStepsCheckBox.Checked); xmlwriter.SetValueAsBool("audioplayer", "fadeOnStartStop", FadeOnStartStopChkbox.Checked); xmlwriter.SetValueAsBool("audioplayer", "gaplessPlayback", GaplessPlaybackChkBox.Checked); xmlwriter.SetValueAsBool("audioplayer", "enableReplayGain", EnableReplayGainChkBox.Checked); xmlwriter.SetValueAsBool("audioplayer", "enableAlbumReplayGain", EnableAlbumReplayGainChkBox.Checked); xmlwriter.SetValue("audioplayer", "streamOutputLevel", StreamOutputLevelNud.Value); xmlwriter.SetValue("audioplayer", "asiobalance", hScrollBarBalance.Value); xmlwriter.SetValueAsBool("audioplayer", "wasapiExclusive", WasapiExclusiveModeCkBox.Checked); xmlwriter.SetValue("audioplayer", "wasApiSpeakers", WasApiSpeakersCombo.SelectedIndex); xmlwriter.SetValue("audioplayer", "upMixMono", cbUpmixMono.SelectedIndex); xmlwriter.SetValue("audioplayer", "upMixStereo", cbUpmixStereo.SelectedIndex); xmlwriter.SetValue("audioplayer", "upMixQuadro", cbUpmixQuadro.SelectedIndex); xmlwriter.SetValue("audioplayer", "upMixFiveDotOne", cbUpmixFiveDotOne.SelectedIndex); xmlwriter.SetValueAsBool("audioplayer", "enableResume", chkEnableResumeSupport.Checked); xmlwriter.SetValue("audioplayer", "resumeAfter", tbResumeAfter.Text); xmlwriter.SetValue("audioplayer", "resumeSelect", cbResumeSelect.Text); xmlwriter.SetValue("audioplayer", "resumeSearch", tbResumeSearchValue.Text); #endregion #region Visualization Settings if (IVizMgr != null && VisualizationsCmbBox.SelectedIndex > 0) // Something else than "None" selected { List <VisualizationInfo> vizPluginsInfo = IVizMgr.VisualizationPluginsInfo; int selIndex = VisualizationsCmbBox.SelectedIndex; if (selIndex < 0 || selIndex >= vizPluginsInfo.Count) { selIndex = 0; } xmlwriter.SetValue("musicvisualization", "name", vizPluginsInfo[selIndex].Name); xmlwriter.SetValue("musicvisualization", "vizType", ((int)vizPluginsInfo[selIndex].VisualizationType).ToString()); xmlwriter.SetValue("musicvisualization", "path", vizPluginsInfo[selIndex].FilePath); xmlwriter.SetValue("musicvisualization", "clsid", vizPluginsInfo[selIndex].CLSID); xmlwriter.SetValue("musicvisualization", "preset", vizPluginsInfo[selIndex].PresetIndex.ToString()); xmlwriter.SetValueAsBool("musicvisualization", "useOpenGL", ckUseOpenGL.Checked); xmlwriter.SetValueAsBool("musicvisualization", "useCover", ckUseCover.Checked); xmlwriter.SetValue("musicvisualization", "renderTiming", soniqueRenderTiming.Value.ToString()); xmlwriter.SetValue("musicvisualization", "fftSensitivity", winampFFTsensitivity.Value.ToString()); xmlwriter.SetValue("musicvisualization", "viewPort", comboViewPortSizes.SelectedIndex.ToString()); xmlwriter.SetValueAsBool("musicfiles", "doVisualisation", true); } else if (VizPluginInfo.VisualizationType != VisualizationInfo.PluginType.None) // This is the case, when we started Config without activating the Vis Tab { xmlwriter.SetValue("musicvisualization", "name", VizPluginInfo.Name); xmlwriter.SetValue("musicvisualization", "vizType", ((int)VizPluginInfo.VisualizationType).ToString()); xmlwriter.SetValue("musicvisualization", "path", VizPluginInfo.FilePath); xmlwriter.SetValue("musicvisualization", "clsid", VizPluginInfo.CLSID); xmlwriter.SetValue("musicvisualization", "preset", VizPluginInfo.PresetIndex.ToString()); xmlwriter.SetValueAsBool("musicvisualization", "useOpenGL", ckUseOpenGL.Checked); xmlwriter.SetValueAsBool("musicvisualization", "useCover", ckUseCover.Checked); xmlwriter.SetValue("musicvisualization", "renderTiming", soniqueRenderTiming.Value.ToString()); xmlwriter.SetValue("musicvisualization", "fftSensitivity", winampFFTsensitivity.Value.ToString()); xmlwriter.SetValue("musicvisualization", "viewPort", comboViewPortSizes.SelectedIndex.ToString()); xmlwriter.SetValueAsBool("musicfiles", "doVisualisation", true); } else { xmlwriter.SetValue("musicvisualization", "name", ""); xmlwriter.SetValue("musicvisualization", "vizType", 0); xmlwriter.SetValue("musicvisualization", "path", ""); xmlwriter.SetValue("musicvisualization", "clsid", ""); xmlwriter.SetValue("musicvisualization", "preset", ""); xmlwriter.SetValueAsBool("musicvisualization", "useOpenGL", false); xmlwriter.SetValueAsBool("musicvisualization", "useCover", false); xmlwriter.SetValue("musicvisualization", "renderTiming", ""); xmlwriter.SetValue("musicvisualization", "fftSensitivity", ""); xmlwriter.SetValue("musicvisualization", "viewPort", ""); xmlwriter.SetValueAsBool("musicfiles", "doVisualisation", false); } xmlwriter.SetValue("musicvisualization", "fps", VisualizationFpsNud.Value); xmlwriter.SetValueAsBool("musicvisualization", "enableStatusOverlays", EnableStatusOverlaysChkBox.Checked); xmlwriter.SetValueAsBool("musicvisualization", "showTrackInfo", ShowTrackInfoChkBox.Checked); #endregion #region Playlist Settings xmlwriter.SetValue("music", "playlists", playlistFolderTextBox.Text); xmlwriter.SetValueAsBool("musicfiles", "repeat", repeatPlaylistCheckBox.Checked); xmlwriter.SetValueAsBool("musicfiles", "autoshuffle", autoShuffleCheckBox.Checked); xmlwriter.SetValueAsBool("musicfiles", "savePlaylistOnExit", SavePlaylistOnExitChkBox.Checked); xmlwriter.SetValueAsBool("musicfiles", "resumePlaylistOnMusicEnter", ResumePlaylistChkBox.Checked); xmlwriter.SetValueAsBool("musicfiles", "playlistIsCurrent", PlaylistCurrentCheckBox.Checked); //Play behaviour xmlwriter.SetValue("musicfiles", "selectOption", cmbSelectOption.Text.ToLowerInvariant()); xmlwriter.SetValueAsBool("musicfiles", "addall", chkAddAllTracks.Checked); #endregion #region Misc Settings string playNowJumpTo = string.Empty; switch (PlayNowJumpToCmbBox.Text) { case JumpToOption0: playNowJumpTo = JumpToValue0; break; case JumpToOption1: playNowJumpTo = JumpToValue1; break; case JumpToOption2: playNowJumpTo = JumpToValue2; break; case JumpToOption3: playNowJumpTo = JumpToValue3; break; case JumpToOption4: playNowJumpTo = JumpToValue4; break; case JumpToOption5: playNowJumpTo = JumpToValue5; break; case JumpToOption6: playNowJumpTo = JumpToValue6; break; default: playNowJumpTo = JumpToValue0; break; } xmlwriter.SetValue("music", "playnowjumpto", playNowJumpTo); xmlwriter.SetValueAsBool("musicmisc", "showVisInNowPlaying", ShowVizInNowPlayingChkBox.Checked); xmlwriter.SetValueAsBool("musicmisc", "lookupSimilarTracks", !chkDisableSimilarTrackLookups.Checked); string vuMeter = VUMeterValue0; if (radioButtonVUAnalog.Checked) { vuMeter = VUMeterValue1; } else if (radioButtonVULed.Checked) { vuMeter = VUMeterValue2; } xmlwriter.SetValue("musicmisc", "vumeter", vuMeter); #endregion } // Make sure we shut down the viz engine if (IVizMgr != null) { IVizMgr.Stop(); IVizMgr.ShutDown(); } }
public void Save(bool saveOnlyRuntimeModifyable) { OnlineVideos.OnlineVideoSettings ovsconf = OnlineVideos.OnlineVideoSettings.Instance; try { using (Settings settings = new MPSettings()) { settings.SetValue(CFG_SECTION, CFG_GROUPVIEW_MODE, (int)currentGroupView); settings.SetValue(CFG_SECTION, CFG_SITEVIEW_MODE, (int)currentSiteView); settings.SetValue(CFG_SECTION, CFG_SITEVIEW_ORDER, (int)siteOrder); settings.SetValue(CFG_SECTION, CFG_VIDEOVIEW_MODE, (int)currentVideoView); settings.SetValue(CFG_SECTION, CFG_CATEGORYVIEW_MODE, (int)currentCategoryView); if (lastFirstRun != default(DateTime)) { settings.SetValue(CFG_SECTION, CFG_LAST_FIRSTRUN, lastFirstRun.ToString("s")); } try { MemoryStream xmlMem = new MemoryStream(); DataContractSerializer dcs = new DataContractSerializer(typeof(Dictionary <string, List <string> >)); dcs.WriteObject(xmlMem, searchHistory); xmlMem.Position = 0; XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(xmlMem); settings.SetValue(CFG_SECTION, CFG_SEARCHHISTORY, xmlDoc.InnerXml); } catch (Exception e) { Log.Instance.Warn("Error saving search history to configuration: {0}:{1}! Will be reset on next load...", e.GetType(), e.Message); searchHistory = null; settings.SetValue(CFG_SECTION, CFG_SEARCHHISTORY, ""); } if (!saveOnlyRuntimeModifyable) { settings.SetValue(CFG_SECTION, CFG_BASICHOMESCREEN_NAME, BasicHomeScreenName); settings.SetValue(CFG_SECTION, CFG_THUMBNAIL_DIR, ovsconf.ThumbsDir); settings.SetValue(CFG_SECTION, CFG_THUMBNAIL_AGE, ThumbsAge); settings.SetValueAsBool(CFG_SECTION, CFG_USE_AGECONFIRMATION, ovsconf.UseAgeConfirmation); settings.SetValue(CFG_SECTION, CFG_PIN_AGECONFIRMATION, pinAgeConfirmation); settings.SetValueAsBool(CFG_SECTION, CFG_USE_QUICKSELECT, useQuickSelect); settings.SetValue(CFG_SECTION, CFG_CACHE_TIMEOUT, ovsconf.CacheTimeout); settings.SetValue(CFG_SECTION, CFG_UTIL_TIMEOUT, ovsconf.UtilTimeout); settings.SetValue(CFG_SECTION, CFG_CATEGORYDISCOVERED_TIMEOUT, ovsconf.DynamicCategoryTimeout); settings.SetValue(CFG_SECTION, CFG_WMP_BUFFER, wmpbuffer); settings.SetValue(CFG_SECTION, CFG_PLAY_BUFFER, playbuffer); settings.SetValue(CFG_SECTION, CFG_UPDATEPERIOD, updatePeriod); if (FilterArray != null && FilterArray.Length > 0) { settings.SetValue(CFG_SECTION, CFG_FILTER, string.Join(",", FilterArray)); } if (!string.IsNullOrEmpty(ovsconf.DownloadDir)) { settings.SetValue(CFG_SECTION, CFG_DOWNLOAD_DIR, ovsconf.DownloadDir); } if (!string.IsNullOrEmpty(email)) { settings.SetValue(CFG_SECTION, CFG_EMAIL, email); } if (!string.IsNullOrEmpty(password)) { settings.SetValue(CFG_SECTION, CFG_PASSWORD, password); } if (updateOnStart == null) { settings.RemoveEntry(CFG_SECTION, CFG_UPDATEONSTART); } else { settings.SetValueAsBool(CFG_SECTION, CFG_UPDATEONSTART, updateOnStart.Value); } settings.SetValue(CFG_SECTION, CFG_SEARCHHISTORY_NUM, searchHistoryNum); settings.SetValue(CFG_SECTION, CFG_SEARCHHISTORYTYPE, (int)searchHistoryType); settings.SetValueAsBool(CFG_SECTION, CFG_AUTO_LANG_GROUPS, autoGroupByLang); settings.SetValueAsBool(CFG_SECTION, CFG_FAVORITES_FIRST, ovsconf.FavoritesFirst); settings.SetValueAsBool(CFG_SECTION, CFG_LATESTVIDEOS_RANDOMIZE, LatestVideosRandomize); settings.SetValue(CFG_SECTION, CFG_LATESTVIDEOS_MAXITEMS, LatestVideosMaxItems); settings.SetValue(CFG_SECTION, CFG_LATESTVIDEOS_ONLINEDATA_REFRESH, LatestVideosOnlineDataRefresh); settings.SetValue(CFG_SECTION, CFG_LATESTVIDEOS_GUIDATA_REFRESH, LatestVideosGuiDataRefresh); settings.SetValueAsBool(CFG_SECTION, CFG_ALLOW_REFRESHRATE_CHANGE, AllowRefreshRateChange); settings.SetValueAsBool(CFG_SECTION, CFG_STORE_LAYOUT_PER_CATEGORY, StoreLayoutPerCategory); SaveSitesGroups(); ovsconf.SaveSites(); settings.SetValue(CFG_SECTION, CFG_FILTER_V2_HTTP_PREFERRED_NETWORK_INTERFACE, ovsconf.HttpPreferredNetworkInterface); settings.SetValue(CFG_SECTION, CFG_FILTER_V2_HTTP_OPEN_CONNECTION_TIMEOUT, ovsconf.HttpOpenConnectionTimeout); settings.SetValue(CFG_SECTION, CFG_FILTER_V2_HTTP_OPEN_CONNECTION_SLEEP_TIME, ovsconf.HttpOpenConnectionSleepTime); settings.SetValue(CFG_SECTION, CFG_FILTER_V2_HTTP_TOTAL_REOPEN_CONNECTION_TIMEOUT, ovsconf.HttpTotalReopenConnectionTimeout); settings.SetValue(CFG_SECTION, CFG_FILTER_V2_RTMP_PREFERRED_NETWORK_INTERFACE, ovsconf.RtmpPreferredNetworkInterface); settings.SetValue(CFG_SECTION, CFG_FILTER_V2_RTMP_OPEN_CONNECTION_TIMEOUT, ovsconf.RtmpOpenConnectionTimeout); settings.SetValue(CFG_SECTION, CFG_FILTER_V2_RTMP_OPEN_CONNECTION_SLEEP_TIME, ovsconf.RtmpOpenConnectionSleepTime); settings.SetValue(CFG_SECTION, CFG_FILTER_V2_RTMP_TOTAL_REOPEN_CONNECTION_TIMEOUT, ovsconf.RtmpTotalReopenConnectionTimeout); settings.SetValue(CFG_SECTION, CFG_FILTER_V2_RTSP_PREFERRED_NETWORK_INTERFACE, ovsconf.RtspPreferredNetworkInterface); settings.SetValue(CFG_SECTION, CFG_FILTER_V2_RTSP_OPEN_CONNECTION_TIMEOUT, ovsconf.RtspOpenConnectionTimeout); settings.SetValue(CFG_SECTION, CFG_FILTER_V2_RTSP_OPEN_CONNECTION_SLEEP_TIME, ovsconf.RtspOpenConnectionSleepTime); settings.SetValue(CFG_SECTION, CFG_FILTER_V2_RTSP_TOTAL_REOPEN_CONNECTION_TIMEOUT, ovsconf.RtspTotalReopenConnectionTimeout); settings.SetValue(CFG_SECTION, CFG_FILTER_V2_RTSP_CLIENT_PORT_MIN, ovsconf.RtspClientPortMin); settings.SetValue(CFG_SECTION, CFG_FILTER_V2_RTSP_CLIENT_PORT_MAX, ovsconf.RtspClientPortMax); settings.SetValue(CFG_SECTION, CFG_FILTER_V2_UDPRTP_PREFERRED_NETWORK_INTERFACE, ovsconf.UdpRtpPreferredNetworkInterface); settings.SetValue(CFG_SECTION, CFG_FILTER_V2_UDPRTP_OPEN_CONNECTION_TIMEOUT, ovsconf.UdpRtpOpenConnectionTimeout); settings.SetValue(CFG_SECTION, CFG_FILTER_V2_UDPRTP_OPEN_CONNECTION_SLEEP_TIME, ovsconf.UdpRtpOpenConnectionSleepTime); settings.SetValue(CFG_SECTION, CFG_FILTER_V2_UDPRTP_TOTAL_REOPEN_CONNECTION_TIMEOUT, ovsconf.UdpRtpTotalReopenConnectionTimeout); settings.SetValue(CFG_SECTION, CFG_FILTER_V2_UDPRTP_RECEIVE_DATA_CHECK_INTERVAL, ovsconf.UdpRtpReceiveDataCheckInterval); } } } catch (Exception ex) { Log.Instance.Error(ex); } }
public override void SaveSettings() { using (Settings xmlwriter = new MPSettings()) { xmlwriter.SetValue("screenselector", "screennumber", cbScreen.SelectedIndex); var dataRowView = cbScreen.Items[cbScreen.SelectedIndex] as DataRowView; if (dataRowView != null) { xmlwriter.SetValue("screenselector", "screendeviceid", dataRowView["AdditionalInfo"].ToString()); xmlwriter.SetValue("screenselector", "screendisplayname", dataRowView["MonitorDisplayName"].ToString()); } for (int index = 0; index < _sectionEntries.Length; index++) { string[] currentSection = _sectionEntries[index]; xmlwriter.SetValueAsBool(currentSection[0], currentSection[1], settingsCheckedListBox.GetItemChecked(index)); } xmlwriter.SetValue("general", "delay", nudDelay.Value); xmlwriter.SetValueAsBool("general", "delay startup", mpCheckBoxMpStartup.Checked); xmlwriter.SetValueAsBool("general", "delay resume", mpCheckBoxMpResume.Checked); xmlwriter.SetValueAsBool("general", "wait for tvserver", cbWaitForTvService.Checked); xmlwriter.SetValueAsBool("general", "useprimaryscreen", _usePrimaryScreen); } try { if (settingsCheckedListBox.GetItemChecked(5)) // autostart on boot { string fileName = Config.GetFile(Config.Dir.Base, "MediaPortal.exe"); using ( RegistryKey subkey = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run", true) ) { if (subkey != null) { subkey.SetValue("MediaPortal", fileName); } } } else { using ( RegistryKey subkey = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run", true) ) { if (subkey != null) { subkey.DeleteValue("MediaPortal", false); } } } if (settingsCheckedListBox.GetItemChecked(3)) // always on top { using (RegistryKey subkey = Registry.CurrentUser.OpenSubKey(@"Control Panel\Desktop", true)) { if (subkey != null) { subkey.SetValue("ForegroundLockTimeout", 0); } } } IntPtr result; SendMessageTimeout((IntPtr)HWND_BROADCAST, (IntPtr)WM_SETTINGCHANGE, IntPtr.Zero, Marshal.StringToBSTR(string.Empty), (IntPtr)SMTO_ABORTIFHUNG, (IntPtr)3, out result); } catch (Exception ex) { Log.Error("General: Exception - {0}", ex); } }
private void okButton_Click(object sender, EventArgs e) { this.DialogResult = DialogResult.OK; using (Settings xmlwriter = new MPSettings()) { xmlwriter.SetValue("subtitles", "subPicsBufferAhead", subPicsAheadUpDown.Value); xmlwriter.SetValue("subtitles", "textureSize", textureComboBox.SelectedItem); xmlwriter.SetValue("subtitles", "adjustY", posYUpDown.Value); xmlwriter.SetValueAsBool("subtitles", "pow2tex", pow2texCheckBox.Checked); xmlwriter.SetValueAsBool("subtitles", "disableAnimation", disableAnimCheckBox.Checked); } this.Hide(); }
public override void SaveSettings() { using (Settings xmlwriter = new MPSettings()) { string prefLangs = ""; xmlwriter.SetValue("tvservice", "hostname", mpTextBoxHostname.Text); xmlwriter.SetValueAsBool("tvservice", "preferac3", mpCheckBoxPrefAC3.Checked); xmlwriter.SetValueAsBool("tvservice", "preferAudioTypeOverLang", mpCheckBoxPrefAudioOverLang.Checked); xmlwriter.SetValueAsBool("tvservice", "dvbbitmapsubtitles", mpCheckBoxEnableDVBSub.Checked); xmlwriter.SetValueAsBool("tvservice", "dvbttxtsubtitles", mpCheckBoxEnableTTXTSub.Checked); xmlwriter.SetValueAsBool("tvservice", "ccsubtitles", mpCheckBoxEnableCCSub.Checked); xmlwriter.SetValueAsBool("tvservice", "autoshowsubwhentvstarts", mpCheckBoxAutoShowSubWhenTvStarts.Checked); xmlwriter.SetValueAsBool("tvservice", "audiodualmono", enableAudioDualMonoModes.Checked); xmlwriter.SetValueAsBool("mytv", "hideAllChannelsGroup", cbHideAllChannels.Checked); xmlwriter.SetValueAsBool("myradio", "hideAllChannelsGroup", cbHideAllChannels.Checked); //currently we use the same checkbox for radio but different settings in config file xmlwriter.SetValueAsBool("mytv", "showChannelStateIcons", cbShowChannelStateIcons.Checked); xmlwriter.SetValueAsBool("mytv", "continuousScrollGuide", cbContinuousScrollGuide.Checked); xmlwriter.SetValueAsBool("mytv", "relaxTsReader", cbRelaxTsReader.Checked); xmlwriter.SetValueAsBool("tvservice", "isWakeOnLanEnabled", mpCheckBoxIsWakeOnLanEnabled.Checked); xmlwriter.SetValue("tvservice", "WOLTimeOut", mpNumericTextBoxWOLTimeOut.Text); xmlwriter.SetValueAsBool("tvservice", "isAutoMacAddressEnabled", mpCheckBoxIsAutoMacAddressEnabled.Checked); xmlwriter.SetValue("tvservice", "macAddress", mpTextBoxMacAddress.Text); xmlwriter.SetValueAsBool("mytv", "enableRecNotifier", chkRecnotifications.Checked); xmlwriter.SetValue("mytv", "notifyTVBefore", txtNotifyBefore.Text); xmlwriter.SetValue("mytv", "notifyTVTimeout", txtNotifyAfter.Text); xmlwriter.SetValueAsBool("mytv", "notifybeep", checkBoxNotifyPlaySound.Checked); xmlwriter.SetValue("mytv", "showEpisodeInfo", comboboxShowEpisodeInfo.SelectedIndex); foreach (ListViewItem item in mpListViewPreferredAudioLang.Items) { prefLangs += (string)item.Name + ";"; } xmlwriter.SetValue("tvservice", "preferredaudiolanguages", prefLangs); prefLangs = ""; foreach (ListViewItem item in mpListViewPreferredSubLang.Items) { prefLangs += (string)item.Name + ";"; } xmlwriter.SetValue("tvservice", "preferredsublanguages", prefLangs); //When TvServer is changed, if user changed mode (SingleSeat/MultiSeat), he needs to review the RTSP setting in DebugOptions section if ((xmlwriter.GetValueAsBool("tvservice", "DebugOptions", false) || SettingsForm.debug_options) && (_SingleSeat != Network.IsSingleSeat())) { MessageBox.Show("Please review your RTSP settings in \"DebugOptions\" section", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } }
private void SaveSettings() { using (Settings xmlwriter = new MPSettings()) { xmlwriter.SetValue("movieplayer", "mpeg2videocodec", _strVideoCodec); xmlwriter.SetValue("movieplayer", "h264videocodec", _strH264VideoCodec); xmlwriter.SetValue("movieplayer", "mpeg2audiocodec", _strAudioCodec); string aspectRatioText = Utils.GetAspectRatio(_aspectRatio); xmlwriter.SetValue("movieplayer", "defaultar", aspectRatioText); xmlwriter.SetValue("movieplayer", "audiorenderer", _strAudioRenderer); xmlwriter.SetValue("movieplayer", "aacaudiocodec", _strAACAudioCodec); xmlwriter.SetValue("movieplayer", "vc1videocodec", _strVC1VideoCodec); xmlwriter.SetValue("movieplayer", "vc1ivideocodec", _strVC1iVideoCodec); xmlwriter.SetValue("movieplayer", "xvidvideocodec", _strDivXVideoCodec); // Splitter xmlwriter.SetValue("movieplayer", "splitterfilter", _strSplitterFilter); xmlwriter.SetValue("movieplayer", "splitterfilefilter", _strSplitterFilesyncFilter); if (_info != null) { xmlwriter.SetValue("subtitles", "language", _info.Name); } if (_infoAudio != null) { xmlwriter.SetValue("movieplayer", "audiolanguage", _infoAudio.Name); } xmlwriter.SetValueAsBool("subtitles", "enabled", btnEnableSubtitles.Selected); xmlwriter.SetValue("movies", "playallinfolder", _playAll); } }
public void ShowPlugin() { using (Settings xmlwriter = new MPSettings()) { SetupForm setupForm = new SetupForm(); setupForm.ServerSettings = PluginMain.LoadServerSettings(); setupForm.NoClientStandbyWhenNotHome = PluginMain.NoClientStandbyWhenNotHome; setupForm.PreferRtspForLiveTv = PluginMain.PreferRtspForLiveTv; setupForm.PlayRecordingsOverRtsp = PluginMain.PlayRecordingsOverRtsp; setupForm.AutoStreamingMode = PluginMain.AutoStreamingMode; setupForm.DisableRadio = PluginMain.DisableRadio; if (setupForm.ShowDialog() == System.Windows.Forms.DialogResult.OK) { xmlwriter.SetValue(_settingSection, SettingName.Server, setupForm.ServerSettings.ServerName); xmlwriter.SetValue(_settingSection, SettingName.TcpPort, setupForm.ServerSettings.Port); xmlwriter.SetValue(_settingSection, SettingName.MacAddresses, setupForm.ServerSettings.WakeOnLan.MacAddresses); xmlwriter.SetValue(_settingSection, SettingName.IPAddress, setupForm.ServerSettings.WakeOnLan.IPAddress); xmlwriter.SetValueAsBool(_settingSection, SettingName.UseWakeOnLan, setupForm.ServerSettings.WakeOnLan.Enabled); xmlwriter.SetValue(_settingSection, SettingName.WakeOnLanTimeoutSeconds, setupForm.ServerSettings.WakeOnLan.TimeoutSeconds); xmlwriter.SetValueAsBool(_settingSection, SettingName.NoClientStandbyWhenNotHome, setupForm.NoClientStandbyWhenNotHome); xmlwriter.SetValueAsBool(_settingSection, SettingName.AvoidRtspForLiveTv, !setupForm.PreferRtspForLiveTv); xmlwriter.SetValueAsBool(_settingSection, SettingName.PlayRecordingsOverRtsp, setupForm.PlayRecordingsOverRtsp); xmlwriter.SetValueAsBool(_settingSection, SettingName.AutoStreamingMode, setupForm.AutoStreamingMode); xmlwriter.SetValueAsBool(_settingSection, SettingName.IsSingleSeat, setupForm.IsSingleSeat); xmlwriter.SetValueAsBool(_settingSection, SettingName.DisableRadio, setupForm.DisableRadio); PluginMain.ClearCachedBooleanSettings(); } } }
private void OnPowerSchedulerEvent(PowerSchedulerEventArgs args) { switch (args.EventType) { case PowerSchedulerEventType.Started: case PowerSchedulerEventType.Elapsed: IPowerScheduler ps = GlobalServiceProvider.Instance.Get <IPowerScheduler>(); if (ps == null) { return; } PowerSetting setting; bool enabled; using (Settings reader = new MPSettings()) { EPGWakeupConfig config = new EPGWakeupConfig(reader.GetValueAsString("psclientplugin", "RebootConfig", String.Empty)); if (args.EventType == PowerSchedulerEventType.Started) { // Get time of last reboot if (config.LastRun == DateTime.MinValue) { config.LastRun = DateTime.Now; } else { config.LastRun = DateTime.Now.AddMilliseconds(-Environment.TickCount); } // Save last reboot status reader.SetValue("psclientplugin", "RebootConfig", config.SerializeAsString()); Log.Debug("RebootHandler: Set time of last reboot: {0}", config.LastRun); } // Check if system should wakeup for reboot setting = ps.Settings.GetSetting("RebootWakeup"); enabled = reader.GetValueAsBool("psclientplugin", "RebootWakeup", false); if (setting.Get <bool>() != enabled) { setting.Set <bool>(enabled); if (enabled) { if (ps.IsRegistered(this as IWakeupHandler)) { ps.Unregister(this as IWakeupHandler); } ps.Register(this as IWakeupHandler); } else { ps.Unregister(this as IWakeupHandler); } Log.Debug("RebootHandler: Wakeup system for reboot: {0}", enabled ? "enabled" : "disabled"); } // Check if a reboot time is set setting = ps.Settings.GetSetting("RebootConfig"); if (!config.Equals(setting.Get <EPGWakeupConfig>())) { setting.Set <EPGWakeupConfig>(config); Log.Debug("RebootHandler: Reboot system at {0:00}:{1:00}", config.Hour, config.Minutes); if (config.Days != null) { String days = ""; foreach (EPGGrabDays day in config.Days) { if (days == "") { days = day.ToString(); } else { days = days + ", " + day.ToString(); } } Log.Debug("RebootHandler: Reboot system on: {0}", days); } } if (args.EventType == PowerSchedulerEventType.Elapsed) { // Check if reboot is due if (ShouldRunNow()) { // See if system is idle bool unattended, disAllowShutdown; String disAllowShutdownHandler, nextWakeupHandler; DateTime nextWakeupTime; // Reboot only if all other handlers allow standby ps.GetCurrentState(false, out unattended, out disAllowShutdown, out disAllowShutdownHandler, out nextWakeupTime, out nextWakeupHandler); if (!disAllowShutdown) { // Kick off reboot thread Log.Debug("RebootHandler: Reboot is due - reboot now"); Thread workerThread = new Thread(new ThreadStart(RebootThread)); workerThread.Name = "RebootHandler"; workerThread.IsBackground = true; workerThread.Priority = ThreadPriority.Lowest; workerThread.Start(); } else { Log.Debug("RebootHandler: Reboot is due - reboot when standby is allowed"); } } } break; } } }
/// <summary> /// Saves movie player settings and codec info. /// </summary> public override void SaveSettings() { if (_init == false) { return; } using (Settings xmlwriter = new MPSettings()) { xmlwriter.SetValue("bdplayer", "audiorenderer", audioRendererComboBox.Text); // Set codecs xmlwriter.SetValue("bdplayer", "mpeg2audiocodec", audioCodecComboBox.Text); xmlwriter.SetValue("bdplayer", "mpeg2videocodec", videoCodecComboBox.Text); xmlwriter.SetValue("bdplayer", "h264videocodec", h264videoCodecComboBox.Text); xmlwriter.SetValue("bdplayer", "vc1videocodec", vc1videoCodecComboBox.Text); } }
public override void SaveSettings() { using (Settings xmlwriter = new MPSettings()) { // Save Debug Level xmlwriter.SetValue("screenselector", "screennumber", cbScreen.SelectedIndex); for (int index = 0; index < sectionEntries.Length; index++) { string[] currentSection = sectionEntries[index]; xmlwriter.SetValueAsBool(currentSection[0], currentSection[1], settingsCheckedListBox.GetItemChecked(index)); } xmlwriter.SetValue("general", "delay", nudDelay.Value); xmlwriter.SetValueAsBool("general", "delay startup", mpCheckBoxMpStartup.Checked); xmlwriter.SetValueAsBool("general", "delay resume", mpCheckBoxMpResume.Checked); xmlwriter.SetValueAsBool("general", "wait for tvserver", cbWaitForTvService.Checked); } try { if (settingsCheckedListBox.GetItemChecked(4)) // autostart on boot { string fileName = Config.GetFile(Config.Dir.Base, "MediaPortal.exe"); using ( RegistryKey subkey = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run", true) ) { subkey.SetValue("MediaPortal", fileName); } } else { using ( RegistryKey subkey = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run", true) ) { subkey.DeleteValue("MediaPortal", false); } } //Int32 iValue = 1; //if (settingsCheckedListBox.GetItemChecked(13)) // disable ballon tips //{ // iValue = 0; //} //using (RegistryKey subkey = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer", true)) //{ // subkey.SetValue("EnableBalloonTips", iValue); //} if (settingsCheckedListBox.GetItemChecked(2)) // always on top { using (RegistryKey subkey = Registry.CurrentUser.OpenSubKey(@"Control Panel\Desktop", true)) { subkey.SetValue("ForegroundLockTimeout", 0); } } IntPtr result = IntPtr.Zero; SendMessageTimeout((IntPtr)HWND_BROADCAST, (IntPtr)WM_SETTINGCHANGE, IntPtr.Zero, Marshal.StringToBSTR(string.Empty), (IntPtr)SMTO_ABORTIFHUNG, (IntPtr)3, out result); } catch (Exception ex) { Log.Error("General: Exception - {0}", ex); } }
private void SaveSettings() { using (Settings xmlwriter = new MPSettings()) { xmlwriter.SetValueAsBool("general", "autochangerefreshrate", btnEnableDynamicRefreshRate.Selected); xmlwriter.SetValueAsBool("general", "notify_on_refreshrate", btnNotify.Selected); xmlwriter.SetValueAsBool("general", "use_default_hz", btnUseDefaultRefreshRate.Selected); xmlwriter.SetValueAsBool("general", "devicereset", btnUseDeviceReset.Selected); xmlwriter.SetValueAsBool("general", "force_refresh_rate", btnForceRefreshRateChange.Selected); if (_defaultHzIndex >= 0) { string rate = RefreshRateData(lcRefreshRatesList.ListItems[_defaultHzIndex]).Refreshrate; xmlwriter.SetValue("general", "default_hz", rate); } else { xmlwriter.SetValue("general", "default_hz", string.Empty); } //delete all refreshrate entries, then re-add them. Settings xmlreader = new MPSettings(); for (int i = 1; i < 100; i++) { string name = xmlreader.GetValueAsString("general", "refreshrate0" + Convert.ToString(i) + "_name", ""); if (string.IsNullOrEmpty(name)) { continue; } xmlwriter.RemoveEntry("general", name + "_fps"); xmlwriter.RemoveEntry("general", name + "_hz"); xmlwriter.RemoveEntry("general", "refreshrate0" + Convert.ToString(i) + "_ext"); xmlwriter.RemoveEntry("general", "refreshrate0" + Convert.ToString(i) + "_name"); } int j = 1; foreach (GUIListItem item in lcRefreshRatesList.ListItems) { string name = RefreshRateData(item).Name; string fps = RefreshRateData(item).FrameRate; string hz = RefreshRateData(item).Refreshrate; string extCmd = RefreshRateData(item).Action; xmlwriter.SetValue("general", name + "_fps", fps); xmlwriter.SetValue("general", name + "_hz", hz); xmlwriter.SetValue("general", "refreshrate0" + Convert.ToString(j) + "_ext", extCmd); xmlwriter.SetValue("general", "refreshrate0" + Convert.ToString(j) + "_name", name); j++; } } }
public override void SaveSettings() { using (Settings xmlwriter = new MPSettings()) { xmlwriter.SetValue("SerialUIR", "internal", inputCheckBox.Checked ? "true" : "false"); xmlwriter.SetValue("SerialUIR", "baudrate", BaudRateCombo.Text); xmlwriter.SetValue("SerialUIR", "handshake", HandShakeCombo.Text); xmlwriter.SetValue("SerialUIR", "parity", ParityCombo.Text); xmlwriter.SetValue("SerialUIR", "irbytes", IRLengthCombo.Text); xmlwriter.SetValue("SerialUIR", "uirirmaninit", checkBoxInitUIRIrman.Checked ? "true" : "false"); xmlwriter.SetValue("SerialUIR", "rts", checkBoxRTS.Checked ? "true" : "false"); xmlwriter.SetValue("SerialUIR", "dtr", checkBoxDTR.Checked ? "true" : "false"); xmlwriter.SetValue("SerialUIR", "commport", CommPortCombo.Text); xmlwriter.SetValue("SerialUIR", "delay", CommandDelayCombo.Text); xmlwriter.SetValue("SerialUIR", "timeout", LearningTimeoutCombo.Text); for (int i = 0; i < ActionsCheckList.Items.Count; i++) { xmlwriter.SetValue("SerialUIR", "learn" + i.ToString(), ActionsCheckList.GetItemChecked(i) ? "true" : "false"); } } }
private void CheckModeHintDisplay(int aHintShowCount) { switch (aHintShowCount) { case 0: aHintShowCount = ShowConfigModeHint() ? 1 : 0; break; default: aHintShowCount++; break; } using (Settings xmlwriter = new MPSettings()) { xmlwriter.SetValue("general", "ConfigModeHintCount", aHintShowCount); } }
public void SaveSettings() { using (Settings writer = new MPSettings()) { writer.SetValueAsBool("Auto3DPlugin", "TV", checkBoxTV.Checked); writer.SetValueAsBool("Auto3DPlugin", "Video", checkBoxVideo.Checked); writer.SetValue("Auto3DPlugin", "ActiveDevice", comboBoxModel.SelectedItem.ToString()); writer.SetValueAsBool("Auto3DPlugin", "3DMenuAlways", checkBoxSelectionAlways.Checked); writer.SetValueAsBool("Auto3DPlugin", "CheckNameSimple", checkBoxName3DSimple.Checked); writer.SetValueAsBool("Auto3DPlugin", "CheckNameFull", checkBoxName3DFull.Checked); writer.SetValueAsBool("Auto3DPlugin", "CheckNameFormatSBS", radioButtonSBS.Checked); writer.SetValueAsBool("Auto3DPlugin", "SideBySide", checkBoxSBS.Checked); writer.SetValueAsBool("Auto3DPlugin", "TopAndBottom", checkBoxTopDown.Checked); writer.SetValueAsBool("Auto3DPlugin", "AnalyzeNetworkStream", checkBoxAnalyzeNetworkStream.Checked); writer.SetValueAsBool("Auto3DPlugin", "3DMenuOnKey", checkBoxSelectionOnKey.Checked); writer.SetValue("Auto3DPlugin", "3DMenuKey", textBoxMenuHotkey.Text); writer.SetValueAsBool("Auto3DPlugin", "EventGhostEvents", checkBoxEventGhost.Checked); writer.SetValueAsBool("Auto3DPlugin", "ShowMessageOnModeChange", checkBoxModeSwitchMessage.Checked); writer.SetValueAsBool("Auto3DPlugin", "SupressSwitchBackTo2D", checkBoxSupressSwitchBackTo2D.Checked); writer.SetValueAsBool("Auto3DPlugin", "Convert3DTo2D", checkBoxConvert3Dto2D.Checked); writer.SetValueAsBool("Auto3DPlugin", "3DSubtitles", checkBox3DSubTitles.Checked); writer.SetValue("Auto3DPlugin", "SubtitleDepth", trackBarDepth3D.Value); writer.SetValue("Auto3DPlugin", "SwitchSBSLabels", textBoxSBS.Text); writer.SetValue("Auto3DPlugin", "SwitchSBSRLabels", textBoxSBSR.Text); writer.SetValue("Auto3DPlugin", "SwitchTABLabels", textBoxTAB.Text); writer.SetValue("Auto3DPlugin", "SwitchTABRLabels", textBoxTABR.Text); writer.SetValueAsBool("Auto3DPlugin", "LogOnlyKnownDevices", checkBoxLogKnown.Checked); writer.SetValueAsBool("Auto3DPlugin", "StretchSubtitles", checkBoxPreRendered.Checked); if (checkBoxTurnOffDevice.Enabled) { writer.SetValueAsBool("Auto3DPlugin", "TurnDeviceOff", checkBoxTurnOffDevice.Checked); if (radioButtonIpOff.Checked) { writer.SetValue("Auto3DPlugin", "TurnDeviceOffVia", 1); } if (radioButtonIrOff.Checked) { writer.SetValue("Auto3DPlugin", "TurnDeviceOffVia", 2); } writer.SetValue("Auto3DPlugin", "TurnDeviceOffWhen", comboBoxTurnOffDevice.SelectedIndex); } writer.SetValueAsBool("Auto3DPlugin", "TurnDeviceOn", checkBoxTurnOnDevice.Checked); if (radioButtonIpOn.Checked) { writer.SetValue("Auto3DPlugin", "TurnDeviceOnVia", 1); } if (radioButtonIrOn.Checked) { writer.SetValue("Auto3DPlugin", "TurnDeviceOnVia", 2); } writer.SetValue("Auto3DPlugin", "TurnDeviceOnWhen", comboBoxTurnOnDevice.SelectedIndex); writer.SetValueAsBool("Auto3DPlugin", "ConvertTo3D", checkBoxConvertTo3D.Checked); writer.SetValue("Auto3DPlugin", "SkewFactor", trackBarSkewFactor.Value); } foreach (IAuto3D item in comboBoxModel.Items) { IAuto3DSetup setup = (IAuto3DSetup)item.GetSetupControl(); setup.SaveSettings(); } }