示例#1
0
 /// <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);
     }
 }
示例#2
0
 /// <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);
       }
 }
示例#3
0
 /// <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);
     }
 }
示例#4
0
        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);
            }
        }
示例#5
0
 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();
 }
示例#6
0
        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);
            }
        }
示例#7
0
 /// <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);
       }
 }
示例#8
0
 /// <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);
     }
 }
示例#9
0
 /// <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);
     }
 }
示例#10
0
 /// <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);
       }
 }
示例#11
0
        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);
            }
        }
示例#12
0
        /// <summary>
        /// Stores the configuration with the shares
        /// </summary>
        public void SaveConfiguration()
        {
            shareList.SelectedIndex = -1;
            XmlTextWriter writer = new XmlTextWriter(Config.GetFile(Config.Dir.Config, "MPlayer_GUIPlugin.xml"),
                                                     System.Text.Encoding.UTF8)
            {
                Formatting = Formatting.Indented, Indentation = 1, IndentChar = (char)9
            };

            writer.WriteStartDocument(true);
            writer.WriteStartElement("mplayergui"); //<mplayer>
            writer.WriteAttributeString("version", "1");
            for (int i = 0; i < shareList.Items.Count; i++)
            {
                MPlayerShare temp = shareList.Items[i] as MPlayerShare;
                writer.WriteStartElement("Share"); //<Share>
                if (temp != null)
                {
                    writer.WriteAttributeString("name", temp.Name);
                    writer.WriteAttributeString("path", temp.Path);
                }
                writer.WriteEndElement(); //</Share>
            }
            writer.WriteEndElement();     //</mplayer>
            writer.WriteEndDocument();
            writer.Close();
            using (MediaPortal.Profile.Settings xmlWriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")))
            {
                xmlWriter.SetValue("mplayer", "displayNameOfGUI",
                                   String.IsNullOrEmpty(pluginName.Text) ? "My MPlayer" : pluginName.Text);
                xmlWriter.SetValueAsBool("mplayer", "useMyMusicShares", myMusicShare.Checked);
                xmlWriter.SetValueAsBool("mplayer", "useMyVideoShares", myVideoShare.Checked);
                xmlWriter.SetValueAsBool("mplayer", "treatPlaylistAsFolders", playlistFolder.Checked);
                xmlWriter.SetValueAsBool("mplayer", "useDVDNAV", dvdNavCheckbox.Checked);
            }
        }
        public void Save()
        {
            using (var xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")))
            {
                xmlwriter.SetValue("youtubevideos", "PluginName", PluginName);
                xmlwriter.SetValue("youtubevideos", "user", User);
                xmlwriter.SetValue("youtubevideos", "password", Password);
                xmlwriter.SetValue("youtubevideos", "StartUpOpt", StartUpOpt);
                xmlwriter.SetValue("youtubevideos", "VideoQuality", VideoQuality);
                xmlwriter.SetValue("youtubevideos", "DownloadFolder", DownloadFolder);
                xmlwriter.SetValue("youtubevideos", "FanartFolder", FanartDir);
                xmlwriter.SetValue("youtubevideos", "CacheDir", CacheDir);
                xmlwriter.SetValue("youtubevideos", "LastFmUser", LastFmUser);
                xmlwriter.SetValue("youtubevideos", "LastFmPass", LastFmPass);
                xmlwriter.SetValue("youtubevideos", "LayoutItem", LayoutItem);
                xmlwriter.SetValue("youtubevideos", "LayoutArtist", LayoutArtist);
                xmlwriter.SetValue("youtubevideos", "LayoutVideo", LayoutVideo);
                xmlwriter.SetValueAsBool("youtubevideos", "LastFmNowPlay", LastFmNowPlay);
                xmlwriter.SetValueAsBool("youtubevideos", "LastFmSubmit", LastFmSubmit);
                xmlwriter.SetValueAsBool("youtubevideos", "MusicFilter", this.MusicFilter);
                xmlwriter.SetValueAsBool("youtubevideos", "ShowNowPlaying", this.ShowNowPlaying);
                xmlwriter.SetValueAsBool("youtubevideos", "UseExtremFilter", this.UseExtremFilter);
                xmlwriter.SetValueAsBool("youtubevideos", "LoadOnlineFanart", this.LoadOnlineFanart);

                xmlwriter.SetValue("youtubevideos", "PortNumber", PortNumber);
                xmlwriter.SetValueAsBool("youtubevideos", "UseAsServer", this.UseAsServer);

                xmlwriter.SetValueAsBool("youtubevideos", "UseDefaultOSD", this.UseDefaultOSD);
                string his = "";
                foreach (string s in SearchHistory)
                {
                    his += s + "|";
                }
                xmlwriter.SetValue("youtubevideos", "searchhistory", his);
            }
            CreateFolders();
            this.LocalFile.Save();
            MainMenu.Save("youtubefmMenu.xml");
            MediaPortal.Profile.Settings.SaveCache();
        }
示例#14
0
        /// <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);
            }
        }
示例#15
0
 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 SaveSettings()
        {
            using (MediaPortal.Profile.Settings xmlWriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")))
            {
                string section = ConfigSection;

                xmlWriter.SetValue(section, PropNames.Extensions, Extensions);
                xmlWriter.SetValue(section, PropNames.SeekIncrement, SeekIncrement);
                xmlWriter.SetValueAsBool(section, PropNames.UseForCDDA, UseForCDDA);
                xmlWriter.SetValueAsBool(section, PropNames.UseForWebStream, UseForWebStream);
            }
        }
示例#17
0
        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 Save()
        {
            using (var xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")))
              {
            xmlwriter.SetValue("youtubevideos", "PluginName", PluginName);
            xmlwriter.SetValue("youtubevideos", "user", User);
            xmlwriter.SetValue("youtubevideos", "password", Password);
            xmlwriter.SetValue("youtubevideos", "StartUpOpt", StartUpOpt);
            xmlwriter.SetValue("youtubevideos", "VideoQuality", VideoQuality);
            xmlwriter.SetValue("youtubevideos", "DownloadFolder", DownloadFolder);
            xmlwriter.SetValue("youtubevideos", "FanartFolder", FanartDir);
            xmlwriter.SetValue("youtubevideos", "CacheDir", CacheDir);
            xmlwriter.SetValue("youtubevideos", "LastFmUser", LastFmUser);
            xmlwriter.SetValue("youtubevideos", "LastFmPass", LastFmPass);
            xmlwriter.SetValue("youtubevideos", "LayoutItem", LayoutItem);
            xmlwriter.SetValue("youtubevideos", "LayoutArtist", LayoutArtist);
            xmlwriter.SetValue("youtubevideos", "LayoutVideo", LayoutVideo);
            xmlwriter.SetValueAsBool("youtubevideos", "LastFmNowPlay", LastFmNowPlay);
            xmlwriter.SetValueAsBool("youtubevideos", "LastFmSubmit", LastFmSubmit);
            xmlwriter.SetValueAsBool("youtubevideos", "MusicFilter", this.MusicFilter);
            xmlwriter.SetValueAsBool("youtubevideos", "ShowNowPlaying", this.ShowNowPlaying);
            xmlwriter.SetValueAsBool("youtubevideos", "UseExtremFilter", this.UseExtremFilter);
            xmlwriter.SetValueAsBool("youtubevideos", "LoadOnlineFanart", this.LoadOnlineFanart);

            xmlwriter.SetValue("youtubevideos", "PortNumber", PortNumber);
            xmlwriter.SetValueAsBool("youtubevideos", "UseAsServer", this.UseAsServer);

            xmlwriter.SetValueAsBool("youtubevideos", "UseDefaultOSD", this.UseDefaultOSD);
            string his = "";
            foreach (string s in SearchHistory)
            {
              his += s + "|";
            }
            xmlwriter.SetValue("youtubevideos", "searchhistory", his);
              }
              CreateFolders();
              this.LocalFile.Save();
              MainMenu.Save("youtubefmMenu.xml");
              MediaPortal.Profile.Settings.SaveCache();
        }
示例#19
0
 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;
     }
 }
 protected override void OnPageDestroy(int newWindowId)
 {
     m_iItemSelected = facadeView.SelectedListItemIndex;
     using (MediaPortal.Profile.Settings settings = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")))
     {
         settings.SetValueAsBool("musicfiles", "repeat", playlistPlayer.RepeatPlaylist);
     }
     base.OnPageDestroy(newWindowId);
 }
示例#21
0
        /// <summary>
        /// Save current settings
        /// </summary>
        /// <param name="new_windowId"></param>
        protected override void OnPageDestroy(int new_windowId)
        {
            using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")))
            {
                xmlwriter.SetValue("MyMovies", "layout", (int)_currentLayout);
                xmlwriter.SetValue("MyMovies", "view", (int)_currentView);
                xmlwriter.SetValue("MyMovies", "sorting", (int)_currentSorting);
                xmlwriter.SetValueAsBool("MyMovies", "sortDirection", _sortAscending);
                xmlwriter.SetValue("MyMovies", "currentUser", CurrentUser);
            }
            btnSortBy.SortChanged -= new SortEventHandler(SortChanged);

            base.OnPageDestroy(new_windowId);
        }
示例#22
0
 /// <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);
       }
 }
示例#23
0
 /// <summary>
 /// Stores the configuration with the shares
 /// </summary>
 public void SaveConfiguration()
 {
     shareList.SelectedIndex = -1;
       XmlTextWriter writer = new XmlTextWriter(Config.GetFile(Config.Dir.Config, "MPlayer_GUIPlugin.xml"),
                                        System.Text.Encoding.UTF8)
                        {Formatting = Formatting.Indented, Indentation = 1, IndentChar = (char)9};
       writer.WriteStartDocument(true);
       writer.WriteStartElement("mplayergui"); //<mplayer>
       writer.WriteAttributeString("version", "1");
       for (int i = 0; i < shareList.Items.Count; i++)
       {
     MPlayerShare temp = shareList.Items[i] as MPlayerShare;
     writer.WriteStartElement("Share"); //<Share>
     if (temp != null)
     {
       writer.WriteAttributeString("name", temp.Name);
       writer.WriteAttributeString("path", temp.Path);
     }
     writer.WriteEndElement(); //</Share>
       }
       writer.WriteEndElement(); //</mplayer>
       writer.WriteEndDocument();
       writer.Close();
       using (MediaPortal.Profile.Settings xmlWriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")))
       {
     xmlWriter.SetValue("mplayer", "displayNameOfGUI",
                    String.IsNullOrEmpty(pluginName.Text) ? "My MPlayer" : pluginName.Text);
     xmlWriter.SetValueAsBool("mplayer", "useMyMusicShares", myMusicShare.Checked);
     xmlWriter.SetValueAsBool("mplayer", "useMyVideoShares", myVideoShare.Checked);
     xmlWriter.SetValueAsBool("mplayer", "treatPlaylistAsFolders", playlistFolder.Checked);
     xmlWriter.SetValueAsBool("mplayer", "useDVDNAV", dvdNavCheckbox.Checked);
       }
 }
示例#24
0
        /// <summary>
        /// Save the current configuration and close the window.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnOK_Click(object sender, EventArgs e)
        {
            try
            {
                using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")))
                {
                    xmlwriter.SetValueAsBool("MyMovies", "chkRemoteWakeup", chkEnableRemoteWakeup.Checked);
                    xmlwriter.SetValue("MyMovies", "IPAddress",             GetIPAddress());
                    xmlwriter.SetValue("MyMovies", "MACAddress",            GetMacAddress());
                    xmlwriter.SetValue("MyMovies", "txtProgramDataPath",    txtProgramDataPath.Text);
                    xmlwriter.SetValue("MyMovies", "txtServerName",         txtServerName.Text);
                    xmlwriter.SetValue("MyMovies", "txtDBInstance",         txtDBInstance.Text);
                    xmlwriter.SetValue("MyMovies", "txtUserName",           txtUserName.Text);
                    xmlwriter.SetValue("MyMovies", "txtPassword",           txtPassword.Text);
                    xmlwriter.SetValue("MyMovies", "txtPINCode",            txtPINCode.Text);
                    xmlwriter.SetValue("MyMovies", "wakeupRetries",         numRetries.Value);
                    xmlwriter.SetValue("MyMovies", "wakeupRetryTimeout",    numRetryTimeout.Value);
                    xmlwriter.SetValue("MyMovies", "maximumViewableRating", numMaxRating.Value);
                    SaveDriveReplacement(xmlwriter);
                    SaveUsers(xmlwriter);
                }
            }
            catch (Exception ex)
            {
                Log.Error("Coniguration::btnOK_Click - Error saving the configuration");
                Log.Error(ex);
            }
            DialogResult = DialogResult.OK;

            this.Close();
        }
 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();
 }
 protected override void OnPageDestroy(int newWindowId)
 {
     m_iItemSelected = facadeView.SelectedListItemIndex;
       using (MediaPortal.Profile.Settings settings = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")))
       {
     settings.SetValueAsBool("youtubeplaylist", "repeat", playlistPlayer.RepeatPlaylist);
     settings.SetValueAsBool("youtubeplaylist", "ScrobblerOn", ScrobblerOn);
     settings.SetValue("youtubeplaylist", "ScrobblerMode", (int) currentScrobbleMode);
       }
       base.OnPageDestroy(newWindowId);
 }