public void Save() { SaveEncryptedPassword(); using (var xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { xmlwriter.SetValueAsBool("radiotime", "mp3", Mp3); xmlwriter.SetValueAsBool("radiotime", "wma", Wma); xmlwriter.SetValueAsBool("radiotime", "real", Real); xmlwriter.SetValueAsBool("radiotime", "UseVideo", UseVideo); xmlwriter.SetValueAsBool("radiotime", "JumpNowPlaying", JumpNowPlaying); xmlwriter.SetValue("radiotime", "user", User); xmlwriter.SetValueAsBool("radiotime", "showpresets", ShowPresets); xmlwriter.SetValue("radiotime", "pluginname", PluginName); xmlwriter.SetValue("radiotime", "FolderId", FolderId); xmlwriter.SetValueAsBool("radiotime", "StartWithFastPreset", StartWithFastPreset); var s = ""; foreach (var history in SearchHistory) { s += history + "|"; } xmlwriter.SetValue("radiotime", "searchHistory", s); s = ""; foreach (var history in ArtistSearchHistory) { s += history + "|"; } xmlwriter.SetValue("radiotime", "artistSearchHistory", s); } }
public MyLyricsSetup_SearchTitleDialog(MyLyricsSetup_LyricsLibrary form, string artist, string title, bool markedDatabase) { InitializeComponent(); this.parent = form; this.markedDatabase = markedDatabase; // initialize delegates m_DelegateStringUpdate = new DelegateStringUpdate(this.updateStringMethod); m_DelegateStatusUpdate = new DelegateStatusUpdate(this.updateStatusMethod); m_DelegateLyricFound = new DelegateLyricFound(this.lyricFoundMethod); m_DelegateLyricNotFound = new DelegateLyricNotFound(this.lyricNotFoundMethod); m_DelegateThreadFinished = new DelegateThreadFinished(this.ThreadFinishedMethod); m_DelegateThreadException = new DelegateThreadException(this.ThreadExceptionMethod); // initialize events m_EventStopThread = new ManualResetEvent(false); tbArtist.Text = artist; tbTitle.Text = title; originalArtist = artist; originalTitle = title; using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings("MediaPortal.xml")) { cbLyricWiki.Checked = ((string)xmlreader.GetValueAsString("myLyrics", "useLyricWiki", "True")).ToString().Equals("True") ? true : false; cbEvilLabs.Checked = ((string)xmlreader.GetValueAsString("myLyrics", "useEvilLabs", "True")).ToString().Equals("True") ? true : false; cbLyrics007.Checked = ((string)xmlreader.GetValueAsString("myLyrics", "useLyrics007", "True")).ToString().Equals("True") ? true : false; cbLyricsOnDemand.Checked = ((string)xmlreader.GetValueAsString("myLyrics", "useLyricsOnDemand", "True")).ToString().Equals("True") ? true : false; cbSeekLyrics.Checked = ((string)xmlreader.GetValueAsString("myLyrics", "useSeekLyrics", "True")).ToString().Equals("True") ? true : false; cbHotLyrics.Checked = ((string)xmlreader.GetValueAsString("myLyrics", "useHotLyrics", "True")).ToString().Equals("True") ? true : false; automaticFetch = xmlreader.GetValueAsBool("myLyrics", "automaticFetch", true); automaticUpdate = xmlreader.GetValueAsBool("myLyrics", "automaticUpdateWhenFirstFound", false); moveLyricFromMarkedDatabase = xmlreader.GetValueAsBool("myLyrics", "moveLyricFromMarkedDatabase", true); } this.Show(); if (artist.Length != 0 && title.Length != 0) { if (automaticFetch) { fetchLyric(originalArtist, originalTitle); lvSearchResults.Focus(); } else { btFind.Focus(); } } else if (artist.Length != 0) { tbTitle.Focus(); } else { tbArtist.Focus(); } }
/// <summary> /// Save the current playlist to file /// </summary> /// <param name="name">Name of new playlist</param> internal static void SaveCurrentPlaylist(string name) { try { using (MediaPortal.Profile.Settings reader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { string playlistFolder = reader.GetValueAsString("music", "playlists", ""); if (!Path.IsPathRooted(playlistFolder)) { playlistFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), playlistFolder); } PlayListPlayer playListPlayer = PlayListPlayer.SingletonPlayer; PlayList playList = playListPlayer.GetPlaylist(playListPlayer.CurrentPlaylistType); String fileName = Path.Combine(playlistFolder, name + ".m3u"); PlayListM3uIO m3uPlayList = new PlayListM3uIO(); m3uPlayList.Save(playList, fileName); } } catch (Exception ex) { WifiRemote.LogMessage("Error saving playlist: " + ex.ToString(), WifiRemote.LogType.Warn); } }
private void displayDeviceSettings() { using (var xmlReader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { egPath_textBox.Text = xmlReader.GetValueAsString(EventGhostPlus.PLUGIN_NAME, "egPath", ""); egPart2_comboBox.Text = xmlReader.GetValueAsString(EventGhostPlus.PLUGIN_NAME, "egPart2", "Type"); egPart3_comboBox.Text = xmlReader.GetValueAsString(EventGhostPlus.PLUGIN_NAME, "egPart3", "Status"); egPayload_checkBox.Checked = xmlReader.GetValueAsBool(EventGhostPlus.PLUGIN_NAME, "egPayload", false); WindowChange_checkBox.Checked = xmlReader.GetValueAsBool(EventGhostPlus.PLUGIN_NAME, "WindowChange", true); mediaDuration_textBox.Text = (xmlReader.GetValueAsInt(EventGhostPlus.PLUGIN_NAME, "setLevelForMediaDuration", 10)).ToString(); tcpip_radioButton.Checked = xmlReader.GetValueAsBool(EventGhostPlus.PLUGIN_NAME, "tcpipIsEnabled", false); host_textBox.Text = xmlReader.GetValueAsString(EventGhostPlus.PLUGIN_NAME, "tcpipHost", ""); port_textBox.Text = xmlReader.GetValueAsString(EventGhostPlus.PLUGIN_NAME, "tcpipPort", "1024"); PWDEncrypted = xmlReader.GetValueAsBool(EventGhostPlus.PLUGIN_NAME, "PWDEncrypted", false); if (PWDEncrypted) password_textBox.Text = DPAPI.DecryptString(xmlReader.GetValueAsString(EventGhostPlus.PLUGIN_NAME, "tcpipPassword", "")); else password_textBox.Text = xmlReader.GetValueAsString(EventGhostPlus.PLUGIN_NAME, "tcpipPassword", ""); rcvport_textBox.Text = xmlReader.GetValueAsString(EventGhostPlus.PLUGIN_NAME, "ReceivePort", "1023"); rcvpassword_textBox.Text = DPAPI.DecryptString(xmlReader.GetValueAsString(EventGhostPlus.PLUGIN_NAME, "ReceivePassword", "")); debug_checkBox.Checked = xmlReader.GetValueAsBool(EventGhostPlus.PLUGIN_NAME, "DebugMode", false); } tcpipStatusEnabler(); }
public void Save() { using (var xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { xmlwriter.SetValue("youtubevideos", "PluginName", this.PluginName); xmlwriter.SetValue("youtubevideos", "Region", this.Region); xmlwriter.SetValue("youtubevideos", "InitialDisplay", this.InitialDisplay); xmlwriter.SetValue("youtubevideos", "user", User); xmlwriter.SetValue("youtubevideos", "password", Password); xmlwriter.SetValue("youtubevideos", "InitialCat", this.InitialCat); xmlwriter.SetValue("youtubevideos", "InitialSearch", this.InitialSearch); xmlwriter.SetValue("youtubevideos", "VideoQuality", this.VideoQuality); xmlwriter.SetValue("youtubevideos", "InstantAction", (int)this.InstantAction); xmlwriter.SetValue("youtubevideos", "InstantCharInt", this.InstantChar); xmlwriter.SetValue("youtubevideos", "DownloadFolder", this.DownloadFolder); xmlwriter.SetValue("youtubevideos", "FanartFolder", this.FanartDir); xmlwriter.SetValueAsBool("youtubevideos", "MusicFilter", this.MusicFilter); xmlwriter.SetValueAsBool("youtubevideos", "time", this.Time); xmlwriter.SetValueAsBool("youtubevideos", "ShowNowPlaying", this.ShowNowPlaying); xmlwriter.SetValueAsBool("youtubevideos", "UseYouTubePlayer", this.UseYouTubePlayer); xmlwriter.SetValueAsBool("youtubevideos", "UseExtremFilter", this.UseExtremFilter); xmlwriter.SetValueAsBool("youtubevideos", "UseSMSStyleKeyBoard", this.UseSMSStyleKeyBoard); xmlwriter.SetValueAsBool("youtubevideos", "LoadOnlineFanart", this.LoadOnlineFanart); string his = ""; foreach (string s in SearchHistory) { his += s + "|"; } xmlwriter.SetValue("youtubevideos", "searchhistory", his); } this.LocalFile.Save(); }
/// <summary> /// Adds a section of MP shares /// </summary> /// <param name="section">Name of the section</param> private void AddSection(String section) { Share defaultshare = null; using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { string strDefault = xmlreader.GetValueAsString(section, "default", String.Empty); for (int i = 0; i < 20; i++) { string strShareName = String.Format("sharename{0}", i); string strSharePath = String.Format("sharepath{0}", i); string strPincode = String.Format("pincode{0}", i); string shareType = String.Format("sharetype{0}", i); string shareServer = String.Format("shareserver{0}", i); string shareLogin = String.Format("sharelogin{0}", i); string sharePwd = String.Format("sharepassword{0}", i); string sharePort = String.Format("shareport{0}", i); string remoteFolder = String.Format("shareremotepath{0}", i); string shareViewPath = String.Format("shareview{0}", i); Share share = new Share { Name = xmlreader.GetValueAsString(section, strShareName, String.Empty), Path = xmlreader.GetValueAsString(section, strSharePath, String.Empty) }; share.Pincode = Utils.DecryptPin(xmlreader.GetValueAsString(section, strPincode, string.Empty)); share.IsFtpShare = xmlreader.GetValueAsBool(section, shareType, false); share.FtpServer = xmlreader.GetValueAsString(section, shareServer, String.Empty); share.FtpLoginName = xmlreader.GetValueAsString(section, shareLogin, String.Empty); share.FtpPassword = xmlreader.GetValueAsString(section, sharePwd, String.Empty); share.FtpPort = xmlreader.GetValueAsInt(section, sharePort, 21); share.FtpFolder = xmlreader.GetValueAsString(section, remoteFolder, "/"); share.DefaultLayout = (GUIFacadeControl.Layout)xmlreader.GetValueAsInt(section, shareViewPath, (int)GUIFacadeControl.Layout.List); if (share.Name.Length > 0) { if (strDefault == share.Name) { share.Default = true; if (defaultshare == null) { defaultshare = share; } } if (!_sharePaths.Contains(share.Path.ToLower())) { _sharePaths.Add(share.Path.ToLower()); _mDirectory.Add(share); } } else { break; } } } }
public void Load() { using (var xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { this.PluginName = xmlreader.GetValueAsString("youtubevideos", "PluginName", "YouTube.fm"); this.Region = xmlreader.GetValueAsString("youtubevideos", "Region", "Ask"); this.InitialDisplay = xmlreader.GetValueAsInt("youtubevideos", "InitialDisplay", 3); this.User = xmlreader.GetValueAsString("youtubevideos", "user", string.Empty); this.Password = xmlreader.GetValueAsString("youtubevideos", "password", string.Empty); this.InitialCat = xmlreader.GetValueAsInt("youtubevideos", "InitialCat", 1); this.VideoQuality = xmlreader.GetValueAsInt("youtubevideos", "VideoQuality", 0); this.InstantAction = (Action.ActionType)xmlreader.GetValueAsInt("youtubevideos", "InstantAction", (int)(Action.ActionType.REMOTE_1)); this.InitialSearch = xmlreader.GetValueAsString("youtubevideos", "InitialSearch", string.Empty); this.InstantChar = xmlreader.GetValueAsInt("youtubevideos", "InstantCharInt", 01); this.MusicFilter = xmlreader.GetValueAsBool("youtubevideos", "MusicFilter", true); this.UseSMSStyleKeyBoard = xmlreader.GetValueAsBool("youtubevideos", "UseSMSStyleKeyBoard", true); string his = xmlreader.GetValueAsString("youtubevideos", "searchhistory", string.Empty); this.Time = xmlreader.GetValueAsBool("youtubevideos", "time", false); this.ShowNowPlaying = xmlreader.GetValueAsBool("youtubevideos", "ShowNowPlaying", true); this.UseYouTubePlayer = xmlreader.GetValueAsBool("youtubevideos", "UseYouTubePlayer", false); this.UseExtremFilter = xmlreader.GetValueAsBool("youtubevideos", "UseExtremFilter", false); this.LoadOnlineFanart = xmlreader.GetValueAsBool("youtubevideos", "LoadOnlineFanart", true); this.FanartDir = xmlreader.GetValueAsString("youtubevideos", "FanartFolder", string.Empty); this.DownloadFolder = xmlreader.GetValueAsString("youtubevideos", "DownloadFolder", Environment.GetFolderPath(System.Environment.SpecialFolder.MyDocuments) + "\\My Videos"); foreach (string s in his.Split('|')) { if (!string.IsNullOrEmpty(s.Trim())) { SearchHistory.Add(s); } } } this.LocalFile.Load(); }
private bool GetBooleanSetting(ref MediaPortal.Profile.Settings xmlreader, string settingName, bool defaultValue) { string val = ""; val = xmlreader.GetValueAsString("Anime3", settingName, defaultValue ? "1" : "0"); return(val == "0" ? false : true); }
/// <summary> /// Loads the configuration with the shares /// </summary> public void LoadConfiguration() { try { XmlDocument doc = new XmlDocument(); string path = Config.GetFile(Config.Dir.Config, "MPlayer_GUIPlugin.xml"); doc.Load(path); if (doc.DocumentElement != null) { XmlNodeList listShare = doc.DocumentElement.SelectNodes("/mplayergui/Share"); if (listShare != null) foreach (XmlNode nodeShare in listShare) { MPlayerShare share = new MPlayerShare { Name = nodeShare.Attributes["name"].Value, Path = nodeShare.Attributes["path"].Value }; shareList.Items.Add(share); } } using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { pluginName.Text = xmlreader.GetValueAsString("mplayer", "displayNameOfGUI", "My MPlayer GUI"); myVideoShare.Checked = xmlreader.GetValueAsBool("mplayer", "useMyVideoShares", true); myMusicShare.Checked = xmlreader.GetValueAsBool("mplayer", "useMyMusicShares", true); playlistFolder.Checked = xmlreader.GetValueAsBool("mplayer", "treatPlaylistAsFolders", false); dvdNavCheckbox.Checked = xmlreader.GetValueAsBool("mplayer", "useDVDNAV", false); } } catch (Exception e) { Log.Info("MPlayer GUI Error: Configuration could not be loaded: " + e.Message); } }
public static void LoadSettings() { AutoSearch = true; ApproveIfOne = false; ApproveForNearest = false; NearestFactor = 20; try { logger.Debug("Load settings from: " + ConfigFilename); #region Load settings using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, ConfigFilename))) { AutoSearch = xmlreader.GetValueAsBool("Fetcher", "AutoSearch", AutoSearch); ApproveIfOne = xmlreader.GetValueAsBool("Fetcher", "ApproveIfOne", ApproveIfOne); ApproveForNearest = xmlreader.GetValueAsBool("Fetcher", "ApproveForNearest", ApproveForNearest); NearestFactor = xmlreader.GetValueAsInt("Fetcher", "NearestFactor", NearestFactor); } #endregion logger.Debug("Load settings from: " + ConfigFilename + " complete."); } catch (Exception ex) { logger.Error("LoadSettings: " + ex); } #region Report Settings logger.Debug("Importer: " + Check(ApproveIfOne) + " If one, " + Check(ApproveForNearest) + " Nearest <= " + NearestFactor); #endregion }
public void SaveSettings() { logger.Info("Saving Settings"); logger.Debug("Settings File: " + GetFileFullPath()); try { using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(GetFileFullPath(), false)) { // loop through each property in the class foreach (PropertyInfo currProperty in GetType().GetProperties()) { foreach (object currAttr in currProperty.GetCustomAttributes(true)) { if (currAttr.GetType() == typeof(SettingAttribute)) { // we have found a property with the SettingAttribute applied if (currProperty.PropertyType == typeof(string)) { object value = currProperty.GetGetMethod().Invoke(this, new object[] { }); xmlwriter.SetValue(Namespace, currProperty.Name, value); } break; } } } } } catch (Exception) { } }
/// <summary> /// Stores the configuration of this section /// </summary> public void SaveConfiguration() { using (MediaPortal.Profile.Settings xmlWriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { xmlWriter.SetValue("mplayer", "subtitleFontName", subtitleFont.SelectedItem.ToString()); xmlWriter.SetValueAsBool("mplayer", "enableSubtitles", subtitles.Checked); xmlWriter.SetValue("mplayer", "subtitleDelayStep", subtitleDelayStep.Value); xmlWriter.SetValue("mplayer", "subtitleSize", subtitleSize.Value); xmlWriter.SetValue("mplayer", "subtitlePosition", subtitlePosition.Value); } }
/// <summary> /// Stores the configuration of this section /// </summary> public void SaveConfiguration() { using (MediaPortal.Profile.Settings xmlWriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { xmlWriter.SetValue("mplayer", "subtitleFontName", subtitleFont.SelectedItem.ToString()); xmlWriter.SetValueAsBool("mplayer", "enableSubtitles", subtitles.Checked); xmlWriter.SetValue("mplayer", "subtitleDelayStep", subtitleDelayStep.Value); xmlWriter.SetValue("mplayer", "subtitleSize", subtitleSize.Value); xmlWriter.SetValue("mplayer", "subtitlePosition", subtitlePosition.Value); } }
/// <summary> /// Loads the configuration of this section /// </summary> public void LoadConfiguration() { using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { string subtitleFontName = xmlreader.GetValueAsString("mplayer", "subtitleFontName", "Arial"); subtitleFont.SelectedItem = subtitleFontName; subtitles.Checked = xmlreader.GetValueAsBool("mplayer", "enableSubtitles", false); subtitleDelayStep.Value = xmlreader.GetValueAsInt("mplayer", "subtitleDelayStep", 100); subtitlePosition.Value = xmlreader.GetValueAsInt("mplayer", "subtitlePosition", 100); subtitleSize.Value = xmlreader.GetValueAsInt("mplayer", "subtitleSize", 5); } }
/// <summary> /// Loads the configuration of this section /// </summary> public void LoadConfiguration() { using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { string subtitleFontName = xmlreader.GetValueAsString("mplayer", "subtitleFontName", "Arial"); subtitleFont.SelectedItem = subtitleFontName; subtitles.Checked = xmlreader.GetValueAsBool("mplayer", "enableSubtitles", false); subtitleDelayStep.Value = xmlreader.GetValueAsInt("mplayer", "subtitleDelayStep", 100); subtitlePosition.Value = xmlreader.GetValueAsInt("mplayer", "subtitlePosition", 100); subtitleSize.Value = xmlreader.GetValueAsInt("mplayer", "subtitleSize", 5); } }
/// <summary> /// Loads the configuration of this section /// </summary> public void LoadConfiguration() { using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { soundOutputDriver.SelectedIndex = xmlreader.GetValueAsInt("mplayer", "soundOutputDriver", (int)SoundOutputDriver.DirectSound); soundOutputDevice.SelectedIndex = xmlreader.GetValueAsInt("mplayer", "soundOutputDevice", 0); audioChannels.SelectedIndex = xmlreader.GetValueAsInt("mplayer", "audioChannels", (int)AudioChannels.Default); audioDelayStep.Value = xmlreader.GetValueAsInt("mplayer", "audioDelayStep", 100); passthroughAC3_DTS.Checked = xmlreader.GetValueAsBool("mplayer", "passthroughAC3DTS", false); audioNormalize.Checked = xmlreader.GetValueAsBool("mplayer", "audioNormalize", false); } }
/// <summary> /// Stores the configuration of this section /// </summary> public void SaveConfiguration() { using (MediaPortal.Profile.Settings xmlWriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { xmlWriter.SetValue("mplayer", "soundOutputDriver", soundOutputDriver.SelectedIndex); xmlWriter.SetValue("mplayer", "soundOutputDevice", soundOutputDevice.SelectedIndex); xmlWriter.SetValue("mplayer", "audioChannels", audioChannels.SelectedIndex); xmlWriter.SetValue("mplayer", "audioDelayStep", audioDelayStep.Value); xmlWriter.SetValueAsBool("mplayer", "passthroughAC3DTS", passthroughAC3_DTS.Checked); xmlWriter.SetValueAsBool("mplayer", "audioNormalize", audioNormalize.Checked); } }
private void SaveEncryptedPassword() { if (!string.IsNullOrEmpty(Password)) { using (var xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { xmlwriter.SetValue("radiotime", "encryptedPassword", PasswordUtility.EncryptData(Password, DataProtectionScope.LocalMachine)); xmlwriter.RemoveEntry("radiotime", "password"); } } }
/// <summary> /// Stores the configuration of this section /// </summary> public void SaveConfiguration() { using (MediaPortal.Profile.Settings xmlWriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { xmlWriter.SetValue("mplayer", "soundOutputDriver", soundOutputDriver.SelectedIndex); xmlWriter.SetValue("mplayer", "soundOutputDevice", soundOutputDevice.SelectedIndex); xmlWriter.SetValue("mplayer", "audioChannels", audioChannels.SelectedIndex); xmlWriter.SetValue("mplayer", "audioDelayStep", audioDelayStep.Value); xmlWriter.SetValueAsBool("mplayer", "passthroughAC3DTS", passthroughAC3_DTS.Checked); xmlWriter.SetValueAsBool("mplayer", "audioNormalize", audioNormalize.Checked); } }
/// <summary> /// Loads the configuration of this section /// </summary> public void LoadConfiguration() { using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { soundOutputDriver.SelectedIndex = xmlreader.GetValueAsInt("mplayer", "soundOutputDriver", (int)SoundOutputDriver.DirectSound); soundOutputDevice.SelectedIndex = xmlreader.GetValueAsInt("mplayer", "soundOutputDevice", 0); audioChannels.SelectedIndex = xmlreader.GetValueAsInt("mplayer", "audioChannels", (int)AudioChannels.Default); audioDelayStep.Value = xmlreader.GetValueAsInt("mplayer", "audioDelayStep", 100); passthroughAC3_DTS.Checked = xmlreader.GetValueAsBool("mplayer", "passthroughAC3DTS", false); audioNormalize.Checked = xmlreader.GetValueAsBool("mplayer", "audioNormalize", false); } }
public void Load() { using (var xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { this.PluginName = xmlreader.GetValueAsString("youtubevideos", "PluginName", "YouTube.fm"); this.User = xmlreader.GetValueAsString("youtubevideos", "user", string.Empty); this.Password = xmlreader.GetValueAsString("youtubevideos", "password", string.Empty); this.StartUpOpt = xmlreader.GetValueAsInt("youtubevideos", "StartUpOpt", 0); this.VideoQuality = xmlreader.GetValueAsInt("youtubevideos", "VideoQuality", 0); this.LayoutItem = xmlreader.GetValueAsInt("youtubevideos", "LayoutItem", 0); this.LayoutArtist = xmlreader.GetValueAsInt("youtubevideos", "LayoutArtist", 2); this.LayoutVideo = xmlreader.GetValueAsInt("youtubevideos", "LayoutVideo", 5); this.MusicFilter = xmlreader.GetValueAsBool("youtubevideos", "MusicFilter", true); string his = xmlreader.GetValueAsString("youtubevideos", "searchhistory", string.Empty); this.ShowNowPlaying = xmlreader.GetValueAsBool("youtubevideos", "ShowNowPlaying", true); this.UseExtremFilter = xmlreader.GetValueAsBool("youtubevideos", "UseExtremFilter", false); this.LoadOnlineFanart = xmlreader.GetValueAsBool("youtubevideos", "LoadOnlineFanart", true); this.CacheDir = xmlreader.GetValueAsString("youtubevideos", "CacheDir", string.Empty); this.FanartDir = xmlreader.GetValueAsString("youtubevideos", "FanartFolder", string.Empty); this.DownloadFolder = xmlreader.GetValueAsString("youtubevideos", "DownloadFolder", Environment.GetFolderPath(Environment.SpecialFolder.Personal) + "\\Videos"); this.LastFmUser = xmlreader.GetValueAsString("youtubevideos", "LastFmUser", string.Empty); this.LastFmPass = xmlreader.GetValueAsString("youtubevideos", "LastFmPass", string.Empty); this.LastFmNowPlay = xmlreader.GetValueAsBool("youtubevideos", "LastFmNowPlay", false); this.LastFmSubmit = xmlreader.GetValueAsBool("youtubevideos", "LastFmSubmit", false); this.UseAsServer = xmlreader.GetValueAsBool("youtubevideos", "UseAsServer", false); this.PortNumber = xmlreader.GetValueAsInt("youtubevideos", "PortNumber", 18944); this.UseDefaultOSD = xmlreader.GetValueAsBool("youtubevideos", "UseDefaultOSD", false); foreach (string s in his.Split('|')) { if (!string.IsNullOrEmpty(s.Trim())) { SearchHistory.Add(s); } } } if (string.IsNullOrEmpty(CacheDir)) { CacheDir = Config.GetFile(Config.Dir.Thumbs, @"Youtube.Fm\Cache"); } if (string.IsNullOrEmpty(FanartDir)) { FanartDir = Config.GetFile(Config.Dir.Thumbs, @"Youtube.Fm\Fanart\", "%artist%.png"); } this.LocalFile.Load(); MainMenu.Load("youtubefmMenu.xml"); }
/// <summary> /// Stores the configuration of this section /// </summary> public void SaveConfiguration() { using (MediaPortal.Profile.Settings xmlWriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { xmlWriter.SetValue("mplayer", "videoOutputDriver", videoOutputDriver.SelectedIndex); xmlWriter.SetValue("mplayer", "postProcessing", postProcessing.SelectedIndex); xmlWriter.SetValue("mplayer", "aspectRatio", aspectRatio.SelectedIndex); xmlWriter.SetValue("mplayer", "deinterlace", deinterlace.SelectedIndex); xmlWriter.SetValue("mplayer", "noise", noiseDenoise.SelectedIndex); xmlWriter.SetValueAsBool("mplayer", "framedrop", framedrop.Checked); xmlWriter.SetValueAsBool("mplayer", "directRendering", directRendering.Checked); xmlWriter.SetValueAsBool("mplayer", "doubleBuffering", doubleBuffering.Checked); } }
/// <summary> /// Stores the configuration of this section /// </summary> public void SaveConfiguration() { using (MediaPortal.Profile.Settings xmlWriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { xmlWriter.SetValue("mplayer", "videoOutputDriver", videoOutputDriver.SelectedIndex); xmlWriter.SetValue("mplayer", "postProcessing", postProcessing.SelectedIndex); xmlWriter.SetValue("mplayer", "aspectRatio", aspectRatio.SelectedIndex); xmlWriter.SetValue("mplayer", "deinterlace", deinterlace.SelectedIndex); xmlWriter.SetValue("mplayer", "noise", noiseDenoise.SelectedIndex); xmlWriter.SetValueAsBool("mplayer", "framedrop", framedrop.Checked); xmlWriter.SetValueAsBool("mplayer", "directRendering", directRendering.Checked); xmlWriter.SetValueAsBool("mplayer", "doubleBuffering", doubleBuffering.Checked); } }
public void Load() { using ( MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { Mp3 = xmlreader.GetValueAsBool("radiotime", "mp3", true); Wma = xmlreader.GetValueAsBool("radiotime", "wma", true); Real = xmlreader.GetValueAsBool("radiotime", "real", false); ShowPresets = xmlreader.GetValueAsBool("radiotime", "showpresets", false); UseVideo = xmlreader.GetValueAsBool("radiotime", "UseVideo", false); JumpNowPlaying = xmlreader.GetValueAsBool("radiotime", "JumpNowPlaying", false); User = xmlreader.GetValueAsString("radiotime", "user", string.Empty); Password = xmlreader.GetValueAsString("radiotime", "password", string.Empty); FolderId = xmlreader.GetValueAsString("radiotime", "FolderId", string.Empty); PluginName = xmlreader.GetValueAsString("radiotime", "pluginname", "RadioTime"); StartWithFastPreset = xmlreader.GetValueAsBool("radiotime", "StartWithFastPreset", false); SearchHistory.Clear(); ArtistSearchHistory.Clear(); string searchs = xmlreader.GetValueAsString("radiotime", "searchHistory", ""); if (!string.IsNullOrEmpty(searchs)) { string[] array = searchs.Split('|'); for (int i = 0; i < array.Length && i < 25; i++) { if (!string.IsNullOrEmpty(array[i])) { SearchHistory.Add(array[i]); } } } searchs = xmlreader.GetValueAsString("radiotime", "artistSearchHistory", ""); if (!string.IsNullOrEmpty(searchs)) { string[] array = searchs.Split('|'); for (int i = 0; i < array.Length && i < 25; i++) { if (!string.IsNullOrEmpty(array[i])) { ArtistSearchHistory.Add(array[i]); } } } PartnerId = "41"; } }
void LoadSettings() { string path = Path.Combine(Config.GetFolder(Config.Dir.Config), "MediaPortal.xml"); using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(path)) //using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { server = xmlreader.GetValue("mydbox", "IP"); username = xmlreader.GetValue("mydbox", "UserName"); password = xmlreader.GetValue("mydbox", "Password"); } ShowBoutiques(); }
/// <summary> /// Loads the configuration for this section /// </summary> public void LoadConfiguration() { using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { osdSelect.SelectedIndex = xmlreader.GetValueAsInt("mplayer", "osd", (int)OSDMode.ExternalOSDLibrary); optionalArguments.Text = xmlreader.GetValueAsString("mplayer", "generalArguments", String.Empty); rebuildIndex.Checked = xmlreader.GetValueAsBool("mplayer", "rebuildIndex", false); priorityBoost.Checked = xmlreader.GetValueAsBool("mplayer", "priorityBoost", true); int tempCacheSize = xmlreader.GetValueAsInt("mplayer", "cacheSize", 4096); cacheSize.Text = tempCacheSize > 0 ? tempCacheSize.ToString() : String.Empty; mplayerPath.Text = xmlreader.GetValueAsString("mplayer", "mplayerPath", "C:\\Program Files\\MPlayer\\MPlayer.exe"); bool blankScreenStandardValue = !OSInfo.OSInfo.VistaOrLater(); externalOSDLibraryBlank.Checked = xmlreader.GetValueAsBool("externalOSDLibrary", "blankScreen", blankScreenStandardValue); } }
/// <summary> /// Loads the configuration for this section /// </summary> public void LoadConfiguration() { using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { osdSelect.SelectedIndex = xmlreader.GetValueAsInt("mplayer", "osd", (int) OSDMode.ExternalOSDLibrary); optionalArguments.Text = xmlreader.GetValueAsString("mplayer", "generalArguments", String.Empty); rebuildIndex.Checked = xmlreader.GetValueAsBool("mplayer", "rebuildIndex", false); priorityBoost.Checked = xmlreader.GetValueAsBool("mplayer", "priorityBoost", true); int tempCacheSize = xmlreader.GetValueAsInt("mplayer", "cacheSize", 4096); cacheSize.Text = tempCacheSize > 0 ? tempCacheSize.ToString() : String.Empty; mplayerPath.Text = xmlreader.GetValueAsString("mplayer", "mplayerPath", "C:\\Program Files\\MPlayer\\MPlayer.exe"); bool blankScreenStandardValue = !OSInfo.OSInfo.VistaOrLater(); externalOSDLibraryBlank.Checked = xmlreader.GetValueAsBool("externalOSDLibrary", "blankScreen", blankScreenStandardValue); } }
// Save settings to file private void btSave_Click(object sender, EventArgs e) { using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "HeadWeb.xml"))) { xmlwriter.SetValue("Settings", "Username", inputUsername.Text); xmlwriter.SetValue("Settings", "Password", inputPassword.Text); xmlwriter.SetValue("Settings", "PINCode", inputPincode.Text); xmlwriter.SetValue("Settings", "VideoQuality", videoQuality.Text); xmlwriter.SetValue("Settings", "AutoLogin", checkboxLogin.Checked ? 1 : 0); xmlwriter.SetValue("Settings", "PinApprovePurchase", checkboxPin.Checked ? 1 : 0); xmlwriter.SetValue("Settings", "DisableAdultMovies", checkboxAdult.Checked ? 1 : 0); xmlwriter.SetValue("Settings", "UseOrginalName", checkboxOrginalName.Checked ? 1 : 0); this.Close(); } }
private void displayDeviceSettings() { using (var xmlReader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MQTTPlugin.xml"))) { WindowChange_checkBox.Checked = xmlReader.GetValueAsBool(MQTTPlugin.PLUGIN_NAME, "WindowChange", true); mediaDuration_textBox.Text = (xmlReader.GetValueAsInt(MQTTPlugin.PLUGIN_NAME, "SetLevelForMediaDuration", 10)).ToString(); host_textBox.Text = xmlReader.GetValueAsString(MQTTPlugin.BROKER, "Host", string.Empty); port_textBox.Text = xmlReader.GetValueAsString(MQTTPlugin.BROKER, "Port", "1883"); user_textBox.Text = xmlReader.GetValueAsString(MQTTPlugin.BROKER, "User", string.Empty); password_textBox.Text = DPAPI.DecryptString(xmlReader.GetValueAsString(MQTTPlugin.BROKER, "Password", string.Empty)); debug_checkBox.Checked = xmlReader.GetValueAsBool(MQTTPlugin.PLUGIN_NAME, "DebugMode", false); } }
private void buttonOk_Click(object sender, EventArgs e) { using (MediaPortal.Profile.Settings xmlWriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MQTTPlugin.xml"))) { xmlWriter.SetValueAsBool(MQTTPlugin.PLUGIN_NAME, "WindowChange", WindowChange_checkBox.Checked); xmlWriter.SetValue(MQTTPlugin.PLUGIN_NAME, "SetLevelForMediaDuration", Convert.ToInt32(mediaDuration_textBox.Text)); xmlWriter.SetValue(MQTTPlugin.BROKER, "Host", host_textBox.Text); xmlWriter.SetValue(MQTTPlugin.BROKER, "Port", port_textBox.Text); xmlWriter.SetValue(MQTTPlugin.BROKER, "User", user_textBox.Text); xmlWriter.SetValue(MQTTPlugin.BROKER, "Password", DPAPI.EncryptString(password_textBox.Text)); xmlWriter.SetValueAsBool(MQTTPlugin.PLUGIN_NAME, "DebugMode", debug_checkBox.Checked); } }
private bool Load() { MediaPortal.Profile.Settings xml = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")); _settings.Add("uTorrent.Server.IP", xml.GetValueAsString("MyTorrents", "uTorrent.Server.IP", "127.0.0.1")); _settings.Add("uTorrent.Server.Port", xml.GetValueAsString("MyTorrents", "uTorrent.Server.Port", "8080")); _settings.Add("uTorrent.Username", xml.GetValueAsString("MyTorrents", "uTorrent.User", "Admin")); _settings.Add("uTorrent.Password", xml.GetValueAsString("MyTorrents", "uTorrent.Password", "salainen")); _settings.Add("Torrent.Notifications", xml.GetValueAsString("MyTorrents", "Torrent.Notifications", "False")); _settings.Add("Torrent.PluginName", xml.GetValueAsString("MyTorrents", "Torrent.PluginName", "MyTorrents")); _settings.Add("uTorrent.Backend", xml.GetValueAsString("MyTorrents", "uTorrent.Backend", "utorrent")); _settings.Add("Torrent.Timer.Inside", xml.GetValueAsString("MyTorrents", "Torrent.Timer.Inside", "5")); _settings.Add("Torrent.Timer.Outside", xml.GetValueAsString("MyTorrents", "Torrent.Timer.Outside", "240")); _settings.Add("TorrentView", xml.GetValueAsString("MyTorrents", "TorrentView", "Active")); _settings.Add("SortOrder", xml.GetValueAsString("MyTorrents", "SortOrder", "Default")); return(true); }
/// <summary> /// Load a playlist from disc. /// </summary> /// <param name="type">Type of the playlist</param> /// <param name="name">Name of the playlist (file)</param> /// <param name="shuffle"><code>true</code> to shuffle the playlist</param> public static void LoadPlaylist(string type, string name, bool shuffle) { // Only working for music atm PlayListType plType = GetTypeFromString(type); if (plType == PlayListType.PLAYLIST_MUSIC) { string playlistPath = String.Empty; // Playlist path supplied if (name.EndsWith(".m3u")) { playlistPath = name; } // Playlist name supplied else { // Get playlist folder from mp config using (MediaPortal.Profile.Settings reader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { string playlistFolder = reader.GetValueAsString("music", "playlists", ""); if (!Path.IsPathRooted(playlistFolder)) { playlistFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), playlistFolder); } playlistPath = Path.Combine(playlistFolder, name + ".m3u"); } } if (File.Exists(playlistPath)) { // Load playlist from file PlayListPlayer playListPlayer = PlayListPlayer.SingletonPlayer; PlayList playList = playListPlayer.GetPlaylist(PlayListType.PLAYLIST_MUSIC); PlayListM3uIO m3uPlayList = new PlayListM3uIO(); m3uPlayList.Load(playList, playlistPath); // Shuffle playlist if (shuffle) { Shuffle(type); } } } }
public override void ReadConfig() { try { using (MediaPortal.Profile.Settings reader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { HdmiPort = reader.GetValueAsInt("CecRemote", "HDMIPort", base.HdmiPort); DeviceType = (CecSharp.CecDeviceType)Enum.Parse(typeof(CecSharp.CecDeviceType), (reader.GetValueAsString("CecRemote", "Type", base.DeviceType.ToString())), true); OsdName = reader.GetValueAsString("CecRemote", "OsdName", base.OsdName); FastScrolling = reader.GetValueAsBool("CecRemote", "FastScrolling", base.FastScrolling); FastScrollingRepeatDelay = (ushort)reader.GetValueAsInt("CecRemote", "FastScrollingRepeatDelay", base.FastScrollingRepeatDelay); FastScrollingRepeatRate = (ushort)reader.GetValueAsInt("CecRemote", "FastScrollingRepeatRate", base.FastScrollingRepeatRate); RequireDelayBetweenKeys = reader.GetValueAsBool("CecRemote", "RequireDelayBetweenKeys", base.RequireDelayBetweenKeys); DelayBetweenKeys = (ushort)reader.GetValueAsInt("CecRemote", "DelayBetweenKeys", base.DelayBetweenKeys); DisableScreensaver = reader.GetValueAsBool("CecRemote", "DisableScreensaver", base.DisableScreensaver); ExtensiveLogging = reader.GetValueAsBool("CecRemote", "ExtensiveLogging", base.ExtensiveLogging); WakeDevicesOnStart = reader.GetValueAsBool("CecRemote", "WakeDevicesOnStart", base.WakeDevicesOnStart); ActivateSourceOnStart = reader.GetValueAsBool("CecRemote", "ActivateSourceOnStart", base.ActivateSourceOnStart); OnStartWakeDevices = ParseDevices(reader.GetValueAsString("CecRemote", "OnStartWakeDevices", base.OnStartWakeDevices.Primary.ToString())); StandbyDevicesOnExit = reader.GetValueAsBool("CecRemote", "StandbyDevicesOnExit", base.StandbyDevicesOnExit); InactivateSourceOnExit = reader.GetValueAsBool("CecRemote", "InactivateSourceOnExit", base.InactivateSourceOnExit); OnExitStandbyDevices = ParseDevices(reader.GetValueAsString("CecRemote", "OnExitStandbyDevices", base.OnExitStandbyDevices.Primary.ToString())); WakeDevicesOnResume = reader.GetValueAsBool("CecRemote", "WakeDevicesOnResume", base.WakeDevicesOnResume); ActivateSourceOnResume = reader.GetValueAsBool("CecRemote", "ActivateSourceOnResume", base.ActivateSourceOnResume); RequireUserInputOnResume = reader.GetValueAsBool("CecRemote", "RequireUserInputOnResume", base.RequireUserInputOnResume); OnResumeWakeDevices = ParseDevices(reader.GetValueAsString("CecRemote", "OnResumeWakeDevices", base.OnResumeWakeDevices.Primary.ToString())); StandbyDevicesOnSleep = reader.GetValueAsBool("CecRemote", "StandbyDevicesOnSleep", base.StandbyDevicesOnSleep); InactivateSourceOnSleep = reader.GetValueAsBool("CecRemote", "InactivateSourceOnSleep", base.InactivateSourceOnSleep); OnSleepStandbyDevices = ParseDevices(reader.GetValueAsString("CecRemote", "OnSleepStandbyDevices", base.OnSleepStandbyDevices.Primary.ToString())); ConnectedTo = (CecSharp.CecLogicalAddress)Enum.Parse(typeof(CecSharp.CecLogicalAddress), (reader.GetValueAsString("CecRemote", "ConnectedTo", base.ConnectedTo.ToString())), true); SendTvPowerOff = reader.GetValueAsBool("CecRemote", "SendTvPowerOff", base.SendTvPowerOff); SendTvPowerOffOnlyIfActiveSource = reader.GetValueAsBool("CecRemote", "SendTvPowerOffOnlyIfActiveSource", base.SendTvPowerOffOnlyIfActiveSource); RequireActiveSourceWhenSleep = reader.GetValueAsBool("CecRemote", "RequireActiveSourceWhenSleep", base.RequireActiveSourceWhenSleep); ControlVolume = reader.GetValueAsBool("CecRemote", "ControlVolume", base.ControlVolume); ForcePhysicalAddress = reader.GetValueAsBool("CecRemote", "ForcePhysicalAddress", base.ForcePhysicalAddress); PhysicalAddress = reader.GetValueAsString("CecRemote", "PhysicalAddress", base.PhysicalAddress); } } catch (Exception ex) { Log.Error("CecRemote: Configuration read failed, using defaults! {0}", ex.ToString()); base.SetDefaults(); } }
public bool Save() { MediaPortal.Profile.Settings xml = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")); xml.SetValue("MyTorrents", "uTorrent.Server.IP", _settings["uTorrent.Server.IP"]); xml.SetValue("MyTorrents", "uTorrent.Server.Port", _settings["uTorrent.Server.Port"]); xml.SetValue("MyTorrents", "uTorrent.User", _settings["uTorrent.Username"]); xml.SetValue("MyTorrents", "uTorrent.Password", _settings["uTorrent.Password"]); xml.SetValue("MyTorrents", "Torrent.Notifications", _settings["Torrent.Notifications"]); xml.SetValue("MyTorrents", "Torrent.PluginName", _settings["Torrent.PluginName"]); xml.SetValue("MyTorrents", "uTorrent.Backend", _settings["uTorrent.Backend"]); xml.SetValue("MyTorrents", "Torrent.Timer.Inside", _settings["Torrent.Timer.Inside"]); xml.SetValue("MyTorrents", "Torrent.Timer.Outside", _settings["Torrent.Timer.Outside"]); xml.SetValue("MyTorrents", "TorrentView", _settings["TorrentView"]); xml.SetValue("MyTorrents", "SortOrder", _settings["SortOrder"]); return(true); }
public void ReadConfig() { try { using (MediaPortal.Profile.Settings reader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { Action = reader.GetValueAsInt("MarantzControl", "Action", 0); Address = reader.GetValueAsString("MarantzControl", "Address", "0.0.0.0"); Port = reader.GetValueAsString("MarantzControl", "Port", "23"); TelnetCommand = reader.GetValueAsString("MarantzControl", "TelnetCommand", ""); } } catch (Exception ex) { Log.Error("MarantzControl: Configuration read failed, using defaults! {0}", ex.ToString()); SetDefault(); } }
public void WriteConfig() { try { using (MediaPortal.Profile.Settings writer = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { writer.SetValue("MarantzControl", "Action", Action); writer.SetValue("MarantzControl", "Address", Address); writer.SetValue("MarantzControl", "Port", Port); writer.SetValue("MarantzControl", "TelnetCommand", TelnetCommand); } } catch (Exception ex) { Log.Error("MarantzControl: Configuration read failed, using defaults! {0}", ex.ToString()); throw; } }
/// <summary> /// Loads the configuration of this section /// </summary> public void LoadConfiguration() { using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { dvdArguments.Text = xmlreader.GetValueAsString("mplayer", "dvdArguments", String.Empty); vcdArguments.Text = xmlreader.GetValueAsString("mplayer", "vcdArguments", String.Empty); svcdArguments.Text = xmlreader.GetValueAsString("mplayer", "svcdArguments", String.Empty); cueArguments.Text = xmlreader.GetValueAsString("mplayer", "cueArguments", String.Empty); ftpArguments.Text = xmlreader.GetValueAsString("mplayer", "ftpArguments", String.Empty); httpArguments.Text = xmlreader.GetValueAsString("mplayer", "httpArguments", String.Empty); mmsArguments.Text = xmlreader.GetValueAsString("mplayer", "mmsArguments", String.Empty); mpstArguments.Text = xmlreader.GetValueAsString("mplayer", "mpstArguments", String.Empty); rtspArguments.Text = xmlreader.GetValueAsString("mplayer", "rtspArguments", String.Empty); sdpArguments.Text = xmlreader.GetValueAsString("mplayer", "sdpArguments", String.Empty); udpArguments.Text = xmlreader.GetValueAsString("mplayer", "udpArguments", String.Empty); unsvArguments.Text = xmlreader.GetValueAsString("mplayer", "unsvArguments", String.Empty); } }
/// <summary> /// Stores the configuration of this section /// </summary> public void SaveConfiguration() { using (MediaPortal.Profile.Settings xmlWriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { xmlWriter.SetValue("mplayer", "dvdArguments", dvdArguments.Text); xmlWriter.SetValue("mplayer", "vcdArguments", vcdArguments.Text); xmlWriter.SetValue("mplayer", "svcdArguments", svcdArguments.Text); xmlWriter.SetValue("mplayer", "cueArguments", cueArguments.Text); xmlWriter.SetValue("mplayer", "ftpArguments", ftpArguments.Text); xmlWriter.SetValue("mplayer", "httpArguments", httpArguments.Text); xmlWriter.SetValue("mplayer", "mmsArguments", mmsArguments.Text); xmlWriter.SetValue("mplayer", "mpstArguments", mpstArguments.Text); xmlWriter.SetValue("mplayer", "rtspArguments", rtspArguments.Text); xmlWriter.SetValue("mplayer", "sdpArguments", sdpArguments.Text); xmlWriter.SetValue("mplayer", "udpArguments", udpArguments.Text); xmlWriter.SetValue("mplayer", "unsvArguments", unsvArguments.Text); } }
/// <summary> /// Loads the configuration of this section /// </summary> public void LoadConfiguration() { using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { dvdArguments.Text = xmlreader.GetValueAsString("mplayer", "dvdArguments", String.Empty); vcdArguments.Text = xmlreader.GetValueAsString("mplayer", "vcdArguments", String.Empty); svcdArguments.Text = xmlreader.GetValueAsString("mplayer", "svcdArguments", String.Empty); cueArguments.Text = xmlreader.GetValueAsString("mplayer", "cueArguments", String.Empty); ftpArguments.Text = xmlreader.GetValueAsString("mplayer", "ftpArguments", String.Empty); httpArguments.Text = xmlreader.GetValueAsString("mplayer", "httpArguments", String.Empty); mmsArguments.Text = xmlreader.GetValueAsString("mplayer", "mmsArguments", String.Empty); mpstArguments.Text = xmlreader.GetValueAsString("mplayer", "mpstArguments", String.Empty); rtspArguments.Text = xmlreader.GetValueAsString("mplayer", "rtspArguments", String.Empty); sdpArguments.Text = xmlreader.GetValueAsString("mplayer", "sdpArguments", String.Empty); udpArguments.Text = xmlreader.GetValueAsString("mplayer", "udpArguments", String.Empty); unsvArguments.Text = xmlreader.GetValueAsString("mplayer", "unsvArguments", String.Empty); } }
/// <summary> /// Stores the configuration of this section /// </summary> public void SaveConfiguration() { using (MediaPortal.Profile.Settings xmlWriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { xmlWriter.SetValue("mplayer", "dvdArguments", dvdArguments.Text); xmlWriter.SetValue("mplayer", "vcdArguments", vcdArguments.Text); xmlWriter.SetValue("mplayer", "svcdArguments", svcdArguments.Text); xmlWriter.SetValue("mplayer", "cueArguments", cueArguments.Text); xmlWriter.SetValue("mplayer", "ftpArguments", ftpArguments.Text); xmlWriter.SetValue("mplayer", "httpArguments", httpArguments.Text); xmlWriter.SetValue("mplayer", "mmsArguments", mmsArguments.Text); xmlWriter.SetValue("mplayer", "mpstArguments", mpstArguments.Text); xmlWriter.SetValue("mplayer", "rtspArguments", rtspArguments.Text); xmlWriter.SetValue("mplayer", "sdpArguments", sdpArguments.Text); xmlWriter.SetValue("mplayer", "udpArguments", udpArguments.Text); xmlWriter.SetValue("mplayer", "unsvArguments", unsvArguments.Text); } }
/// <summary> /// Save the settings to the MP config /// </summary> public static void Save() { using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(MediaPortal.Configuration.Config.GetFile(MediaPortal.Configuration.Config.Dir.Config, "MediaPortal.xml"))) { // Encrypt the password string encryptedPassword = encryptString(password); xmlwriter.SetValue(Helper.PLUGIN_NAME, "username", username); xmlwriter.SetValue(Helper.PLUGIN_NAME, "server", server); xmlwriter.SetValue(Helper.PLUGIN_NAME, "password", encryptedPassword); xmlwriter.SetValue(Helper.PLUGIN_NAME, "resource", resource); xmlwriter.SetValueAsBool(Helper.PLUGIN_NAME, "autoConnectStartup", autoConnectStartup); xmlwriter.SetValueAsBool(Helper.PLUGIN_NAME, "notifyOnMessagePlugin", notifyOnMessagePlugin); xmlwriter.SetValueAsBool(Helper.PLUGIN_NAME, "notifyOnMessageGlobally", notifyOnMessageGlobally); xmlwriter.SetValueAsBool(Helper.PLUGIN_NAME, "notifyOnStatusPlugin", notifyOnStatusPlugin); xmlwriter.SetValueAsBool(Helper.PLUGIN_NAME, "notifyOnStatusGlobally", notifyOnStatusGlobally); xmlwriter.SetValueAsBool(Helper.PLUGIN_NAME, "notifyOnMoodPlugin", notifyOnMoodPlugin); xmlwriter.SetValueAsBool(Helper.PLUGIN_NAME, "notifyOnMoodGlobally", notifyOnMoodGlobally); xmlwriter.SetValueAsBool(Helper.PLUGIN_NAME, "notifyOnActivityPlugin", notifyOnActivityPlugin); xmlwriter.SetValueAsBool(Helper.PLUGIN_NAME, "notifyOnActivityGlobally", notifyOnActivityGlobally); xmlwriter.SetValueAsBool(Helper.PLUGIN_NAME, "notifyOnTunePlugin", notifyOnTunePlugin); xmlwriter.SetValueAsBool(Helper.PLUGIN_NAME, "notifyOnTuneGlobally", notifyOnTuneGlobally); xmlwriter.SetValueAsBool(Helper.PLUGIN_NAME, "notifyOnErrorPlugin", notifyOnErrorPlugin); xmlwriter.SetValueAsBool(Helper.PLUGIN_NAME, "notifyOnErrorGlobally", notifyOnErrorGlobally); xmlwriter.SetValueAsBool(Helper.PLUGIN_NAME, "selectStatusOnStartup", selectStatusOnStartup); xmlwriter.SetValue(Helper.PLUGIN_NAME, "notifyTimeOut", notifyTimeOut); xmlwriter.SetValue(Helper.PLUGIN_NAME, "autoIdleTimeOut", autoIdleTimeOut); xmlwriter.SetValue(Helper.PLUGIN_NAME, "autoIdleStatusType", (int)autoIdleStatusType); xmlwriter.SetValue(Helper.PLUGIN_NAME, "autoIdleStatusMessage", autoIdleStatusMessage); xmlwriter.SetValue(Helper.PLUGIN_NAME, "defaultStatusType", (int)defaultStatusType); xmlwriter.SetValue(Helper.PLUGIN_NAME, "defaultStatusMessage", defaultStatusMessage); xmlwriter.SetValue(Helper.PLUGIN_NAME, "defaultMoodType", (int)defaultMoodType); xmlwriter.SetValue(Helper.PLUGIN_NAME, "defaultMoodMessage", defaultMoodMessage); xmlwriter.SetValue(Helper.PLUGIN_NAME, "defaultActivityType", (int)defaultActivityType); xmlwriter.SetValue(Helper.PLUGIN_NAME, "defaultActivityMessage", defaultActivityMessage); xmlwriter.SetValue(Helper.PLUGIN_NAME, "notifyWindowType", (int)notifyWindowType); xmlwriter.SetValue(Helper.PLUGIN_NAME, "defaultKeyboardType", (int)defaultKeyboardType); xmlwriter.SetValueAsBool(Helper.PLUGIN_NAME, "publishTuneInfo", publishTuneInfo); xmlwriter.SetValueAsBool(Helper.PLUGIN_NAME, "publishActivityMusic", publishActivityMusic); xmlwriter.SetValueAsBool(Helper.PLUGIN_NAME, "publishActivityRadio", publishActivityRadio); xmlwriter.SetValueAsBool(Helper.PLUGIN_NAME, "publishActivityMovie", publishActivityMovie); xmlwriter.SetValueAsBool(Helper.PLUGIN_NAME, "publishActivityTV", publishActivityTV); xmlwriter.SetValueAsBool(Helper.PLUGIN_NAME, "publishActivityRecording", publishActivityRecording); } }
public override void WriteConfig() { try { using (MediaPortal.Profile.Settings writer = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { writer.SetValue("CecRemote", "HDMIPort", base.HdmiPort); writer.SetValue("CecRemote", "Type", base.DeviceType.ToString()); writer.SetValue("CecRemote", "OsdName", base.OsdName); writer.SetValueAsBool("CecRemote", "FastScrolling", base.FastScrolling); writer.SetValue("CecRemote", "FastScrollingRepeatDelay", base.FastScrollingRepeatDelay); writer.SetValue("CecRemote", "FastScrollingRepeatRate", base.FastScrollingRepeatRate); writer.SetValueAsBool("CecRemote", "RequireDelayBetweenKeys", base.RequireDelayBetweenKeys); writer.SetValue("CecRemote", "DelayBetweenKeys", base.DelayBetweenKeys); writer.SetValueAsBool("CecRemote", "DisableScreensaver", base.DisableScreensaver); writer.SetValueAsBool("CecRemote", "ExtensiveLogging", base.ExtensiveLogging); writer.SetValueAsBool("CecRemote", "WakeDevicesOnStart", base.WakeDevicesOnStart); writer.SetValueAsBool("CecRemote", "ActivateSourceOnStart", base.ActivateSourceOnStart); writer.SetValue("CecRemote", "OnStartWakeDevices", DevicesToString(base.OnStartWakeDevices)); writer.SetValueAsBool("CecRemote", "StandbyDevicesOnExit", base.StandbyDevicesOnExit); writer.SetValueAsBool("CecRemote", "InactivateSourceOnExit", base.InactivateSourceOnExit); writer.SetValue("CecRemote", "OnExitStandbyDevices", DevicesToString(base.OnExitStandbyDevices)); writer.SetValueAsBool("CecRemote", "WakeDevicesOnResume", base.WakeDevicesOnResume); writer.SetValueAsBool("CecRemote", "ActivateSourceOnResume", base.ActivateSourceOnResume); writer.SetValueAsBool("CecRemote", "RequireUserInputOnResume", base.RequireUserInputOnResume); writer.SetValue("CecRemote", "OnResumeWakeDevices", DevicesToString(base.OnResumeWakeDevices)); writer.SetValueAsBool("CecRemote", "StandbyDevicesOnSleep", base.StandbyDevicesOnSleep); writer.SetValueAsBool("CecRemote", "InactivateSourceOnSleep", base.InactivateSourceOnSleep); writer.SetValue("CecRemote", "OnSleepStandbyDevices", DevicesToString(base.OnSleepStandbyDevices)); writer.SetValue("CecRemote", "ConnectedTo", base.ConnectedTo.ToString()); writer.SetValueAsBool("CecRemote", "SendTvPowerOff", base.SendTvPowerOff); writer.SetValueAsBool("CecRemote", "SendTvPowerOffOnlyIfActiveSource", base.SendTvPowerOffOnlyIfActiveSource); writer.SetValueAsBool("CecRemote", "RequireActiveSourceWhenSleep", base.RequireActiveSourceWhenSleep); writer.SetValueAsBool("CecRemote", "ControlVolume", base.ControlVolume); writer.SetValueAsBool("CecRemote", "ForcePhysicalAddress", base.ForcePhysicalAddress); writer.SetValue("CecRemote", "PhysicalAddress", base.PhysicalAddress); } } catch (Exception ex) { Log.Error("CecRemote: Configuration write failed, settings not saved correctly! {0}", ex.ToString()); throw; } }
/// <summary> /// Loads the configuration of this section /// </summary> public void LoadConfiguration() { using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { VideoOutputDriver videoOutputDriverStandardValue = VideoOutputDriver.DirectX; if (OSInfo.OSInfo.OSList.WindowsVista == OSInfo.OSInfo.GetOSName() || OSInfo.OSInfo.OSList.Windows2008 == OSInfo.OSInfo.GetOSName() || OSInfo.OSInfo.OSList.Windows7 == OSInfo.OSInfo.GetOSName()) { videoOutputDriverStandardValue = VideoOutputDriver.Direct3D; } videoOutputDriver.SelectedIndex = xmlreader.GetValueAsInt("mplayer", "videoOutputDriver", (int)videoOutputDriverStandardValue); postProcessing.SelectedIndex = xmlreader.GetValueAsInt("mplayer", "postProcessing", (int)PostProcessing.Maximum); aspectRatio.SelectedIndex = xmlreader.GetValueAsInt("mplayer", "aspectRatio", (int)AspectRatio.Automatic); deinterlace.SelectedIndex = xmlreader.GetValueAsInt("mplayer", "deinterlace", (int)Deinterlace.Adaptive); noiseDenoise.SelectedIndex = xmlreader.GetValueAsInt("mplayer", "noise", (int)NoiseDenoise.Nothing); framedrop.Checked = xmlreader.GetValueAsBool("mplayer", "framedrop", false); directRendering.Checked = xmlreader.GetValueAsBool("mplayer", "directRendering", true); doubleBuffering.Checked = xmlreader.GetValueAsBool("mplayer", "doubleBuffering", true); } }
/// <summary> /// Stores the configuration for this section /// </summary> public void SaveConfiguration() { using (MediaPortal.Profile.Settings xmlWriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { xmlWriter.SetValue("mplayer", "generalArguments", optionalArguments.Text); xmlWriter.SetValue("mplayer", "osd", osdSelect.SelectedIndex); xmlWriter.SetValueAsBool("mplayer", "rebuildIndex", rebuildIndex.Checked); xmlWriter.SetValueAsBool("mplayer", "priorityBoost", priorityBoost.Checked); if (cacheSize.Text.Equals(String.Empty)) { xmlWriter.SetValue("mplayer", "cacheSize", 0); } else { xmlWriter.SetValue("mplayer", "cacheSize", cacheSize.Text); } xmlWriter.SetValue("mplayer", "mplayerPath", mplayerPath.Text); xmlWriter.SetValueAsBool("externalOSDLibrary", "blankScreen", externalOSDLibraryBlank.Checked); } }
private void frmHeadWebLoadSettings(object sender, EventArgs e) { using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "HeadWeb.xml"))) { inputUsername.Text = xmlreader.GetValueAsString("Settings", "Username", ""); inputPassword.Text = xmlreader.GetValueAsString("Settings", "Password", ""); inputPincode.Text = xmlreader.GetValueAsString("Settings", "PINCode", ""); if (xmlreader.GetValueAsString("Settings", "VideoQuality", "").Length <= 0) { videoQuality.SelectedIndex = 0; } else { videoQuality.SelectedIndex = videoQuality.Items.IndexOf(xmlreader.GetValueAsString("Settings", "VideoQuality", "")); } if (xmlreader.GetValueAsInt("Settings", "AutoLogin", 0) != 0) checkboxLogin.Checked = true; if (xmlreader.GetValueAsInt("Settings", "PinApprovePurchase", 0) != 0) checkboxPin.Checked = true; if (xmlreader.GetValueAsInt("Settings", "DisableAdultMovies", 0) != 0) checkboxAdult.Checked = true; if (xmlreader.GetValueAsInt("Settings", "UseOrginalName", 0) != 0) checkboxOrginalName.Checked = true; } }
private void buttonOk_Click(object sender, EventArgs e) { using (MediaPortal.Profile.Settings xmlWriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { xmlWriter.SetValue(EventGhostPlus.PLUGIN_NAME, "egPath", egPath_textBox.Text); xmlWriter.SetValue(EventGhostPlus.PLUGIN_NAME, "egPart2", egPart2_comboBox.Text); xmlWriter.SetValue(EventGhostPlus.PLUGIN_NAME, "egPart3", egPart3_comboBox.Text); xmlWriter.SetValueAsBool(EventGhostPlus.PLUGIN_NAME, "egPayload", egPayload_checkBox.Checked); xmlWriter.SetValueAsBool(EventGhostPlus.PLUGIN_NAME, "WindowChange", WindowChange_checkBox.Checked); xmlWriter.SetValue(EventGhostPlus.PLUGIN_NAME, "setLevelForMediaDuration", Convert.ToInt32(mediaDuration_textBox.Text)); xmlWriter.SetValueAsBool(EventGhostPlus.PLUGIN_NAME, "tcpipIsEnabled", tcpip_radioButton.Checked); xmlWriter.SetValue(EventGhostPlus.PLUGIN_NAME, "tcpipHost", host_textBox.Text); xmlWriter.SetValue(EventGhostPlus.PLUGIN_NAME, "tcpipPort", port_textBox.Text); xmlWriter.SetValue(EventGhostPlus.PLUGIN_NAME, "tcpipPassword", DPAPI.EncryptString(password_textBox.Text)); xmlWriter.SetValueAsBool(EventGhostPlus.PLUGIN_NAME, "PWDEncrypted", true); xmlWriter.SetValue(EventGhostPlus.PLUGIN_NAME, "ReceivePort", rcvport_textBox.Text); xmlWriter.SetValue(EventGhostPlus.PLUGIN_NAME, "ReceivePassword", DPAPI.EncryptString(rcvpassword_textBox.Text)); xmlWriter.SetValueAsBool(EventGhostPlus.PLUGIN_NAME, "DebugMode", debug_checkBox.Checked); } }
/// <summary> /// Public method to load the text from a strings/xml file into memory /// </summary> /// <param name="language">Language</param> /// <returns> /// true when text is loaded /// false when it was unable to load the text /// </returns> //[Obsolete("This method has changed", true)] public static bool Load(string language) { bool isPrefixEnabled; using (MediaPortal.Profile.Settings reader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) isPrefixEnabled = reader.GetValueAsBool("general", "myprefix", true); string directory = Config.GetSubFolder(Config.Dir.Language, "MPlayer"); string cultureName = null; if (language != null) cultureName = GetCultureName(language); Log.Info("MPlayer: Loading localised Strings - Path: {0} Culture: {1} Language: {2} Prefix: {3}", directory, cultureName, language, isPrefixEnabled); _stringProvider = new LocalisationProvider(directory, cultureName, isPrefixEnabled); return true; }
public static bool Load(string language) { bool isPrefixEnabled; using (var reader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { isPrefixEnabled = reader.GetValueAsBool("general", "myprefix", true); if (language == null) language = reader.GetValueAsString("skin", "language", "English"); } string directory = Config.GetSubFolder(Config.Dir.Language, "TVWishListMP"); string cultureName = null; if (language != null) cultureName = GetCultureName(language); Log.Info("[TVWishListMP Localice Strings]: Loading localised Strings - Path: {0} Culture: {1} Language: {2} Prefix: {3}", directory, cultureName, language, isPrefixEnabled); _stringProvider = new LocalisationProvider(directory, cultureName, isPrefixEnabled); //GUIGraphicsContext.CharsInCharacterSet = _stringProvider.Characters; return true; }
public void Save() { using (var xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { xmlwriter.SetValue("youtubevideos", "PluginName", this.PluginName); xmlwriter.SetValue("youtubevideos", "Region", this.Region); xmlwriter.SetValue("youtubevideos", "InitialDisplay", this.InitialDisplay); xmlwriter.SetValue("youtubevideos", "user", User); xmlwriter.SetValue("youtubevideos", "password", Password); xmlwriter.SetValue("youtubevideos", "InitialCat", this.InitialCat); xmlwriter.SetValue("youtubevideos", "InitialSearch", this.InitialSearch); xmlwriter.SetValue("youtubevideos", "VideoQuality", this.VideoQuality); xmlwriter.SetValue("youtubevideos", "InstantAction", (int)this.InstantAction); xmlwriter.SetValue("youtubevideos", "InstantCharInt", this.InstantChar); xmlwriter.SetValue("youtubevideos", "DownloadFolder", this.DownloadFolder); xmlwriter.SetValue("youtubevideos", "FanartFolder", this.FanartDir); xmlwriter.SetValueAsBool("youtubevideos", "MusicFilter", this.MusicFilter); xmlwriter.SetValueAsBool("youtubevideos", "time", this.Time); xmlwriter.SetValueAsBool("youtubevideos", "ShowNowPlaying", this.ShowNowPlaying); xmlwriter.SetValueAsBool("youtubevideos", "UseYouTubePlayer", this.UseYouTubePlayer); xmlwriter.SetValueAsBool("youtubevideos", "UseExtremFilter", this.UseExtremFilter); xmlwriter.SetValueAsBool("youtubevideos", "UseSMSStyleKeyBoard", this.UseSMSStyleKeyBoard); xmlwriter.SetValueAsBool("youtubevideos", "LoadOnlineFanart", this.LoadOnlineFanart); string his = ""; foreach (string s in SearchHistory) { his += s + "|"; } xmlwriter.SetValue("youtubevideos", "searchhistory", his); } this.LocalFile.Save(); }
public void Load() { using (var xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { this.PluginName = xmlreader.GetValueAsString("youtubevideos", "PluginName", "YouTube.fm"); this.Region = xmlreader.GetValueAsString("youtubevideos", "Region", "Ask"); this.InitialDisplay = xmlreader.GetValueAsInt("youtubevideos", "InitialDisplay", 3); this.User = xmlreader.GetValueAsString("youtubevideos", "user", string.Empty); this.Password = xmlreader.GetValueAsString("youtubevideos", "password", string.Empty); this.InitialCat = xmlreader.GetValueAsInt("youtubevideos", "InitialCat", 1); this.VideoQuality = xmlreader.GetValueAsInt("youtubevideos", "VideoQuality", 0); this.InstantAction = (Action.ActionType)xmlreader.GetValueAsInt("youtubevideos", "InstantAction", (int)(Action.ActionType.REMOTE_1)); this.InitialSearch = xmlreader.GetValueAsString("youtubevideos", "InitialSearch", string.Empty); this.InstantChar = xmlreader.GetValueAsInt("youtubevideos", "InstantCharInt", 01); this.MusicFilter = xmlreader.GetValueAsBool("youtubevideos", "MusicFilter", true); this.UseSMSStyleKeyBoard = xmlreader.GetValueAsBool("youtubevideos", "UseSMSStyleKeyBoard", true); string his = xmlreader.GetValueAsString("youtubevideos", "searchhistory", string.Empty); this.Time = xmlreader.GetValueAsBool("youtubevideos", "time", false); this.ShowNowPlaying = xmlreader.GetValueAsBool("youtubevideos", "ShowNowPlaying", true); this.UseYouTubePlayer = xmlreader.GetValueAsBool("youtubevideos", "UseYouTubePlayer", false); this.UseExtremFilter = xmlreader.GetValueAsBool("youtubevideos", "UseExtremFilter", false); this.LoadOnlineFanart = xmlreader.GetValueAsBool("youtubevideos", "LoadOnlineFanart", true); this.FanartDir = xmlreader.GetValueAsString("youtubevideos", "FanartFolder", string.Empty); this.DownloadFolder = xmlreader.GetValueAsString("youtubevideos", "DownloadFolder", Environment.GetFolderPath(System.Environment.SpecialFolder.MyDocuments) + "\\My Videos"); foreach (string s in his.Split('|')) { if (!string.IsNullOrEmpty(s.Trim())) SearchHistory.Add(s); } } this.LocalFile.Load(); }
private static List<SettingsFolder> getAllFolders() { List<SettingsFolder> result = new List<SettingsFolder>(); List<SettingsFolder> toRemove = new List<SettingsFolder>(); List<string> subtitlesPathsMP = new List<string>(); int index; MediaPortal.Profile.Settings mpSettings = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")); string subtitlesPathsSetting = mpSettings.GetValueAsString("subtitles", "paths", @".\"); foreach (string subtitlesPath in subtitlesPathsSetting.Split(new string[] { "," }, StringSplitOptions.None)) { string subtitlesPathToAdd = subtitlesPath.Trim(); if (FileUtils.pathNameIsValid(subtitlesPathToAdd)) subtitlesPathsMP.Add(FileUtils.ensureBackSlash(subtitlesPathToAdd)); } foreach (string subtitlesPath in subtitlesPathsMP) { if (containsPath(Settings.SettingsManager.Properties.FolderSettings.Folders, subtitlesPath, out index)) { SettingsFolder settingsFolder = Settings.SettingsManager.Properties.FolderSettings.Folders[index]; SettingsFolder newSettingsFolder = new SettingsFolder() { Folder = settingsFolder.Folder, Enabled = settingsFolder.Enabled, //Existing = pathExists(settingsFolder.Folder), //Writable = pathIsWritable(settingsFolder.Folder), DefaultForMovies = settingsFolder.DefaultForMovies, DefaultForTVShows = settingsFolder.DefaultForTVShows }; result.Add(newSettingsFolder); } else { SettingsFolder newSettingsFolder = new SettingsFolder() { Folder = subtitlesPath, Enabled = true, //Existing = pathExists(subtitlesPath), //Writable = pathIsWritable(subtitlesPath), DefaultForMovies = false, DefaultForTVShows = false }; result.Add(newSettingsFolder); } } // ensure path .\ if empty - default if (result.Count == 0) { SettingsFolder newSettingsFolder = new SettingsFolder() { Folder = @".\", Enabled = true, DefaultForMovies = true, DefaultForTVShows = true }; result.Insert(0, newSettingsFolder); } Settings.SettingsManager.Properties.FolderSettings.Folders.Clear(); Settings.SettingsManager.Properties.FolderSettings.Folders.AddRange(result); return result; }
public override void WriteConfig() { try { using (MediaPortal.Profile.Settings writer = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { writer.SetValue("CecRemote", "HDMIPort", base.HdmiPort); writer.SetValue("CecRemote", "Type", base.DeviceType.ToString() ); writer.SetValue("CecRemote", "OsdName", base.OsdName); writer.SetValueAsBool("CecRemote", "FastScrolling", base.FastScrolling); writer.SetValue("CecRemote", "FastScrollingRepeatDelay", base.FastScrollingRepeatDelay); writer.SetValue("CecRemote", "FastScrollingRepeatRate", base.FastScrollingRepeatRate); writer.SetValueAsBool("CecRemote", "RequireDelayBetweenKeys", base.RequireDelayBetweenKeys); writer.SetValue("CecRemote", "DelayBetweenKeys", base.DelayBetweenKeys); writer.SetValueAsBool("CecRemote", "DisableScreensaver", base.DisableScreensaver); writer.SetValueAsBool("CecRemote", "ExtensiveLogging", base.ExtensiveLogging); writer.SetValueAsBool("CecRemote", "WakeDevicesOnStart", base.WakeDevicesOnStart); writer.SetValueAsBool("CecRemote", "ActivateSourceOnStart", base.ActivateSourceOnStart); writer.SetValue("CecRemote", "OnStartWakeDevices", DevicesToString(base.OnStartWakeDevices)); writer.SetValueAsBool("CecRemote", "StandbyDevicesOnExit", base.StandbyDevicesOnExit); writer.SetValueAsBool("CecRemote", "InactivateSourceOnExit", base.InactivateSourceOnExit); writer.SetValue("CecRemote", "OnExitStandbyDevices", DevicesToString(base.OnExitStandbyDevices) ); writer.SetValueAsBool("CecRemote", "WakeDevicesOnResume", base.WakeDevicesOnResume); writer.SetValueAsBool("CecRemote", "ActivateSourceOnResume", base.ActivateSourceOnResume); writer.SetValueAsBool("CecRemote", "RequireUserInputOnResume", base.RequireUserInputOnResume); writer.SetValue("CecRemote", "OnResumeWakeDevices", DevicesToString(base.OnResumeWakeDevices) ); writer.SetValueAsBool("CecRemote", "StandbyDevicesOnSleep", base.StandbyDevicesOnSleep); writer.SetValueAsBool("CecRemote", "InactivateSourceOnSleep", base.InactivateSourceOnSleep); writer.SetValue("CecRemote", "OnSleepStandbyDevices", DevicesToString(base.OnSleepStandbyDevices) ); writer.SetValue("CecRemote", "ConnectedTo", base.ConnectedTo.ToString()); writer.SetValueAsBool("CecRemote", "SendTvPowerOff", base.SendTvPowerOff); writer.SetValueAsBool("CecRemote", "SendTvPowerOffOnlyIfActiveSource", base.SendTvPowerOffOnlyIfActiveSource); writer.SetValueAsBool("CecRemote", "RequireActiveSourceWhenSleep", base.RequireActiveSourceWhenSleep); writer.SetValueAsBool("CecRemote", "ControlVolume", base.ControlVolume); writer.SetValueAsBool("CecRemote", "ForcePhysicalAddress", base.ForcePhysicalAddress); writer.SetValue("CecRemote", "PhysicalAddress", base.PhysicalAddress); } } catch (Exception ex) { Log.Error("CecRemote: Configuration write failed, settings not saved correctly! {0}", ex.ToString()); throw; } }
public void Load() { var passwordNeedsUpdate = false; using (var xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { Mp3 = xmlreader.GetValueAsBool("radiotime", "mp3", true); Wma = xmlreader.GetValueAsBool("radiotime", "wma", true); Real = xmlreader.GetValueAsBool("radiotime", "real", false); ShowPresets = xmlreader.GetValueAsBool("radiotime", "showpresets", false); UseVideo = xmlreader.GetValueAsBool("radiotime", "UseVideo", false); JumpNowPlaying = xmlreader.GetValueAsBool("radiotime", "JumpNowPlaying", false); User = xmlreader.GetValueAsString("radiotime", "user", string.Empty); var encryptedPassword = xmlreader.GetValueAsString("radiotime", "encryptedPassword", string.Empty); if (!string.IsNullOrEmpty(encryptedPassword)) { { Password = PasswordUtility.DecryptData(encryptedPassword, DataProtectionScope.LocalMachine); if (string.IsNullOrEmpty(Password)) { Password = string.Empty; } } } else { Password = xmlreader.GetValueAsString("radiotime", "password", string.Empty); passwordNeedsUpdate = true; } FolderId = xmlreader.GetValueAsString("radiotime", "FolderId", string.Empty); PluginName = xmlreader.GetValueAsString("radiotime", "pluginname", "RadioTime"); StartWithFastPreset = xmlreader.GetValueAsBool("radiotime", "StartWithFastPreset", false); SearchHistory.Clear(); ArtistSearchHistory.Clear(); var searchs = xmlreader.GetValueAsString("radiotime", "searchHistory", ""); if (!string.IsNullOrEmpty(searchs)) { var array = searchs.Split('|'); for (var i = 0; i < array.Length && i < 25; i++) { if (!string.IsNullOrEmpty(array[i])) SearchHistory.Add(array[i]); } } searchs = xmlreader.GetValueAsString("radiotime", "artistSearchHistory", ""); if (!string.IsNullOrEmpty(searchs)) { var array = searchs.Split('|'); for (var i = 0; i < array.Length && i < 25; i++) { if (!string.IsNullOrEmpty(array[i])) ArtistSearchHistory.Add(array[i]); } } PartnerId = "41"; } if (passwordNeedsUpdate) { SaveEncryptedPassword(); } }
public void Save() { SaveEncryptedPassword(); using (var xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { xmlwriter.SetValueAsBool("radiotime", "mp3", Mp3); xmlwriter.SetValueAsBool("radiotime", "wma", Wma); xmlwriter.SetValueAsBool("radiotime", "real", Real); xmlwriter.SetValueAsBool("radiotime", "UseVideo", UseVideo); xmlwriter.SetValueAsBool("radiotime", "JumpNowPlaying", JumpNowPlaying); xmlwriter.SetValue("radiotime", "user", User); xmlwriter.SetValueAsBool("radiotime", "showpresets", ShowPresets); xmlwriter.SetValue("radiotime", "pluginname", PluginName); xmlwriter.SetValue("radiotime", "FolderId", FolderId); xmlwriter.SetValueAsBool("radiotime", "StartWithFastPreset", StartWithFastPreset); var s = ""; foreach (var history in SearchHistory) { s += history + "|"; } xmlwriter.SetValue("radiotime", "searchHistory", s); s = ""; foreach (var history in ArtistSearchHistory) { s += history + "|"; } xmlwriter.SetValue("radiotime", "artistSearchHistory", s); } }
public void SaveSettings() { using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(ConfigFileName())) { xmlwriter.SetValue(settingsSectionName, SampleInterval.Name, SampleInterval.Value); xmlwriter.SetValue(settingsSectionName, FolderRecursionDepth.Name, FolderRecursionDepth.Value); xmlwriter.SetValue(settingsSectionName, MaxNumFailures.Name, MaxNumFailures.Value); xmlwriter.SetValue(settingsSectionName, IgnoreHiddenFiles.Name, IgnoreHiddenFiles.Checked.ToString()); xmlwriter.SetValue(settingsSectionName, IgnoreSystemFiles.Name, IgnoreSystemFiles.Checked.ToString()); string s = ""; foreach (string l in SharesToIgnore.Lines) s = s + l + "|"; s.TrimEnd('|'); xmlwriter.SetValue(settingsSectionName, SharesToIgnore.Name, s); xmlwriter.SetValue(settingsSectionName, VideoMinFileSizeMB.Name, VideoMinFileSizeMB.Value); xmlwriter.SetValue(settingsSectionName, VideoMaxFileSizeMB.Name, VideoMaxFileSizeMB.Value); xmlwriter.SetValue(settingsSectionName, PictureMinFileSizeKB.Name, PictureMinFileSizeKB.Value); xmlwriter.SetValue(settingsSectionName, PictureMaxFileSizeKB.Name, PictureMaxFileSizeKB.Value); xmlwriter.SetValue(settingsSectionName, AudioMinFileSizeMB.Name, AudioMinFileSizeMB.Value); xmlwriter.SetValue(settingsSectionName, AudioMaxFileSizeMB.Name, AudioMaxFileSizeMB.Value); } }
public void LoadSettings() { try { using (MediaPortal.Profile.Settings reader = new MediaPortal.Profile.Settings(ConfigFileName())) { // Global parameters this.SampleInterval.Value = reader.GetValueAsInt(settingsSectionName, this.SampleInterval.Name, 15); this.FolderRecursionDepth.Value = reader.GetValueAsInt(settingsSectionName, this.FolderRecursionDepth.Name, 2); this.MaxNumFailures.Value = reader.GetValueAsInt(settingsSectionName, this.MaxNumFailures.Name, 2); this.IgnoreHiddenFiles.Checked = reader.GetValueAsBool(settingsSectionName, this.IgnoreHiddenFiles.Name, true); this.IgnoreSystemFiles.Checked = reader.GetValueAsBool(settingsSectionName, this.IgnoreSystemFiles.Name, true); this.SharesToIgnore.Lines = reader.GetValueAsString(settingsSectionName, this.SharesToIgnore.Name, "").Split('|'); // Video parameters this.VideoMinFileSizeMB.Value = reader.GetValueAsInt(settingsSectionName, this.VideoMinFileSizeMB.Name, 0); this.VideoMaxFileSizeMB.Value = reader.GetValueAsInt(settingsSectionName, this.VideoMaxFileSizeMB.Name, 0); // Picture parameters this.PictureMinFileSizeKB.Value = reader.GetValueAsInt(settingsSectionName, this.PictureMinFileSizeKB.Name, 0); this.PictureMaxFileSizeKB.Value = reader.GetValueAsInt(settingsSectionName, this.PictureMaxFileSizeKB.Name, 0); // Music parameters this.AudioMinFileSizeMB.Value = reader.GetValueAsInt(settingsSectionName, this.AudioMinFileSizeMB.Name, 0); this.AudioMaxFileSizeMB.Value = reader.GetValueAsInt(settingsSectionName, this.AudioMaxFileSizeMB.Name, 0); } } catch (Exception e) { Log.Debug(e.Message); } }
private void SaveEncryptedPassword() { if (!string.IsNullOrEmpty(Password)) { using (var xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { xmlwriter.SetValue("radiotime", "encryptedPassword", PasswordUtility.EncryptData(Password, DataProtectionScope.LocalMachine)); xmlwriter.RemoveEntry("radiotime", "password"); } } }
public void LoadSettings() { try { using (var reader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "TvWishListMP.xml"))) { //DEBUG first checkBoxDebug.Checked = Convert.ToBoolean(reader.GetValueAsString(SectionName, "checkBoxDebug", "false")); myTvWishes.Debug = checkBoxDebug.Checked; Log.DebugValue = checkBoxDebug.Checked; checkBoxAction.Checked = Convert.ToBoolean(reader.GetValueAsString(SectionName, "checkBoxAction", "true")); checkBoxActive.Checked = Convert.ToBoolean(reader.GetValueAsString(SectionName, "checkBoxActive", "false")); checkBoxAfterDays.Checked = Convert.ToBoolean(reader.GetValueAsString(SectionName, "checkBoxAfterDays", "false")); checkBoxAfterTime.Checked = Convert.ToBoolean(reader.GetValueAsString(SectionName, "checkBoxAfterTime", "false")); checkBoxBeforeDay.Checked = Convert.ToBoolean(reader.GetValueAsString(SectionName, "checkBoxBeforeDay", "false")); checkBoxBeforeTime.Checked = Convert.ToBoolean(reader.GetValueAsString(SectionName, "checkBoxBeforeTime", "false")); checkBoxChannel.Checked = Convert.ToBoolean(reader.GetValueAsString(SectionName, "checkBoxChannel", "true")); checkBoxEpisodeName.Checked = Convert.ToBoolean(reader.GetValueAsString(SectionName, "checkBoxEpisodeName", "false")); checkBoxEpisodeNumber.Checked = Convert.ToBoolean(reader.GetValueAsString(SectionName, "checkBoxEpisodeNumber", "false")); checkBoxEpisodePart.Checked = Convert.ToBoolean(reader.GetValueAsString(SectionName, "checkBoxEpisodePart", "false")); checkBoxExclude.Checked = Convert.ToBoolean(reader.GetValueAsString(SectionName, "checkBoxExclude", "true")); checkBoxGroup.Checked = Convert.ToBoolean(reader.GetValueAsString(SectionName, "checkBoxGroup", "true")); //checkBoxHits.Checked = Convert.ToBoolean(reader.GetValueAsString(SectionName, "checkBoxHits", "true")); checkBoxKeepEpisodes.Checked = Convert.ToBoolean(reader.GetValueAsString(SectionName, "checkBoxKeepEpisodes", "false")); checkBoxKeepUntil.Checked = Convert.ToBoolean(reader.GetValueAsString(SectionName, "checkBoxKeepUntil", "false")); checkBoxMatchType.Checked = Convert.ToBoolean(reader.GetValueAsString(SectionName, "checkBoxMatchType", "true")); checkBoxName.Checked = Convert.ToBoolean(reader.GetValueAsString(SectionName, "checkBoxName", "true")); checkBoxPostrecord.Checked = Convert.ToBoolean(reader.GetValueAsString(SectionName, "checkBoxPostrecord", "false")); checkBoxPrerecord.Checked = Convert.ToBoolean(reader.GetValueAsString(SectionName, "checkBoxPrerecord", "false")); checkBoxPriority.Checked = Convert.ToBoolean(reader.GetValueAsString(SectionName, "checkBoxPriority", "false")); checkBoxRecommendedCard.Checked = Convert.ToBoolean(reader.GetValueAsString(SectionName, "checkBoxRecommendedCard", "false")); checkBoxRecordtype.Checked = Convert.ToBoolean(reader.GetValueAsString(SectionName, "checkBoxRecordtype", "true")); // SearchFor is always true; checkBoxSeriesNumber.Checked = Convert.ToBoolean(reader.GetValueAsString(SectionName, "checkBoxSeriesNumber", "false")); checkBoxSkip.Checked = Convert.ToBoolean(reader.GetValueAsString(SectionName, "checkBoxSkip", "true")); checkBoxUseFolderNames.Checked = Convert.ToBoolean(reader.GetValueAsString(SectionName, "checkBoxUseFolderNames", "false")); checkBoxWithinNextHours.Checked = Convert.ToBoolean(reader.GetValueAsString(SectionName, "checkBoxRecordtype", "false")); checkBoxEpisodeCriteria.Checked = Convert.ToBoolean(reader.GetValueAsString(SectionName, "checkBoxEpisodeCriteria", "false")); checkBoxPreferredGroup.Checked = Convert.ToBoolean(reader.GetValueAsString(SectionName, "checkBoxPreferredGroup", "false")); checkBoxIncludeRecordings.Checked = Convert.ToBoolean(reader.GetValueAsString(SectionName, "checkBoxIncludeRecordings", "false")); //modify for listview table changes checkBoxDisableInfoWindow.Checked = Convert.ToBoolean(reader.GetValueAsString(SectionName, "checkBoxDisableInfoWindow", "false")); checkBoxDisableQuickMenu.Checked = Convert.ToBoolean(reader.GetValueAsString(SectionName, "checkBoxDisableQuickMenu", "false")); radioButtonEasy.Checked = Convert.ToBoolean(reader.GetValueAsString(SectionName, "radioButtonEasy", "true")); radioButtonExpert.Checked = Convert.ToBoolean(reader.GetValueAsString(SectionName, "radioButtonExpert", "false")); //filenametextBox.Text=reader.GetValueAsString(SectionName, "TvwishlistFolder", ""); //Log.Debug("[TVWishListMP] TvWishListSetup: loadsettings: " + filenametextBox.Text); textBoxDateTimeFormat.Text = reader.GetValueAsString(SectionName, "DateTimeFormat", ""); textBoxMainItemFormat.Text = reader.GetValueAsString(SectionName, "MainItemFormat", ""); textBoxEmailMainFormat.Text = reader.GetValueAsString(SectionName, "EmailMainFormat", ""); textBoxEmailResultsFormat.Text = reader.GetValueAsString(SectionName, "EmailResultsFormat", ""); textBoxResultsItemFormat.Text = reader.GetValueAsString(SectionName, "ResultsItemFormat", ""); textBoxViewMainFormat.Text = reader.GetValueAsString(SectionName, "ViewMainFormat", ""); textBoxViewResultsFormat.Text = reader.GetValueAsString(SectionName, "ViewResultsFormat", ""); textBoxTimeOut.Text = reader.GetValueAsString(SectionName, "TimeOut", "60"); //load defaultformats string defaultformatstring = reader.GetValueAsString(SectionName, "DefaultFormats", ""); //Complete User default string in English LoadDefaultFormatsFromString(defaultformatstring); } } catch (Exception exc) { Log.Debug("[TVWishListMP] TvWishListSetup: Error LoadSettings: Exception " + exc.Message); } }
public void SaveSettings() { try { using (var reader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "TvWishListMP.xml"))) { reader.SetValue(SectionName, "checkBoxDebug", checkBoxDebug.Checked.ToString()); reader.SetValue(SectionName, "checkBoxAction", checkBoxAction.Checked.ToString()); reader.SetValue(SectionName, "checkBoxActive", checkBoxActive.Checked.ToString()); reader.SetValue(SectionName, "checkBoxAfterDays", checkBoxAfterDays.Checked.ToString()); reader.SetValue(SectionName, "checkBoxAfterTime", checkBoxAfterTime.Checked.ToString()); reader.SetValue(SectionName, "checkBoxBeforeDay", checkBoxBeforeDay.Checked.ToString()); reader.SetValue(SectionName, "checkBoxBeforeTime", checkBoxBeforeTime.Checked.ToString()); reader.SetValue(SectionName, "checkBoxChannel", checkBoxChannel.Checked.ToString()); reader.SetValue(SectionName, "checkBoxEpisodeName", checkBoxEpisodeName.Checked.ToString()); reader.SetValue(SectionName, "checkBoxEpisodeNumber", checkBoxEpisodeNumber.Checked.ToString()); reader.SetValue(SectionName, "checkBoxEpisodePart", checkBoxEpisodePart.Checked.ToString()); reader.SetValue(SectionName, "checkBoxExclude", checkBoxExclude.Checked.ToString()); reader.SetValue(SectionName, "checkBoxGroup", checkBoxGroup.Checked.ToString()); //reader.SetValue(SectionName, "checkBoxHits", checkBoxHits.Checked.ToString()); reader.SetValue(SectionName, "checkBoxKeepEpisodes", checkBoxKeepEpisodes.Checked.ToString()); reader.SetValue(SectionName, "checkBoxKeepUntil", checkBoxKeepUntil.Checked.ToString()); reader.SetValue(SectionName, "checkBoxMatchType", checkBoxMatchType.Checked.ToString()); reader.SetValue(SectionName, "checkBoxName", checkBoxName.Checked.ToString()); reader.SetValue(SectionName, "checkBoxPostrecord", checkBoxPostrecord.Checked.ToString()); reader.SetValue(SectionName, "checkBoxPrerecord", checkBoxPrerecord.Checked.ToString()); reader.SetValue(SectionName, "checkBoxPriority", checkBoxPriority.Checked.ToString()); reader.SetValue(SectionName, "checkBoxRecommendedCard", checkBoxRecommendedCard.Checked.ToString()); reader.SetValue(SectionName, "checkBoxRecordtype", checkBoxRecordtype.Checked.ToString()); reader.SetValue(SectionName, "checkBoxSkip", checkBoxSkip.Checked.ToString()); reader.SetValue(SectionName, "checkBoxSeriesNumber", checkBoxSeriesNumber.Checked.ToString()); reader.SetValue(SectionName, "checkBoxUseFolderNames", checkBoxUseFolderNames.Checked.ToString()); reader.SetValue(SectionName, "checkBoxWithinNextHours", checkBoxWithinNextHours.Checked.ToString()); reader.SetValue(SectionName, "checkBoxEpisodeCriteria", checkBoxEpisodeCriteria.Checked.ToString()); reader.SetValue(SectionName, "checkBoxPreferredGroup", checkBoxPreferredGroup.Checked.ToString()); reader.SetValue(SectionName, "checkBoxIncludeRecordings", checkBoxIncludeRecordings.Checked.ToString()); //modify for listview table changes reader.SetValue(SectionName, "checkBoxDisableInfoWindow", checkBoxDisableInfoWindow.Checked.ToString()); reader.SetValue(SectionName, "checkBoxDisableQuickMenu", checkBoxDisableQuickMenu.Checked.ToString()); reader.SetValue(SectionName, "radioButtonEasy", radioButtonEasy.Checked.ToString()); reader.SetValue(SectionName, "radioButtonExpert", radioButtonExpert.Checked.ToString()); //reader.SetValue(SectionName, "TvwishlistFolder", filenametextBox.Text); reader.SetValue(SectionName, "DateTimeFormat", textBoxDateTimeFormat.Text); reader.SetValue(SectionName, "MainItemFormat", textBoxMainItemFormat.Text); reader.SetValue(SectionName, "EmailMainFormat", textBoxEmailMainFormat.Text); reader.SetValue(SectionName, "EmailResultsFormat", textBoxEmailResultsFormat.Text); reader.SetValue(SectionName, "ResultsItemFormat", textBoxResultsItemFormat.Text); reader.SetValue(SectionName, "ViewMainFormat", textBoxViewMainFormat.Text); reader.SetValue(SectionName, "ViewResultsFormat", textBoxViewResultsFormat.Text); try { int test = Convert.ToInt32(textBoxTimeOut.Text); } catch { textBoxTimeOut.Text = TimeOutDefault; } reader.SetValue(SectionName, "TimeOut", textBoxTimeOut.Text); string defaultformats = SaveDefaultFormatsToString(); reader.SetValue(SectionName, "DefaultFormats", defaultformats); //saving checked complete default user string } } catch (Exception exc) { Log.Debug("[TVWishListMP] TvWishListSetup: Error SaveSettings: Exception " + exc.Message); } }
public SubtitleSelector(ISubtitleStream dvbStreams, SubtitleRenderer subRender, TeletextSubtitleDecoder subDecoder) { Log.Debug("SubtitleSelector ctor"); if (subRender == null) { throw new Exception("Nullpointer input not allowed ( SubtitleRenderer)"); } else { this.dvbStreams = dvbStreams; this.subRender = subRender; } // load preferences using (MediaPortal.Profile.Settings reader = new MediaPortal.Profile.Settings(MediaPortal.Configuration.Config.GetFile(MediaPortal.Configuration.Config.Dir.Config, "MediaPortal.xml"))) { preferedLanguages = new List<string>(); string languages = reader.GetValueAsString("tvservice", "preferredsublanguages", ""); Log.Debug("SubtitleSelector: sublangs entry content: " + languages); StringTokenizer st = new StringTokenizer(languages, ";"); while (st.HasMore) { string lang = st.NextToken(); if (lang.Length != 3) { Log.Warn("Language {0} is not in the correct format!", lang); } else { preferedLanguages.Add(lang); Log.Info("Prefered language {0} is {1}", preferedLanguages.Count, lang); } } } pageEntries = new Dictionary<int, TeletextPageEntry>(); bitmapSubtitleCache = new List<SubtitleOption>(); lock (syncLock) { if (subDecoder != null) { subDecoder.SetPageInfoCallback(new MediaPortal.Player.Subtitles.TeletextSubtitleDecoder.PageInfoCallback(OnPageInfo)); } if (dvbStreams != null) { RetrieveBitmapSubtitles(); subStreamCallback = new SubtitleStreamEventCallback(OnSubtitleReset); IntPtr pSubStreamCallback = Marshal.GetFunctionPointerForDelegate(subStreamCallback); Log.Debug("Calling SetSubtitleStreamEventCallback"); dvbStreams.SetSubtitleResetCallback(pSubStreamCallback); } if (preferedLanguages.Count > 0) { autoSelectOption = new SubtitleOption(); autoSelectOption.language = "None"; autoSelectOption.isAuto = true; autoSelectOption.type = SubtitleType.None; SetOption(0); // the autoselect mode will have index 0 (ugly) } } Log.Debug("End SubtitleSelector ctor"); }