public static void SaveSettings()
 {
     using (
         MediaPortal.Profile.Settings reader =
             new MediaPortal.Profile.Settings(
                 MediaPortal.Configuration.Config.GetFile(MediaPortal.Configuration.Config.Dir.Config, "MediaPortal.xml")))
     {
         reader.SetValueAsBool("HyperionScreenCapture", "disableOnStart", DisableOnStart);
         reader.SetValueAsBool("HyperionScreenCapture", "onlyEnableWithMadVr", OnlyEnableWithMadVr);
         reader.SetValue("HyperionScreenCapture", "remoteToggleKey", RemoteToggleKey);
         reader.SetValue("HyperionScreenCapture", "apiPort", ApiPort);
     }
 }
Ejemplo n.º 2
0
 public static void SaveSpecificSetting(string Setting, String Value)
 {
     using (MediaPortal.Profile.Settings reader = new MediaPortal.Profile.Settings(MediaPortal.Configuration.Config.GetFile(MediaPortal.Configuration.Config.Dir.Config, "MediaPortal.xml")))
     {
         reader.SetValue("atmolight", Setting, Value);
     }
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Save changed vars to mediaportal settings file
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SetupForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            try
            {
                UInt16 portCheck = UInt16.Parse(textBoxPort.Text);
                if (portCheck == 0)
                {
                    resetPort();
                }
            }
            catch (Exception)
            {
                resetPort();
            }

            using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")))
            {
                xmlwriter.SetValue(WifiRemote.PLUGIN_NAME, "port", textBoxPort.Text);
                xmlwriter.SetValueAsBool(WifiRemote.PLUGIN_NAME, "disableBonjour", checkBoxDisableBonjour.Checked);
                xmlwriter.SetValue(WifiRemote.PLUGIN_NAME, "serviceName", textBoxName.Text);
                xmlwriter.SetValue(WifiRemote.PLUGIN_NAME, "username", WifiRemote.EncryptString(txtUsername.Text));
                xmlwriter.SetValue(WifiRemote.PLUGIN_NAME, "password", WifiRemote.EncryptString(txtPassword.Text));
                xmlwriter.SetValue(WifiRemote.PLUGIN_NAME, "passcode", WifiRemote.EncryptString(txtPasscode.Text));
                xmlwriter.SetValue(WifiRemote.PLUGIN_NAME, "auth", cbAuthMethod.SelectedIndex);
                xmlwriter.SetValue(WifiRemote.PLUGIN_NAME, "autologinTimeout", numericUpDownAutologin.Value);
                xmlwriter.SetValueAsBool(WifiRemote.PLUGIN_NAME, "showNotifications", checkBoxShowConnectionMessage.Checked);
                // Save plugins order, custom names and if they should be displayed
                List <string> pluginIdsToSave = new List <String>();

                foreach (WindowPlugin plugin in pluginsDataSource)
                {
                    pluginIdsToSave.Add(plugin.WindowId.ToString());
                    pluginIdsToSave.Add(plugin.Name);

                    // Don't display plugin
                    if (!plugin.DisplayPlugin && !ignoredPluginsList.Contains(plugin.WindowId))
                    {
                        // Plugin disabled, add to ignored plugins list
                        ignoredPluginsList.Add(plugin.WindowId);
                    }
                    else if (plugin.DisplayPlugin && ignoredPluginsList.Contains(plugin.WindowId))
                    {
                        // Plugin not disabled but on disabled list. Remove it.
                        ignoredPluginsList.Remove(plugin.WindowId);
                    }
                }
                xmlwriter.SetValue(WifiRemote.PLUGIN_NAME, "savedPlugins", String.Join("|", pluginIdsToSave.ToArray()));
                xmlwriter.SetValue(WifiRemote.PLUGIN_NAME, "ignoredPlugins", String.Join("|", ignoredPluginsList.ConvertAll <string>(x => x.ToString()).ToArray()));
            }
        }
Ejemplo n.º 4
0
 public static void SaveToConfigFile()
 {
     Ares.Settings.Settings settings = Ares.Settings.Settings.Instance;
     using (MediaPortal.Profile.Settings writer = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "aresplugin.xml")))
     {
         String projectFile = settings.RecentFiles.GetFiles().Count > 0 ? settings.RecentFiles.GetFiles()[0].FilePath : "";
         writer.SetValue("Files", "ProjectFile", projectFile);
         writer.SetValue("Directories", "SoundsDirectory", settings.SoundDirectory);
         writer.SetValue("Directories", "MusicDirectory", settings.MusicDirectory);
         writer.SetValue("Network", "UDPPort", settings.UdpPort);
         writer.SetValue("Network", "TCPPort", settings.TcpPort);
         writer.SetValue("Network", "IPAddress", settings.IPAddress);
         writer.SetValue("Volume", "Global", settings.GlobalVolume);
         writer.SetValue("Volume", "Music", settings.MusicVolume);
         writer.SetValue("Volume", "Sounds", settings.SoundVolume);
         writer.SetValue("Files", "LocalPlayerPath", settings.LocalPlayerPath);
     }
 }
 public static void SaveSpecificSetting(string setting, String value)
 {
     using (
         MediaPortal.Profile.Settings reader =
             new MediaPortal.Profile.Settings(
                 MediaPortal.Configuration.Config.GetFile(MediaPortal.Configuration.Config.Dir.Config, "MediaPortal.xml")))
     {
         reader.SetValue("HyperionScreenCapture", setting, value);
     }
 }
Ejemplo n.º 6
0
 private void btSave_Click(object sender, System.EventArgs e)
 {
     using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings("MediaPortal.xml"))
     {
         xmlwriter.SetValue("myLyrics", "useDefaultSitesMode", rdDefault.Checked.ToString());
         xmlwriter.SetValue("myLyrics", "defaultSitesModeValue", trackBar.Value);
         xmlwriter.SetValue("myLyrics", "limit", tbLimit.Text);
         xmlwriter.SetValue("myLyrics", "pluginsName", tbPluginName.Text);
         xmlwriter.SetValue("myLyrics", "useLyricWiki", cbLyricWiki.Checked.ToString());
         xmlwriter.SetValue("myLyrics", "useEvilLabs", cbEvilLabs.Checked.ToString());
         xmlwriter.SetValue("myLyrics", "useLyrics007", cbLyrics007.Checked.ToString());
         xmlwriter.SetValue("myLyrics", "useLyricsOnDemand", cbLyricsOnDemand.Checked.ToString());
         xmlwriter.SetValue("myLyrics", "useSeekLyrics", cbSeekLyrics.Checked.ToString());
         xmlwriter.SetValue("myLyrics", "useHotLyrics", cbHotLyrics.Checked.ToString());
         xmlwriter.SetValueAsBool("myLyrics", "automaticFetch", cbAutoFetch.Checked);
         xmlwriter.SetValueAsBool("myLyrics", "automaticUpdateWhenFirstFound", cbAutomaticUpdate.Checked);
         xmlwriter.SetValueAsBool("myLyrics", "moveLyricFromMarkedDatabase", cbMoveSongFrom.Checked);
     }
 }
Ejemplo n.º 7
0
        public static void SaveSettings()
        {
            using (
                MediaPortal.Profile.Settings reader =
                    new MediaPortal.Profile.Settings(
                        MediaPortal.Configuration.Config.GetFile(MediaPortal.Configuration.Config.Dir.Config, "MediaPortal.xml")))
            {
                reader.SetValue("AudioSwitcher", "remoteKeyDialogContextMenu", RemoteKeyDialogContextMenu);
                reader.SetValue("AudioSwitcher", "defaultPlaybackDevice", DefaultPlaybackDevice);

                reader.SetValueAsBool("AudioSwitcher", "LAVbitstreamAlwaysShowToggleInContextMenu", LAVbitstreamAlwaysShowToggleInContextMenu);
                reader.SetValueAsBool("AudioSwitcher", "LAVbitstreamPerDevice", LAVbitstreamPerDevice);
                reader.SetValue("AudioSwitcher", "LAVbitstreamPropertyList", LAVbitstreamPropertyList);

                reader.SetValueAsBool("AudioSwitcher", "LAVaudioDelayControlsInContextMenu", LAVaudioDelayControlsInContextMenu);
                reader.SetValueAsBool("AudioSwitcher", "LAVaudioDelayEnabled", LAVaudioDelayEnabled);
                reader.SetValue("AudioSwitcher", "LAVaudioDelay", LAVaudioDelay);
            }
        }
Ejemplo n.º 8
0
 public static void LoadSpecificSetting(string setting, String value)
 {
     using (
         MediaPortal.Profile.Settings reader =
             new MediaPortal.Profile.Settings(
                 MediaPortal.Configuration.Config.GetFile(MediaPortal.Configuration.Config.Dir.Config, "MediaPortal.xml")))
     {
         value = reader.GetValueAsString("AudioSwitcher", setting, "");
         reader.SetValue("AudioSwitcher", setting, value);
     }
 }
Ejemplo n.º 9
0
        private string CreateTemporaryConfiguration()
        {
            string tempSettingsFilename = Path.Combine(_tempDir, "MediaPortalTemp.xml");

            // check if Mediaportal has been configured, if not start configuration.exe in wizard mode
            var fi = new FileInfo(MPSettings.ConfigPathName);

            if (!File.Exists(MPSettings.ConfigPathName) || (fi.Length < 10000))
            {
                MessageBox.Show(Resources.MediaPortal_has_never_been_configured, Resources.Configuration_not_found, MessageBoxButtons.OK, MessageBoxIcon.Error);
                try
                {
                    var process = new Process
                    {
                        StartInfo = new ProcessStartInfo
                        {
                            FileName  = Config.GetFile(Config.Dir.Base, "configuration.exe"),
                            Arguments = @"/wizard"
                        }
                    };
                    process.Start();
                    process.WaitForExit();
                }
                // ReSharper disable EmptyGeneralCatchClause
                catch {}
                // ReSharper restore EmptyGeneralCatchClause
            }

            try
            {
                File.Copy(MPSettings.ConfigPathName, tempSettingsFilename, true);
                using (var xmlreader = new Settings(tempSettingsFilename, false))
                {
                    xmlreader.SetValue("general", "loglevel", 3);
                }
            }
            catch (Exception)
            {
                File.Delete(tempSettingsFilename);
                throw;
            }
            return(tempSettingsFilename);
        }
Ejemplo n.º 10
0
    private string CreateTemporaryConfiguration()
    {
      string tempSettingsFilename = Path.Combine(_tempDir, "MediaPortalTemp.xml");

      // check if Mediaportal has been configured, if not start configuration.exe in wizard mode
      var fi = new FileInfo(MPSettings.ConfigPathName);
      if (!File.Exists(MPSettings.ConfigPathName) || (fi.Length < 10000))
      {
        MessageBox.Show(Resources.MediaPortal_has_never_been_configured, Resources.Configuration_not_found, MessageBoxButtons.OK, MessageBoxIcon.Error);
        try
        {
          var process = new Process
                          {
                            StartInfo = new ProcessStartInfo
                                          {
                                            FileName = Config.GetFile(Config.Dir.Base, "configuration.exe"),
                                            Arguments = @"/wizard"
                                          }
                          };
          process.Start();
          process.WaitForExit();
        }
        // ReSharper disable EmptyGeneralCatchClause
        catch {}
        // ReSharper restore EmptyGeneralCatchClause
      }

      try
      {
        File.Copy(MPSettings.ConfigPathName, tempSettingsFilename, true);
        using (var xmlreader = new Settings(tempSettingsFilename, false))
        {
          xmlreader.SetValue("general", "loglevel", 3);
        }
      }
      catch (Exception)
      {
        File.Delete(tempSettingsFilename);
        throw;
      }
      return tempSettingsFilename;
    }
Ejemplo n.º 11
0
        /// <summary>
        /// Save changed vars to mediaportal settings file
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SetupForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            try
            {
                UInt16 portCheck = UInt16.Parse(textBoxPort.Text);
                if (portCheck == 0)
                {
                    resetPort();
                }
            }
            catch (Exception)
            {
                resetPort();
            }

            using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")))
            {
                xmlwriter.SetValue(WifiRemote.PLUGIN_NAME, "port", textBoxPort.Text);
                xmlwriter.SetValueAsBool(WifiRemote.PLUGIN_NAME, "disableBonjour", checkBoxDisableBonjour.Checked);
                xmlwriter.SetValue(WifiRemote.PLUGIN_NAME, "serviceName", textBoxName.Text);
                xmlwriter.SetValue(WifiRemote.PLUGIN_NAME, "username", WifiRemote.EncryptString(txtUsername.Text));
                xmlwriter.SetValue(WifiRemote.PLUGIN_NAME, "password", WifiRemote.EncryptString(txtPassword.Text));
                xmlwriter.SetValue(WifiRemote.PLUGIN_NAME, "passcode", WifiRemote.EncryptString(txtPasscode.Text));
                xmlwriter.SetValue(WifiRemote.PLUGIN_NAME, "auth", cbAuthMethod.SelectedIndex);
                xmlwriter.SetValue(WifiRemote.PLUGIN_NAME, "autologinTimeout", numericUpDownAutologin.Value);
                xmlwriter.SetValueAsBool(WifiRemote.PLUGIN_NAME, "showNotifications", checkBoxShowConnectionMessage.Checked);
                // Save plugins order, custom names and if they should be displayed
                List<string> pluginIdsToSave = new List<String>();

                foreach (WindowPlugin plugin in pluginsDataSource)
                {
                    pluginIdsToSave.Add(plugin.WindowId.ToString());
                    pluginIdsToSave.Add(plugin.Name);

                    // Don't display plugin
                    if (!plugin.DisplayPlugin && !ignoredPluginsList.Contains(plugin.WindowId))
                    {
                        // Plugin disabled, add to ignored plugins list
                        ignoredPluginsList.Add(plugin.WindowId);
                    }
                    else if (plugin.DisplayPlugin && ignoredPluginsList.Contains(plugin.WindowId))
                    {
                        // Plugin not disabled but on disabled list. Remove it.
                        ignoredPluginsList.Remove(plugin.WindowId);
                    }
                }
                xmlwriter.SetValue(WifiRemote.PLUGIN_NAME, "savedPlugins", String.Join("|", pluginIdsToSave.ToArray()));
                xmlwriter.SetValue(WifiRemote.PLUGIN_NAME, "ignoredPlugins", String.Join("|", ignoredPluginsList.ConvertAll<string>(x => x.ToString()).ToArray()));
            }
        }
Ejemplo n.º 12
0
        // 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, "Avalon.xml")))
            {
                if (configloaded)
                {
                    int a = 0;
                    do
                    {
                      xmlwriter.RemoveEntry("AvalonBasicHome", "menuItemName" + a);
                      xmlwriter.RemoveEntry("AvalonBasicHome", "menuItemHyperlink" + a);
                        xmlwriter.RemoveEntry("AvalonBasicHome", "AvalonBasicHomeSubmenu" + a);
                        xmlwriter.RemoveEntry("AvalonBasicHome", "menuItemBgImage" + a);
                        xmlwriter.RemoveEntry("AvalonBasicHome", "menuItemParameter" + a);
                        xmlwriter.RemoveEntry("AvalonBasicHome", "menuItemRecentMedia" + a);

                        int b = 0;
                        do
                        {
                            xmlwriter.RemoveEntry("AvalonBasicHomeSubmenu" + a, "submenuItemName" + b);
                            xmlwriter.RemoveEntry("AvalonBasicHomeSubmenu" + a, "submenuItemHyperlink" + b);
                            xmlwriter.RemoveEntry("AvalonBasicHomeSubmenu" + a, "submenuItemBgImage" + b);
                            xmlwriter.RemoveEntry("AvalonBasicHomeSubmenu" + a, "submenuItemParameter" + b);
                            xmlwriter.RemoveEntry("AvalonBasicHomeSubmenu" + a, "submenuItemRecentMedia" + b);
                            b++;
                        } while (b < 250);

                        a++;
                    } while (a < 25);
                }

                int mycount = 0;
                //menuItems.Sort(delegate(menuItem li1, menuItem li2) { return li1.identifier.CompareTo(li2.identifier); });

                foreach (menuItem item in menuItems)
                {
                    xmlwriter.SetValue("AvalonBasicHome", "menuItemName" + mycount, item.name);
                    xmlwriter.SetValue("AvalonBasicHome", "menuItemHyperlink" + mycount, item.hyperlink);
                    if (item.bgImage != string.Empty)
                    {
                      xmlwriter.SetValue("AvalonBasicHome", "menuItemBgImage" + mycount, item.bgImage);
                    }
                    if (item.property != string.Empty)
                    {
                      xmlwriter.SetValue("AvalonBasicHome", "menuItemParameter" + mycount, item.property);
                    }
                    if (item.media != string.Empty)
                    {
                      xmlwriter.SetValue("AvalonBasicHome", "menuItemRecentMedia" + mycount, item.media);
                    }

                    int mycount2 = 0;
                    foreach (Child mychild in singleChildren)
                    {
                        if (item.identifier == mychild.Owner)
                        {
                            xmlwriter.SetValue("AvalonBasicHomeSubmenu" + mycount, "submenuItemName" + mycount2, mychild.Name);
                            xmlwriter.SetValue("AvalonBasicHomeSubmenu" + mycount, "submenuItemHyperlink" + mycount2, mychild.Hyperlink);
                            if (mychild.property != string.Empty)
                            {
                              xmlwriter.SetValue("AvalonBasicHomeSubmenu" + mycount, "submenuItemParameter" + mycount2, mychild.property);
                            }
                            mycount2++;
                        }
                    }
                    mycount++;
                }

            }

            this.Close();
        }
Ejemplo n.º 13
0
 protected override void OnPageDestroy(int newWindowId)
 {
   LogMyFilms.Debug("MyFilmsDetail.OnPageDestroy(" + newWindowId.ToString() + ") started.");
   if (MyFilms.conf.PersonsEnableDownloads)
   {
     if (downloadingWorker.IsBusy) downloadingWorker.CancelAsync();
     // while (downloadingWorker.IsBusy) System.Windows.Forms.Application.DoEvents();
     // downloadingWorker = null;
     downloadingWorker.ProgressChanged -= new ProgressChangedEventHandler(downloadingWorker_ProgressChanged);
   }
   if (Configuration.CurrentConfig != "")
     Configuration.SaveConfiguration(Configuration.CurrentConfig, MyFilms.conf.StrIndex, MyFilms.conf.StrTIndex);
   using (var xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")))
   {
     string currentmoduleid = "7986";
     bool currentmodulefullscreen = (GUIWindowManager.ActiveWindow == (int)GUIWindow.Window.WINDOW_TVFULLSCREEN || GUIWindowManager.ActiveWindow == (int)GUIWindow.Window.WINDOW_FULLSCREEN_MUSIC || GUIWindowManager.ActiveWindow == (int)GUIWindow.Window.WINDOW_FULLSCREEN_VIDEO || GUIWindowManager.ActiveWindow == (int)GUIWindow.Window.WINDOW_FULLSCREEN_TELETEXT);
     string currentmodulefullscreenstate = GUIPropertyManager.GetProperty("#currentmodulefullscreenstate");
     // if MP was closed/hibernated by the use of remote control, we have to retrieve the fullscreen state in an alternative manner.
     if (!currentmodulefullscreen && currentmodulefullscreenstate == "True")
       currentmodulefullscreen = true;
     xmlreader.SetValue("general", "lastactivemodule", currentmoduleid);
     xmlreader.SetValueAsBool("general", "lastactivemodulefullscreen", currentmodulefullscreen);
     LogMyFilms.Debug("SaveLastActiveModule - module {0}", currentmoduleid);
     LogMyFilms.Debug("SaveLastActiveModule - fullscreen {0}", currentmodulefullscreen);
   }
   LogMyFilms.Debug("MyFilms.OnPageDestroy(" + newWindowId + ") completed.");
   base.OnPageDestroy(newWindowId);
 }
Ejemplo n.º 14
0
        public static void SaveSettings()
        {
            using (MediaPortal.Profile.Settings reader = new MediaPortal.Profile.Settings(MediaPortal.Configuration.Config.GetFile(MediaPortal.Configuration.Config.Dir.Config, "MediaPortal.xml")))
            {
                reader.SetValue("atmolight", "atmowinexe", atmowinExe);
                reader.SetValue("atmolight", "effectVideo", effectVideo.ToString());
                reader.SetValue("atmolight", "effectMusic", effectMusic.ToString());
                reader.SetValue("atmolight", "effectRadio", effectRadio.ToString());
                reader.SetValue("atmolight", "effectMenu", effectMenu.ToString());
                reader.SetValue("atmolight", "effectMPExit", effectMPExit.ToString());
                reader.SetValue("atmolight", "killbutton", (int)killButton);
                reader.SetValue("atmolight", "cmbutton", (int)profileButton);
                reader.SetValue("atmolight", "menubutton", (int)menuButton);
                reader.SetValueAsBool("atmolight", "OffOnStart", manualMode);
                reader.SetValueAsBool("atmolight", "SBS_3D_ON", sbs3dOn);
                reader.SetValueAsBool("atmolight", "lowCPU", lowCPU);
                reader.SetValue("atmolight", "lowCPUTime", lowCPUTime);
                reader.SetValueAsBool("atmolight", "Delay", delay);
                reader.SetValue("atmolight", "DelayTime", delayReferenceTime);
                reader.SetValue("atmolight", "DelayRefreshRate", delayReferenceRefreshRate);
                reader.SetValue("atmolight", "DelayTime23", delayReferenceTime23);
                reader.SetValue("atmolight", "DelayTime24", delayReferenceTime24);
                reader.SetValue("atmolight", "DelayTime50", delayReferenceTime50);
                reader.SetValue("atmolight", "DelayTime59", delayReferenceTime59);
                reader.SetValueAsBool("atmolight", "ExitAtmoWin", exitAtmoWin);
                reader.SetValueAsBool("atmolight", "StartAtmoWin", startAtmoWin);
                reader.SetValueAsBool("atmolight", "atmoWakeHelperEnabled", atmoWakeHelperEnabled);
                reader.SetValue("atmolight", "atmoWakeHelperComPort", atmoWakeHelperComPort);
                reader.SetValue("atmolight", "atmoWakeHelperResumeDelay", atmoWakeHelperResumeDelay);
                reader.SetValue("atmolight", "atmoWakeHelperDisconnectDelay", atmoWakeHelperDisconnectDelay);
                reader.SetValue("atmolight", "atmoWakeHelperConnectDelay", atmoWakeHelperConnectDelay);
                reader.SetValue("atmolight", "atmoWakeHelperReinitializationDelay", atmoWakeHelperReinitializationDelay);
                reader.SetValue("atmolight", "excludeTimeStart", excludeTimeStart.ToString("HH:mm"));
                reader.SetValue("atmolight", "excludeTimeEnd", excludeTimeEnd.ToString("HH:mm"));
                reader.SetValue("atmolight", "currentLanguage", currentLanguage);
                reader.RemoveEntry("atmolight", "currentLanguageFile");
                reader.SetValue("atmolight", "StaticColorRed", staticColorRed);
                reader.SetValue("atmolight", "StaticColorGreen", staticColorGreen);
                reader.SetValue("atmolight", "StaticColorBlue", staticColorBlue);
                reader.SetValueAsBool("atmolight", "RestartOnError", restartOnError);
                reader.SetValueAsBool("atmolight", "TrueGrabbing", trueGrabbing);
                reader.SetValueAsBool("atmolight", "BlackbarDetection", blackbarDetection);
                reader.SetValue("atmolight", "BlackbarDetectionTime", blackbarDetectionTime);
                reader.SetValue("atmolight", "GIFFile", gifFile);
                reader.SetValue("atmolight", "captureWidth", (int)captureWidth);
                reader.SetValue("atmolight", "captureHeight", (int)captureHeight);
                reader.SetValueAsBool("atmolight", "monitorScreensaverState", monitorScreensaverState);
                reader.SetValueAsBool("atmolight", "monitorWindowState", monitorWindowState);
                reader.SetValue("atmolight", "hyperionIP", hyperionIP);
                reader.SetValue("atmolight", "hyperionPort", (int)hyperionPort);
                reader.SetValue("atmolight", "hyperionPriority", (int)hyperionPriority);
                reader.SetValue("atmolight", "hyperionReconnectDelay", (int)hyperionReconnectDelay);
                reader.SetValue("atmolight", "hyperionReconnectAttempts", (int)hyperionReconnectAttempts);
                reader.SetValue("atmolight", "hyperionStaticColorPriority", (int)hyperionPriorityStaticColor);
                reader.SetValueAsBool("atmolight", "hyperionLiveReconnect", hyperionLiveReconnect);
                reader.SetValue("atmolight", "hueExe", hueExe);
                reader.SetValueAsBool("atmolight", "hueStart", hueStart);
                reader.SetValueAsBool("atmolight", "hueIsRemoteMachine", hueIsRemoteMachine);
                reader.SetValue("atmolight", "hueIP", hueIP);
                reader.SetValue("atmolight", "huePort", (int)huePort);
                reader.SetValue("atmolight", "hueReconnectDelay", (int)hueReconnectDelay);
                reader.SetValue("atmolight", "hueReconnectAttempts", (int)hueReconnectAttempts);
                reader.SetValueAsBool("atmolight", "hueBridgeEnableOnResume", hueBridgeEnableOnResume);
                reader.SetValueAsBool("atmolight", "hueBridgeDisableOnSuspend", hueBridgeDisableOnSuspend);
                reader.SetValueAsBool("atmolight", "hueTheaterEnabled", hueTheaterEnabled);
                reader.SetValueAsBool("atmolight", "hueTheaterRestoreLights", hueTheaterRestoreLights);
                reader.SetValueAsBool("atmolight", "hueTheaterEnabledVU", hueTheaterEnabledVU);
                reader.SetValue("atmolight", "boblightIP", boblightIP);
                reader.SetValue("atmolight", "boblightPort", boblightPort);
                reader.SetValue("atmolight", "boblightMaxFPS", boblightMaxFPS);
                reader.SetValue("atmolight", "boblightMaxReconnectAttempts", boblightMaxReconnectAttempts);
                reader.SetValue("atmolight", "boblightReconnectDelay", boblightReconnectDelay);
                reader.SetValue("atmolight", "boblightSpeed", boblightSpeed);
                reader.SetValue("atmolight", "boblightAutospeed", boblightAutospeed);
                reader.SetValue("atmolight", "boblightSaturation", boblightSaturation);
                reader.SetValue("atmolight", "boblightValue", boblightValue);
                reader.SetValue("atmolight", "boblightThreshold", boblightThreshold);
                reader.SetValueAsBool("atmolight", "boblightInterpolation", boblightInterpolation);
                reader.SetValue("atmolight", "boblightGamma", boblightGamma.ToString());
                reader.SetValue("atmolight", "blackbarDetectionThreshold", blackbarDetectionThreshold.ToString());
                reader.SetValue("atmolight", "powerModeChangedDelay", powerModeChangedDelay.ToString());
                reader.SetValue("atmolight", "ambiBoxIP", ambiBoxIP.ToString());
                reader.SetValue("atmolight", "ambiBoxPort", ambiBoxPort.ToString());
                reader.SetValue("atmolight", "ambiBoxMaxReconnectAttempts", ambiBoxMaxReconnectAttempts.ToString());
                reader.SetValue("atmolight", "ambiBoxReconnectDelay", ambiBoxReconnectDelay.ToString());
                reader.SetValue("atmolight", "ambiBoxChangeImageDelay", ambiBoxChangeImageDelay.ToString());
                reader.SetValue("atmolight", "ambiBoxMediaPortalProfile", ambiBoxMediaPortalProfile.ToString());
                reader.SetValue("atmolight", "ambiBoxExternalProfile", ambiBoxExternalProfile.ToString());
                reader.SetValue("atmolight", "ambiBoxPath", ambiBoxPath.ToString());
                reader.SetValueAsBool("atmolight", "ambiBoxAutoStart", ambiBoxAutoStart);
                reader.SetValueAsBool("atmolight", "ambiBoxAutoStop", ambiBoxAutoStop);
                reader.SetValue("atmolight", "vuMeterMindB", vuMeterMindB.ToString());
                reader.SetValue("atmolight", "vuMeterMinHue", vuMeterMinHue.ToString());
                reader.SetValue("atmolight", "vuMeterMaxHue", vuMeterMaxHue.ToString());
                reader.SetValueAsBool("atmolight", "atmoWinTarget", atmoWinTarget);
                reader.SetValueAsBool("atmolight", "boblightTarget", boblightTarget);
                reader.SetValueAsBool("atmolight", "hueTarget", hueTarget);
                reader.SetValueAsBool("atmolight", "hyperionTarget", hyperionTarget);
                reader.SetValueAsBool("atmolight", "ambiBoxTarget", ambiBoxTarget);
                reader.SetValueAsBool("atmolight", "atmoOrbTarget", atmoOrbTarget);
                reader.SetValue("atmolight", "atmoOrbBlackThreshold", atmoOrbBlackThreshold.ToString());
                reader.SetValue("atmolight", "atmoOrbBroadcastPort", atmoOrbBroadcastPort.ToString());
                reader.SetValue("atmolight", "atmoOrbGamma", atmoOrbGamma.ToString());
                reader.SetValue("atmolight", "atmoOrbMinDiversion", atmoOrbMinDiversion.ToString());
                reader.SetValue("atmolight", "atmoOrbSaturation", atmoOrbSaturation.ToString());
                reader.SetValue("atmolight", "atmoOrbThreshold", atmoOrbThreshold.ToString());
                reader.SetValueAsBool("atmolight", "atmoOrbUseOverallLightness", atmoOrbUseOverallLightness);
                reader.SetValueAsBool("atmolight", "atmoOrbUseSmoothing", atmoOrbUseSmoothing);
                reader.SetValue("atmolight", "atmoOrbSmoothingThreshold", atmoOrbSmoothingThreshold.ToString());

                string atmoOrbLampsTemp = "";
                for (int i = 0; i < atmoOrbLamps.Count; i++)
                {
                    if (i > 0)
                    {
                        atmoOrbLampsTemp += "|";
                    }
                    atmoOrbLampsTemp += atmoOrbLamps[i];
                }
                reader.SetValue("atmolight", "atmoOrbLamps", atmoOrbLampsTemp);
                reader.SetValue("atmolight", "hueMinDiversion", hueMinDiversion.ToString());
                reader.SetValue("atmolight", "hueThreshold", hueThreshold.ToString());
                reader.SetValue("atmolight", "hueBlackThreshold", hueBlackThreshold.ToString());
                reader.SetValue("atmolight", "hueSaturation", hueSaturation.ToString());
                reader.SetValueAsBool("atmolight", "hueUseOverallLightness", hueUseOverallLightness);
                reader.SetValueAsBool("atmolight", "blackbarDetectionHorizontal", blackbarDetectionHorizontal);
                reader.SetValueAsBool("atmolight", "blackbarDetectionVertical", blackbarDetectionVertical);
                reader.SetValueAsBool("atmolight", "blackbarDetectionLinkAreas", blackbarDetectionLinkAreas);
                reader.SetValueAsBool("atmolight", "remoteApiServer", remoteApiServer);
                reader.SetValueAsBool("atmolight", "doNotShowConnectionErrorsDuringPlayback", doNotShowConnectionErrorsDuringPlayback);
            }
        }
Ejemplo n.º 15
0
 public static void SaveSpecificSetting(string Setting, String Value)
 {
   using (MediaPortal.Profile.Settings reader = new MediaPortal.Profile.Settings(MediaPortal.Configuration.Config.GetFile(MediaPortal.Configuration.Config.Dir.Config, "MediaPortal.xml")))
   {
     reader.SetValue("atmolight", Setting, Value);
   }
 }
Ejemplo n.º 16
0
 public static void SaveSettings()
 {
   using (MediaPortal.Profile.Settings reader = new MediaPortal.Profile.Settings(MediaPortal.Configuration.Config.GetFile(MediaPortal.Configuration.Config.Dir.Config, "MediaPortal.xml")))
   {
     reader.SetValue("atmolight", "atmowinexe", atmowinExe);
     reader.SetValue("atmolight", "effectVideo", effectVideo.ToString());
     reader.SetValue("atmolight", "effectMusic", effectMusic.ToString());
     reader.SetValue("atmolight", "effectRadio", effectRadio.ToString());
     reader.SetValue("atmolight", "effectMenu", effectMenu.ToString());
     reader.SetValue("atmolight", "effectMPExit", effectMPExit.ToString());
     reader.SetValue("atmolight", "killbutton", (int)killButton);
     reader.SetValue("atmolight", "cmbutton", (int)profileButton);
     reader.SetValue("atmolight", "menubutton", (int)menuButton);
     reader.SetValueAsBool("atmolight", "OffOnStart", manualMode);
     reader.SetValueAsBool("atmolight", "SBS_3D_ON", sbs3dOn);
     reader.SetValueAsBool("atmolight", "lowCPU", lowCPU);
     reader.SetValue("atmolight", "lowCPUTime", lowCPUTime);
     reader.SetValueAsBool("atmolight", "Delay", delay);
     reader.SetValue("atmolight", "DelayTime", delayReferenceTime);
     reader.SetValueAsBool("atmolight", "ExitAtmoWin", exitAtmoWin);
     reader.SetValueAsBool("atmolight", "StartAtmoWin", startAtmoWin);
     reader.SetValueAsBool("atmolight", "atmoWakeHelperEnabled", atmoWakeHelperEnabled);
     reader.SetValue("atmolight", "atmoWakeHelperComPort", atmoWakeHelperComPort);
     reader.SetValue("atmolight", "atmoWakeHelperResumeDelay", atmoWakeHelperResumeDelay);
     reader.SetValue("atmolight", "atmoWakeHelperDisconnectDelay", atmoWakeHelperDisconnectDelay);
     reader.SetValue("atmolight", "atmoWakeHelperConnectDelay", atmoWakeHelperConnectDelay);
     reader.SetValue("atmolight", "atmoWakeHelperReinitializationDelay", atmoWakeHelperReinitializationDelay);
     reader.SetValue("atmolight", "excludeTimeStart", excludeTimeStart.ToString("HH:mm"));
     reader.SetValue("atmolight", "excludeTimeEnd", excludeTimeEnd.ToString("HH:mm"));
     reader.SetValue("atmolight", "CurrentLanguageFile", currentLanguageFile);
     reader.SetValue("atmolight", "StaticColorRed", staticColorRed);
     reader.SetValue("atmolight", "StaticColorGreen", staticColorGreen);
     reader.SetValue("atmolight", "StaticColorBlue", staticColorBlue);
     reader.SetValueAsBool("atmolight", "RestartOnError", restartOnError);
     reader.SetValueAsBool("atmolight", "TrueGrabbing", trueGrabbing);
     reader.SetValue("atmolight", "DelayRefreshRate", delayReferenceRefreshRate);
     reader.SetValueAsBool("atmolight", "BlackbarDetection", blackbarDetection);
     reader.SetValue("atmolight", "BlackbarDetectionTime", blackbarDetectionTime);
     reader.SetValue("atmolight", "GIFFile", gifFile);
     reader.SetValue("atmolight", "captureWidth", (int)captureWidth);
     reader.SetValue("atmolight", "captureHeight", (int)captureHeight);
     reader.SetValueAsBool("atmolight", "monitorScreensaverState", monitorScreensaverState);
     reader.SetValueAsBool("atmolight", "monitorWindowState", monitorWindowState);
     reader.SetValue("atmolight", "hyperionIP", hyperionIP);
     reader.SetValue("atmolight", "hyperionPort", (int)hyperionPort);
     reader.SetValue("atmolight", "hyperionPriority", (int)hyperionPriority);
     reader.SetValue("atmolight", "hyperionReconnectDelay", (int)hyperionReconnectDelay);
     reader.SetValue("atmolight", "hyperionReconnectAttempts", (int)hyperionReconnectAttempts);
     reader.SetValue("atmolight", "hyperionStaticColorPriority", (int)hyperionPriorityStaticColor);
     reader.SetValueAsBool("atmolight", "hyperionLiveReconnect", hyperionLiveReconnect);
     reader.SetValue("atmolight", "hueExe", hueExe);
     reader.SetValueAsBool("atmolight", "hueStart", hueStart);
     reader.SetValueAsBool("atmolight", "hueIsRemoteMachine", hueIsRemoteMachine);
     reader.SetValue("atmolight", "hueIP", hueIP);
     reader.SetValue("atmolight", "huePort", (int)huePort);
     reader.SetValue("atmolight", "hueReconnectDelay", (int)hueReconnectDelay);
     reader.SetValue("atmolight", "hueReconnectAttempts", (int)hueReconnectAttempts);
     reader.SetValueAsBool("atmolight", "hueBridgeEnableOnResume", hueBridgeEnableOnResume);
     reader.SetValueAsBool("atmolight", "hueBridgeDisableOnSuspend", hueBridgeDisableOnSuspend);
     reader.SetValueAsBool("atmolight", "hueTheaterEnabled", hueTheaterEnabled);
     reader.SetValueAsBool("atmolight", "hueTheaterRestoreLights", hueTheaterRestoreLights);
     reader.SetValue("atmolight", "boblightIP", boblightIP);
     reader.SetValue("atmolight", "boblightPort", boblightPort);
     reader.SetValue("atmolight", "boblightMaxFPS", boblightMaxFPS);
     reader.SetValue("atmolight", "boblightMaxReconnectAttempts", boblightMaxReconnectAttempts);
     reader.SetValue("atmolight", "boblightReconnectDelay", boblightReconnectDelay);
     reader.SetValue("atmolight", "boblightSpeed", boblightSpeed);
     reader.SetValue("atmolight", "boblightAutospeed", boblightAutospeed);
     reader.SetValue("atmolight", "boblightSaturation", boblightSaturation);
     reader.SetValue("atmolight", "boblightValue", boblightValue);
     reader.SetValue("atmolight", "boblightThreshold", boblightThreshold);
     reader.SetValueAsBool("atmolight", "boblightInterpolation", boblightInterpolation);
     reader.SetValue("atmolight", "boblightGamma", boblightGamma.ToString());
     reader.SetValue("atmolight", "blackbarDetectionThreshold", blackbarDetectionThreshold.ToString());
     reader.SetValue("atmolight", "powerModeChangedDelay", powerModeChangedDelay.ToString());
     reader.SetValue("atmolight", "ambiBoxIP", ambiBoxIP.ToString());
     reader.SetValue("atmolight", "ambiBoxPort", ambiBoxPort.ToString());
     reader.SetValue("atmolight", "ambiBoxMaxReconnectAttempts", ambiBoxMaxReconnectAttempts.ToString());
     reader.SetValue("atmolight", "ambiBoxReconnectDelay", ambiBoxReconnectDelay.ToString());
     reader.SetValue("atmolight", "ambiBoxMediaPortalProfile", ambiBoxMediaPortalProfile.ToString());
     reader.SetValue("atmolight", "ambiBoxExternalProfile", ambiBoxExternalProfile.ToString());
     reader.SetValue("atmolight", "ambiBoxPath", ambiBoxPath.ToString());
     reader.SetValueAsBool("atmolight", "ambiBoxAutoStart", ambiBoxAutoStart);
     reader.SetValueAsBool("atmolight", "ambiBoxAutoStop", ambiBoxAutoStop);
     reader.SetValue("atmolight", "vuMeterMindB", vuMeterMindB.ToString());
     reader.SetValue("atmolight", "vuMeterMinHue", vuMeterMinHue.ToString());
     reader.SetValue("atmolight", "vuMeterMaxHue", vuMeterMaxHue.ToString());
     reader.SetValueAsBool("atmolight", "atmoWinTarget", atmoWinTarget);
     reader.SetValueAsBool("atmolight", "boblightTarget", boblightTarget);
     reader.SetValueAsBool("atmolight", "hueTarget", hueTarget);
     reader.SetValueAsBool("atmolight", "hyperionTarget", hyperionTarget);
     reader.SetValueAsBool("atmolight", "ambiBoxTarget", ambiBoxTarget);
     reader.SetValueAsBool("atmolight", "atmoOrbTarget", atmoOrbTarget);
     reader.SetValue("atmolight", "atmoOrbBlackThreshold", atmoOrbBlackThreshold.ToString());
     reader.SetValue("atmolight", "atmoOrbBroadcastPort", atmoOrbBroadcastPort.ToString());
     reader.SetValue("atmolight", "atmoOrbGamma", atmoOrbGamma.ToString());
     reader.SetValue("atmolight", "atmoOrbMinDiversion", atmoOrbMinDiversion.ToString());
     reader.SetValue("atmolight", "atmoOrbSaturation", atmoOrbSaturation.ToString());
     reader.SetValue("atmolight", "atmoOrbThreshold", atmoOrbThreshold.ToString());
     reader.SetValueAsBool("atmolight", "atmoOrbUseOverallLightness", atmoOrbUseOverallLightness);
     string atmoOrbLampsTemp = "";
     for (int i = 0; i < atmoOrbLamps.Count; i++)
     {
       if (i > 0)
       {
         atmoOrbLampsTemp += "|";
       }
       atmoOrbLampsTemp += atmoOrbLamps[i];
     }
     reader.SetValue("atmolight", "atmoOrbLamps", atmoOrbLampsTemp);
     reader.SetValue("atmolight", "hueMinDiversion", hueMinDiversion.ToString());
     reader.SetValue("atmolight", "hueThreshold", hueThreshold.ToString());
     reader.SetValue("atmolight", "hueBlackThreshold", hueBlackThreshold.ToString());
     reader.SetValue("atmolight", "hueSaturation", hueSaturation.ToString());
     reader.SetValueAsBool("atmolight", "hueUseOverallLightness", hueUseOverallLightness);
     reader.SetValueAsBool("atmolight", "blackbarDetectionHorizontal", blackbarDetectionHorizontal);
     reader.SetValueAsBool("atmolight", "blackbarDetectionVertical", blackbarDetectionVertical);
     reader.SetValueAsBool("atmolight", "blackbarDetectionLinkAreas", blackbarDetectionLinkAreas);
     reader.SetValueAsBool("atmolight", "remoteApiServer", remoteApiServer);
   }
 }