Beispiel #1
0
        private static void LoadSettings()
        {
            if (!_settingsLoaded)
            {
                Log.Debug("Tvhome: LoadSettings()");
                using (Settings xmlreader = new MPSettings())
                {
                    if (PluginMain.DisableRadio)
                    {
                        xmlreader.SetValueAsBool("pluginswindows", "ArgusTV.UI.MediaPortal.RadioHome", false);
                        xmlreader.SetValueAsBool("home", "ARGUS Radio", false);
                        xmlreader.SetValueAsBool("myplugins", "ARGUS Radio", false);
                    }

                    string strValue = xmlreader.GetValueAsString("mytv", "defaultar", "Normal");
                    _preNotifyConfig          = xmlreader.GetValueAsInt("mytv", "notifyTVBefore", 300);
                    _notifyTVTimeout          = xmlreader.GetValueAsInt("mytv", "notifyTVTimeout", 15);
                    _playNotifyBeep           = xmlreader.GetValueAsBool("mytv", "notifybeep", true);
                    _enableRecNotification    = xmlreader.GetValueAsBool("mytv", "enableRecNotifier", false);
                    _autoTurnOnTv             = xmlreader.GetValueAsBool("mytv", "autoturnontv", false);
                    _showlastactivemodule     = xmlreader.GetValueAsBool("general", "showlastactivemodule", false);
                    GUIGraphicsContext.ARType = global::MediaPortal.Util.Utils.GetAspectRatio(strValue);
                    _settingsLoaded           = true;
                }
            }
        }
 private void SaveSettings()
 {
     using (Settings xmlwriter = new MPSettings())
     {
         // Video
         xmlwriter.SetValue("bdplayer", "mpeg2videocodec", _strVideoCodec);
         xmlwriter.SetValue("bdplayer", "h264videocodec", _strH264VideoCodec);
         xmlwriter.SetValue("bdplayer", "vc1videocodec", _strVC1VideoCodec);
         // Audio
         xmlwriter.SetValue("bdplayer", "mpeg2audiocodec", _strAudioCodec);
         xmlwriter.SetValue("bdplayer", "audiorenderer", _strAudioRenderer);
         // Subtitle and language
         if (_info != null)
         {
             xmlwriter.SetValue("bdplayer", "subtitlelanguage", _info.EnglishName);
         }
         if (_infoAudio != null)
         {
             xmlwriter.SetValue("bdplayer", "audiolanguage", _infoAudio.EnglishName);
         }
         xmlwriter.SetValueAsBool("bdplayer", "subtitlesenabled", btnEnableSubtitles.Selected);
         xmlwriter.SetValue("bdplayer", "audiotype", _defaultAudioType);
         xmlwriter.SetValue("bdplayer", "regioncode", _defaultRegion);
         xmlwriter.SetValue("bdplayer", "parentalcontrol", i_ageLimit);
         xmlwriter.SetValueAsBool("bdplayer", "useInternalBDPlayer", btnUseInternalBDPlayer.Selected);
     }
 }
Beispiel #3
0
 /// <summary>
 /// Saves movie player settings and codec info.
 /// </summary>
 public override void SaveSettings()
 {
     if (_init == false)
     {
         return;
     }
     using (Settings xmlwriter = new MPSettings())
     {
         xmlwriter.SetValueAsBool("movieplayer", "autodecodersettings", autoDecoderSettings.Checked);
         xmlwriter.SetValueAsBool("movieplayer", "forcesourcesplitter", ForceSourceSplitter.Checked);
         xmlwriter.SetValueAsBool("movieplayer", "usemoviecodects", mpCheckBoxTS.Checked);
         xmlwriter.SetValue("movieplayer", "audiorenderer", audioRendererComboBox.Text);
         // Set codecs
         xmlwriter.SetValue("movieplayer", "mpeg2audiocodec", audioCodecComboBox.Text);
         xmlwriter.SetValue("movieplayer", "mpeg2videocodec", videoCodecComboBox.Text);
         xmlwriter.SetValue("movieplayer", "h264videocodec", h264videoCodecComboBox.Text);
         xmlwriter.SetValue("movieplayer", "vc1ivideocodec", vc1ivideoCodecComboBox.Text);
         xmlwriter.SetValue("movieplayer", "vc1videocodec", vc1videoCodecComboBox.Text);
         xmlwriter.SetValue("movieplayer", "xvidvideocodec", xvidvideoCodecComboBox.Text);
         xmlwriter.SetValue("movieplayer", "aacaudiocodec", aacAudioCodecComboBox.Text);
         xmlwriter.SetValue("movieplayer", "splitterfilter", SplitterComboBox.Text);
         xmlwriter.SetValue("movieplayer", "splitterfilefilter", SplitterFileComboBox.Text);
         xmlwriter.SetValueAsBool("movieplayer", "settinglavplitter", settingLAVSlitter);
     }
 }
Beispiel #4
0
        public override void SaveSettings()
        {
            using (Settings xmlwriter = new MPSettings())
            {
                // Save general gui settings.
                for (int index = 0; index < sectionEntries.Length; index++)
                {
                    string[] currentSection = sectionEntries[index];
                    xmlwriter.SetValueAsBool(currentSection[0], currentSection[1], settingsCheckedListBox.GetItemChecked(index));
                }

                // Save skin settings.
                string prevSkin     = xmlwriter.GetValueAsString("skin", "name", "DefaultWide");
                string selectedSkin = prevSkin;
                try
                {
                    selectedSkin = listViewAvailableSkins.SelectedItems[0].Text;
                }
                catch (Exception) {}
                if (prevSkin != selectedSkin)
                {
                    xmlwriter.SetValueAsBool("general", "dontshowskinversion", false);
                    Util.Utils.DeleteFiles(Config.GetSubFolder(Config.Dir.Skin, selectedSkin + @"\fonts"), "*");
                }
                xmlwriter.SetValue("skin", "name", selectedSkin);
                Config.SkinName = selectedSkin;
                xmlwriter.SetValue("general", "skinobsoletecount", 0);
                xmlwriter.SetValueAsBool("gui", "useonlyonehome", (homeComboBox.SelectedIndex & (int)HomeUsageEnum.UseOnlyOne) != 0);
                xmlwriter.SetValueAsBool("gui", "startbasichome", (homeComboBox.SelectedIndex & (int)HomeUsageEnum.PreferBasic) != 0);
            }
        }
        private void SaveSettings()
        {
            using (Settings xmlwriter = new MPSettings())
            {
                xmlwriter.SetValue("movieplayer", "mpeg2videocodec", _strVideoCodec);
                xmlwriter.SetValue("movieplayer", "h264videocodec", _strH264VideoCodec);
                xmlwriter.SetValue("movieplayer", "mpeg2audiocodec", _strAudioCodec);
                string aspectRatioText = Utils.GetAspectRatio(_aspectRatio);
                xmlwriter.SetValue("movieplayer", "defaultar", aspectRatioText);
                xmlwriter.SetValue("movieplayer", "audiorenderer", _strAudioRenderer);
                xmlwriter.SetValue("movieplayer", "aacaudiocodec", _strAACAudioCodec);
                xmlwriter.SetValue("movieplayer", "vc1videocodec", _strVC1VideoCodec);
                xmlwriter.SetValue("movieplayer", "vc1ivideocodec", _strVC1iVideoCodec);
                xmlwriter.SetValue("movieplayer", "xvidvideocodec", _strDivXVideoCodec);
                // Splitter
                xmlwriter.SetValue("movieplayer", "splitterfilter", _strSplitterFilter);
                xmlwriter.SetValue("movieplayer", "splitterfilefilter", _strSplitterFilesyncFilter);
                xmlwriter.SetValueAsBool("movieplayer", "autodecodersettings", btnautoDecoderSettings.Selected);
                xmlwriter.SetValueAsBool("movieplayer", "forcesourcesplitter", btnForceSourceSplitter.Selected);
                xmlwriter.SetValueAsBool("movieplayer", "usemoviecodects", btnUseMovieCodects.Selected);

                if (_info != null)
                {
                    xmlwriter.SetValue("subtitles", "language", _info.Name);
                }
                if (_infoAudio != null)
                {
                    xmlwriter.SetValue("movieplayer", "audiolanguage", _infoAudio.Name);
                }

                xmlwriter.SetValueAsBool("subtitles", "enabled", btnEnableSubtitles.Selected);
                xmlwriter.SetValue("movies", "playallinfolder", _playAll);
            }
        }
 public override void SaveSettings()
 {
     using (Settings xmlreader = new MPSettings())
     {
         xmlreader.SetValueAsBool("general", "IdleTimer", checkBoxEnableScreensaver.Checked);
         xmlreader.SetValue("general", "IdleTimeValue", numericUpDownDelay.Value);
         xmlreader.SetValueAsBool("general", "IdleBlanking", radioBtnBlankScreen.Checked);
     }
 }
Beispiel #7
0
 private void SaveSettings()
 {
     using (MPSettings xmlwriter = new MPSettings())
     {
         xmlwriter.SetValue("general", "restart delay", _iDelay.ToString());
         xmlwriter.SetValueAsBool("general", "watchdogEnabled", cmWatchdog.Selected);   //
         xmlwriter.SetValueAsBool("general", "restartOnError", cmAutoRestart.Selected); //
     }
 }
 public override void SaveSettings()
 {
     using (Settings xmlwriter = new MPSettings())
     {
         xmlwriter.SetValueAsBool("mytv", "teletextHidden", cbHiddenMode.Checked);
         xmlwriter.SetValueAsBool("mytv", "teletextTransparent", cbTransparentMode.Checked);
         xmlwriter.SetValueAsBool("mytv", "teletextRemember", cbRememberValue.Checked);
         xmlwriter.SetValue("mytv", "teletextMaxFontSize", nudFontSize.Value);
     }
 }
 public override void SaveSettings()
 {
     using (Settings xmlreader = new MPSettings())
     {
         xmlreader.SetValueAsBool("myradio", "hideAllChannelsGroup", _hideAllChannelsGroup);
         xmlreader.SetValueAsBool("myradio", "rememberlastgroup", _rememberLastGroup);
         xmlreader.SetValue("myradio", "rootgroup", _rootGroup);
         xmlreader.SetValueAsBool("myradio", "autoturnonradio", _autoTurnOnRadio);
     }
 }
 private void SaveSettings()
 {
   using (Settings xmlreader = new MPSettings())
   {
     xmlreader.SetValueAsBool("myradio", "showallchannelsgroup", _showAllChannelsGroup);
     xmlreader.SetValueAsBool("myradio", "rememberlastgroup", _rememberLastGroup);
     xmlreader.SetValue("myradio", "rootgroup", _rootGroup);
     xmlreader.SetValueAsBool ("myradio", "autoturnonradio",_autoTurnOnRadio);
   }
 }
 private void SaveSettings()
 {
     using (Settings xmlreader = new MPSettings())
     {
         xmlreader.SetValueAsBool("myradio", "showallchannelsgroup", _showAllChannelsGroup);
         xmlreader.SetValueAsBool("myradio", "rememberlastgroup", _rememberLastGroup);
         xmlreader.SetValue("myradio", "rootgroup", _rootGroup);
         xmlreader.SetValueAsBool("myradio", "autoturnonradio", _autoTurnOnRadio);
     }
 }
Beispiel #12
0
        public override void SaveSettings()
        {
            using (Settings writer = new MPSettings())
            {
                if (_useClassicHandler.Checked)
                {
                    writer.SetValue("volume", "handler", 0);
                }
                else if (_useWindowsHandler.Checked)
                {
                    writer.SetValue("volume", "handler", 1);
                }
                else if (_useLogarithmicHandler.Checked)
                {
                    writer.SetValue("volume", "handler", 2);
                }
                else if (_useCustomHandler.Checked)
                {
                    writer.SetValue("volume", "handler", 3);
                }
                else if (_useVistaHandler.Checked)
                {
                    writer.SetValue("volume", "handler", 4);
                }
                else if (_useWin10Handler.Checked)
                {
                    writer.SetValue("volume", "handler", 5);
                }

                if (_useLastKnownLevel.Checked)
                {
                    writer.SetValue("volume", "startupstyle", 0);
                }
                else if (_useSystemCurrent.Checked)
                {
                    writer.SetValue("volume", "startupstyle", 1);
                }
                else if (_useCustomLevel.Checked)
                {
                    writer.SetValue("volume", "startupstyle", 2);
                }

                bool useDigital = _useWave.Checked;
                if (SettingsForm.audioplayer_mixing)
                {
                    useDigital = true;
                }
                writer.SetValueAsBool("volume", "digital", useDigital);
                writer.SetValueAsBool("volume", "hideWindowsOSD", mpCBHideWinOSD.Checked);

                writer.SetValue("volume", "table", _customText);
                writer.SetValue("volume", "startuplevel", _customLevel);
                writer.SetValueAsBool("volume", "defaultVolumeOSD", _useVolumeOSD.Checked);
            }
        }
Beispiel #13
0
 public override void SaveSettings()
 {
     using (Settings writer = new MPSettings())
     {
         writer.SetValue("Auto3DPlugin", "GenericDevicePort", IrPortName);
         writer.SetValueAsBool("Auto3DPlugin", "AllowIrCommandsForAllDevices", AllowIrCommandsForAllDevices);
         writer.SetValue("Auto3DPlugin", "GenericDeviceIPAddress", IPAddress);
         writer.SetValue("Auto3DPlugin", "GenericDeviceMAC", MAC);
         writer.SetValueAsBool("Auto3DPlugin", "GenericDevicePingCheck", PingCheck);
     }
 }
Beispiel #14
0
 private void SaveSettings()
 {
     using (Settings xmlwriter = new MPSettings())
     {
         xmlwriter.SetValueAsBool("general", "startfullscreen", btnFullscreen.Selected);
         xmlwriter.SetValueAsBool("general", "IdleTimer", btnScreenSaver.Selected);
         xmlwriter.SetValue("gui", "language", btnLanguage.Label);
         xmlwriter.SetValue("skin", "name", btnSkin.Label);
     }
     Config.SkinName = btnSkin.Label;
 }
Beispiel #15
0
        /// <summary>
        ///
        /// </summary>
        public override void SaveSettings()
        {
            using (Settings xmlwriter = new MPSettings())
            {
                xmlwriter.SetValue("dvdplayer", "path", fileNameTextBox.Text);
                xmlwriter.SetValue("dvdplayer", "arguments", parametersTextBox.Text);

                xmlwriter.SetValueAsBool("dvdplayer", "internal", !internalPlayerCheckBox.Checked);
                xmlwriter.SetValueAsBool("dvdplayer", "mediainfoused", useMediaInfo.Checked);
            }
        }
Beispiel #16
0
        /// <summary>
        ///
        /// </summary>
        public override void SaveSettings()
        {
            using (Settings xmlwriter = new MPSettings())
            {
                xmlwriter.SetValue("dvdplayer", "audiolanguage", defaultAudioLanguageComboBox.Text);
                xmlwriter.SetValue("dvdplayer", "subtitlelanguage", defaultSubtitleLanguageComboBox.Text);

                xmlwriter.SetValueAsBool("dvdplayer", "showsubtitles", showSubtitlesCheckBox.Checked);
                xmlwriter.SetValueAsBool("dvdplayer", "showclosedcaptions", showClosedCaptions.Checked);
            }
        }
Beispiel #17
0
 /// <summary>
 /// Store the settings, if the user wants it
 /// </summary>
 protected void SaveSettings()
 {
     if (_rememberLastValues)
     {
         using (Settings xmlreader = new MPSettings())
         {
             xmlreader.SetValueAsBool("mytv", "teletextHidden", _hiddenMode);
             xmlreader.SetValueAsBool("mytv", "teletextTransparent", _transparentMode);
         }
     }
 }
Beispiel #18
0
        public override void SaveSettings()
        {
            using (Settings xmlwriter = new MPSettings())
            {
                xmlwriter.SetValueAsBool("general", "autochangerefreshrate", chkEnableDynamicRR.Checked);
                xmlwriter.SetValueAsBool("general", "notify_on_refreshrate", chkNotifyOnRR.Checked);
                xmlwriter.SetValueAsBool("general", "use_default_hz", chkUseDefaultRR.Checked);
                xmlwriter.SetValueAsBool("general", "devicereset", chkUseDeviceReset.Checked);
                xmlwriter.SetValueAsBool("general", "force_refresh_rate", chkForceRR.Checked);
                xmlwriter.SetValue("general", "default_hz", sDefaultHz);
                xmlwriter.SetValue("general", "default_hz_name", sDefaultHzName);

                /*
                 * // example
                 * <entry name="refreshrate01_ext">C:\\Program Files\\displaychanger\\dc.exe -refreshrate=60 -apply -quiet</entry>
                 * <entry name="refreshrate01_name">NTSC</entry>
                 * <entry name="ntsc_fps">29.97;30</entry>
                 * <entry name="ntsc_hz">60</entry>
                 */

                //delete all refreshrate entries, then re-add them.
                Settings xmlreader = new MPSettings();
                for (int i = 1; i < 100; i++)
                {
                    string name = xmlreader.GetValueAsString("general", "refreshrate0" + Convert.ToString(i) + "_name", "");

                    if (string.IsNullOrEmpty(name))
                    {
                        continue;
                    }

                    xmlwriter.RemoveEntry("general", "refreshrate0" + Convert.ToString(i) + "_name");
                    xmlwriter.RemoveEntry("general", name + "_fps");
                    xmlwriter.RemoveEntry("general", name + "_hz");
                    xmlwriter.RemoveEntry("general", "refreshrate0" + Convert.ToString(i) + "_ext");
                }

                int j = 1;
                foreach (DataGridViewRow row in dataGridViewRR.Rows)
                {
                    string name   = (string)row.Cells[0].Value;
                    string fps    = (string)row.Cells[1].Value;
                    string hz     = (string)row.Cells[2].Value;
                    string extCmd = (string)row.Cells[3].Value;

                    xmlwriter.SetValue("general", "refreshrate0" + Convert.ToString(j) + "_name", name);
                    xmlwriter.SetValue("general", name + "_fps", fps);
                    xmlwriter.SetValue("general", name + "_hz", hz);
                    xmlwriter.SetValue("general", "refreshrate0" + Convert.ToString(j) + "_ext", extCmd);
                    j++;
                }
            }
        }
Beispiel #19
0
        public override void SaveSettings()
        {
            using (Settings xmlwriter = new MPSettings())
            {
                xmlwriter.SetValue("general", "loglevel", cbDebug.SelectedIndex);
                xmlwriter.SetValue("general", "ThreadPriority", mpThreadPriority.SelectedItem.ToString());

                xmlwriter.SetValueAsBool("general", "watchdogEnabled", checkBoxEnableWatchdog.Checked);
                xmlwriter.SetValueAsBool("general", "restartOnError", checkBoxAutoRestart.Checked);
                xmlwriter.SetValue("general", "restart delay", numericUpDownDelay.Value);
            }
        }
Beispiel #20
0
 private void SaveSettings()
 {
   using (var xmlwriter = new MPSettings())
   {
     xmlwriter.SetValueAsBool("lastfm:test", "autoDJ", chkAutoDJ.Checked);
     xmlwriter.SetValueAsBool("lastfm:test", "allowDiffVersions", chkDiferentVersions.Checked);
     xmlwriter.SetValueAsBool("lastfm:test", "avoidDuplicates", chkAvoidDuplicates.Checked);
     xmlwriter.SetValue("lastfm:test", "randomness", numRandomness.Value);
     xmlwriter.SetValueAsBool("lastfm:test", "announce", chkAnnounce.Checked);
     xmlwriter.SetValueAsBool("lastfm:test", "scrobble", chkScrobble.Checked);
   }      
 }
 public override void SaveSettings()
 {
     using (Settings xmlwriter = new MPSettings())
     {
         xmlwriter.SetValueAsBool("daemon", "enabled", checkBoxDaemonTools.Checked);
         xmlwriter.SetValue("daemon", "path", textBoxDaemonTools.Text);
         xmlwriter.SetValue("daemon", "extensions", textBoxExtensions.Text);
         xmlwriter.SetValue("daemon", "drive", (string)comboBoxDrive.SelectedItem);
         xmlwriter.SetValue("daemon", "driveNo", Int32.Parse((string)comboDriveNo.SelectedItem));
         xmlwriter.SetValueAsBool("daemon", "askbeforeplaying", checkBoxAskBeforePlaying.Checked);
     }
 }
Beispiel #22
0
 private void SaveSettings()
 {
     using (var xmlwriter = new MPSettings())
     {
         xmlwriter.SetValueAsBool("lastfm:test", "autoDJ", chkAutoDJ.Checked);
         xmlwriter.SetValueAsBool("lastfm:test", "allowDiffVersions", chkDiferentVersions.Checked);
         xmlwriter.SetValueAsBool("lastfm:test", "avoidDuplicates", chkAvoidDuplicates.Checked);
         xmlwriter.SetValue("lastfm:test", "randomness", numRandomness.Value);
         xmlwriter.SetValueAsBool("lastfm:test", "announce", chkAnnounce.Checked);
         xmlwriter.SetValueAsBool("lastfm:test", "scrobble", chkScrobble.Checked);
     }
 }
 public void SaveSettings()
 {
   using (Settings writer = new MPSettings())
   {
     writer.SetValueAsBool("psclientplugin", "homeonly", homeOnlyCheckBox.Checked);
     writer.SetValueAsBool("psclientplugin", "extensivelogging", extLogCheckBox.Checked);
     writer.SetValue("psclientplugin", "shutdownmode", shutModeComboBox.SelectedIndex.ToString());
     writer.SetValueAsBool("psclientplugin", "forceshutdown", forceCheckBox.Checked);
     writer.SetValueAsBool("psclientplugin", "shutdownenabled", enableShutdownCheckBox.Checked);
     writer.SetValue("psclientplugin", "idletimeout", idleNumericUpDown.Value);
   }
 }
        private void SaveSettings()
        {
            using (Settings xmlwriter = new MPSettings())
            {
                xmlwriter.SetValueAsBool("general", "autochangerefreshrate", btnEnableDynamicRefreshRate.Selected);
                xmlwriter.SetValueAsBool("general", "notify_on_refreshrate", btnNotify.Selected);
                xmlwriter.SetValueAsBool("general", "use_default_hz", btnUseDefaultRefreshRate.Selected);
                xmlwriter.SetValueAsBool("general", "devicereset", btnUseDeviceReset.Selected);
                xmlwriter.SetValueAsBool("general", "force_refresh_rate", btnForceRefreshRateChange.Selected);

                if (_defaultHzIndex >= 0)
                {
                    string rate = RefreshRateData(lcRefreshRatesList.ListItems[_defaultHzIndex]).Refreshrate;
                    xmlwriter.SetValue("general", "default_hz", rate);
                }
                else
                {
                    xmlwriter.SetValue("general", "default_hz", string.Empty);
                }

                //delete all refreshrate entries, then re-add them.
                Settings xmlreader = new MPSettings();
                for (int i = 1; i < 100; i++)
                {
                    string name = xmlreader.GetValueAsString("general", "refreshrate0" + Convert.ToString(i) + "_name", "");

                    if (string.IsNullOrEmpty(name))
                    {
                        continue;
                    }

                    xmlwriter.RemoveEntry("general", name + "_fps");
                    xmlwriter.RemoveEntry("general", name + "_hz");
                    xmlwriter.RemoveEntry("general", "refreshrate0" + Convert.ToString(i) + "_ext");
                    xmlwriter.RemoveEntry("general", "refreshrate0" + Convert.ToString(i) + "_name");
                }

                int j = 1;
                foreach (GUIListItem item in lcRefreshRatesList.ListItems)
                {
                    string name   = RefreshRateData(item).Name;
                    string fps    = RefreshRateData(item).FrameRate;
                    string hz     = RefreshRateData(item).Refreshrate;
                    string extCmd = RefreshRateData(item).Action;

                    xmlwriter.SetValue("general", name + "_fps", fps);
                    xmlwriter.SetValue("general", name + "_hz", hz);
                    xmlwriter.SetValue("general", "refreshrate0" + Convert.ToString(j) + "_ext", extCmd);
                    xmlwriter.SetValue("general", "refreshrate0" + Convert.ToString(j) + "_name", name);
                    j++;
                }
            }
        }
 public void SaveSettings()
 {
     using (Settings writer = new MPSettings())
     {
         writer.SetValueAsBool("psclientplugin", "homeonly", homeOnlyCheckBox.Checked);
         writer.SetValueAsBool("psclientplugin", "extensivelogging", extLogCheckBox.Checked);
         writer.SetValue("psclientplugin", "shutdownmode", shutModeComboBox.SelectedIndex.ToString());
         writer.SetValueAsBool("psclientplugin", "forceshutdown", forceCheckBox.Checked);
         writer.SetValueAsBool("psclientplugin", "shutdownenabled", enableShutdownCheckBox.Checked);
         writer.SetValue("psclientplugin", "idletimeout", idleNumericUpDown.Value);
     }
 }
        /// <summary>
        ///
        /// </summary>
        public override void SaveSettings()
        {
            using (Settings xmlwriter = new MPSettings())
            {
                xmlwriter.SetValue("bdplayer", "path", fileNameTextBox.Text);
                xmlwriter.SetValue("bdplayer", "arguments", parametersTextBox.Text);

                xmlwriter.SetValueAsBool("bdplayer", "mediainfoused", useMediaInfoBD.Checked);
                xmlwriter.SetValueAsBool("bdplayer", "useforbluray", useExternalPlayerForBluRay.Checked);
                xmlwriter.SetValueAsBool("bdplayer", "useInternalBDPlayer", useInternalBDPlayer.Checked);
            }
        }
Beispiel #27
0
    public override void SaveSettings()
    {
      using (Settings xmlwriter = new MPSettings())
      {
        xmlwriter.SetValue("general", "loglevel", cbDebug.SelectedIndex);
        xmlwriter.SetValue("general", "ThreadPriority", mpThreadPriority.SelectedItem.ToString());

        xmlwriter.SetValueAsBool("general", "watchdogEnabled", checkBoxEnableWatchdog.Checked);
        xmlwriter.SetValueAsBool("general", "restartOnError", checkBoxAutoRestart.Checked);
        xmlwriter.SetValue("general", "restart delay", numericUpDownDelay.Value);
      }
    }
Beispiel #28
0
        public override void SaveSettings()
        {
            using (Settings xmlwriter = new MPSettings())
            {
                xmlwriter.SetValueAsBool("USBUIRT", "internal", inputCheckBox.Checked);
                xmlwriter.SetValueAsBool("USBUIRT", "external", outputCheckBox.Checked);
                xmlwriter.SetValueAsBool("USBUIRT", "is3digit", digitCheckBox.Checked);
                xmlwriter.SetValueAsBool("USBUIRT", "needsenter", enterCheckBox.Checked);

                xmlwriter.SetValue("USBUIRT", "repeatcount", commandRepeatNumUpDn.Value);
                xmlwriter.SetValue("USBUIRT", "commanddelay", interCommandDelayNumUpDn.Value);
            }
        }
Beispiel #29
0
    private void SaveSettings()
    {
      using (Settings xmlreader = new MPSettings())
      {
        xmlreader.SetValue("tvservice", "hostname", _serverHostName);
        xmlreader.SetValue("tvservice", "preferredlanguages", _preferredLanguages);
        xmlreader.SetValueAsBool("tvservice", "preferac3", _preferAC3);

        xmlreader.SetValueAsBool("tvservice", "rebuildgraphOnNewAudioSpecs", _rebuildGraphOnNewAudioSpecs);
        xmlreader.SetValueAsBool("tvservice", "rebuildgraphOnNewVideoSpecs", _rebuildGraphOnNewVideoSpecs);
        xmlreader.SetValueAsBool("tvservice", "avoidSeeking", _avoidSeeking);
      }
    }
 private void okButton_Click(object sender, EventArgs e)
 {
     this.DialogResult = DialogResult.OK;
     using (Settings xmlwriter = new MPSettings())
     {
         xmlwriter.SetValue("subtitles", "subPicsBufferAhead", subPicsAheadUpDown.Value);
         xmlwriter.SetValue("subtitles", "textureSize", textureComboBox.SelectedItem);
         xmlwriter.SetValue("subtitles", "adjustY", posYUpDown.Value);
         xmlwriter.SetValueAsBool("subtitles", "pow2tex", pow2texCheckBox.Checked);
         xmlwriter.SetValueAsBool("subtitles", "disableAnimation", disableAnimCheckBox.Checked);
     }
     this.Hide();
 }
 private void SaveSettings()
 {
     if (!_settingsSaved)
     {
         _settingsSaved = true;
         using (Settings xmlwriter = new MPSettings())
         {
             xmlwriter.SetValueAsBool("general", "IdleTimer", btnScreenSaverEnabled.Selected);
             xmlwriter.SetValue("general", "IdleTimeValue", _screenSaverDelay);
             xmlwriter.SetValueAsBool("general", "IdleBlanking", cmBlankScreen.Selected);
         }
     }
 }
Beispiel #32
0
 public override void SaveSettings()
 {
     using (Settings xmlwriter = new MPSettings())
     {
         xmlwriter.SetValue("thumbnails", "quality", trackBarQuality.Value);
         xmlwriter.SetValueAsBool("thumbnails", "musicfolderondemand", checkBoxFolderThumbOnDemand.Checked);
         xmlwriter.SetValueAsBool("thumbnails", "picturenolargethumbondemand", checkBoxPicThumbOnDemand.Checked);
         xmlwriter.SetValueAsBool("thumbnails", "videoondemand", checkBoxVideoThumbs.Checked);
         xmlwriter.SetValueAsBool("thumbnails", "videosharepreview", checkBoxShareThumb.Checked);
         xmlwriter.SetValue("thumbnails", "videothumbcols", numericUpDownThumbColumns.Value);
         xmlwriter.SetValue("thumbnails", "videothumbrows", numericUpDownThumbRows.Value);
     }
 }
Beispiel #33
0
        private void SaveSettings()
        {
            using (Settings xmlreader = new MPSettings())
            {
                xmlreader.SetValue("tvservice", "hostname", _serverHostName);
                xmlreader.SetValue("tvservice", "preferredlanguages", _preferredLanguages);
                xmlreader.SetValueAsBool("tvservice", "preferac3", _preferAC3);

                xmlreader.SetValueAsBool("tvservice", "rebuildgraphOnNewAudioSpecs", _rebuildGraphOnNewAudioSpecs);
                xmlreader.SetValueAsBool("tvservice", "rebuildgraphOnNewVideoSpecs", _rebuildGraphOnNewVideoSpecs);
                xmlreader.SetValueAsBool("tvservice", "avoidSeeking", _avoidSeeking);
            }
        }
 public override void SaveSettings()
 {
     using (Settings xmlreader = new MPSettings())
     {
         xmlreader.SetValueAsBool("general", "IdleTimer", checkBoxEnableScreensaver.Checked);
         xmlreader.SetValue("general", "IdleTimeValue", numericUpDownDelay.Value);
         xmlreader.SetValueAsBool("general", "IdleBlanking", radioBtnBlankScreen.Checked);
         xmlreader.SetValueAsBool("general", "IdlePlugin", radioButtonLoadPlugin.Checked);
         if (loadedPlugins.Count > 0 & pluginsComboBox.SelectedIndex > -1)
         {
             xmlreader.SetValue("general", "IdlePluginWindow", loadedPlugins[pluginsComboBox.SelectedIndex].WindowId);
         }
     }
 }
 /// <summary>
 /// Saves movie player settings and codec info.
 /// </summary>
 public override void SaveSettings()
 {
     if (_init == false)
     {
         return;
     }
     using (Settings xmlwriter = new MPSettings())
     {
         xmlwriter.SetValue("movieplayer", "path", fileNameTextBox.Text);
         xmlwriter.SetValue("movieplayer", "arguments", parametersTextBox.Text);
         xmlwriter.SetValueAsBool("movieplayer", "internal", !externalPlayerCheckBox.Checked);
         xmlwriter.SetValueAsBool("movieplayer", "wmvaudio", wmvCheckBox.Checked);
     }
 }
    public override void DoModal(int dwParentId)
    {
      int nagCount;
      using (Settings xmlreader = new MPSettings())
      {
        nagCount = xmlreader.GetValueAsInt("general", "skinobsoletecount", 0);
      }

      //if (chkIgnore != null)
      //{
        chkIgnore.Visible = nagCount > 4;
      //}
      
      GUIPropertyManager.SetProperty("#userskin", _userSkin);
      _timeLeft = 0;
      timeStart = DateTime.Now;
      UpdateCountDown(0);
      base.DoModal(dwParentId);
      GUIPropertyManager.SetProperty("#userskin", "");
      GUIPropertyManager.SetProperty("#countdownseconds", "");

      if (RevertToUserSkin)
      {
        nagCount++; 
      }

      using (Settings xmlwriter = new MPSettings())
      {
        xmlwriter.SetValueAsBool("general", "dontshowskinversion", chkIgnore.Selected);
        xmlwriter.SetValue("general", "skinobsoletecount", nagCount);
      }
    }
 private void SaveSettings()
 {
   using (Settings xmlwriter = new MPSettings())
   {
     xmlwriter.SetValueAsBool("filemenu", "enabled", btnFileMenu.Selected);
     xmlwriter.SetValue("filemenu", "pincode", Utils.EncryptPassword(_pin));
   }
 }
Beispiel #38
0
 public override void SaveSettings()
 {
   using (Settings xmlwriter = new MPSettings())
   {
     xmlwriter.SetValueAsBool("filemenu", "enabled", chbEnabled.Checked);
     xmlwriter.SetValue("filemenu", "pincode", Util.Utils.EncryptPassword(textPinCodeBox.Text));
     xmlwriter.SetValue("filemenu", "trashcan", textTrashcanFolder.Text);
   }
 }
 private void SaveSettings()
 {
   using (Settings xmlwriter = new MPSettings())
   {
     xmlwriter.SetValue("gui", "language", _btnLanguage.Label);
     xmlwriter.SetValue("skin", "name", _btnSkin.Label);
     xmlwriter.SetValueAsBool("gui", "myprefix", _btnLanguagePrefix.Selected);
   }
   Config.SkinName = _btnSkin.Label;
 }
Beispiel #40
0
    /// <summary>
    /// 
    /// </summary>
    public override void SaveSettings()
    {
      using (Settings xmlwriter = new MPSettings())
      {
        xmlwriter.SetValue("dvdplayer", "path", fileNameTextBox.Text);
        xmlwriter.SetValue("dvdplayer", "arguments", parametersTextBox.Text);

        xmlwriter.SetValueAsBool("dvdplayer", "internal", !internalPlayerCheckBox.Checked);
        xmlwriter.SetValueAsBool("dvdplayer", "mediainfoused", useMediaInfo.Checked);
      }
    }
Beispiel #41
0
    /// <summary>
    /// 
    /// </summary>
    public override void SaveSettings()
    {
      using (Settings xmlwriter = new MPSettings())
      {
        xmlwriter.SetValueAsBool("dvdplayer", "pixelratiocorrection", pixelRatioCheckBox.Checked);
        xmlwriter.SetValue("dvdplayer", "armode", aspectRatioComboBox.Text);
        xmlwriter.SetValue("dvdplayer", "displaymode", displayModeComboBox.Text);

        xmlwriter.SetValue("dvdplayer", "defaultar", defaultZoomModeComboBox.SelectedItem);
      }
    }
 public override void SaveSettings()
 {
   if (_init == false) return;
   using (Settings xmlwriter = new MPSettings())
   {
     xmlwriter.SetValueAsBool("general", "nonsquare", checkboxMpNonsquare.Checked);
     xmlwriter.SetValueAsBool("general", "exclusivemode", checkboxDXEclusive.Checked);
     xmlwriter.SetValue("general", "dx9filteringmode", mpVMR9FilterMethod.Text);
     xmlwriter.SetValueAsBool("general", "usevrm9forwebstreams", checkBoxVMRWebStreams.Checked);
     xmlwriter.SetValueAsBool("general", "dx9decimatemask", checkBoxDecimateMask.Checked);
     xmlwriter.SetValueAsBool("general", "useEVRenderer", radioButtonEVR.Checked);
   }
 }
    private void btnContinue_Click(object sender, EventArgs e)
    {
      if (checkBoxConfirmed.Checked)
      {
        this.DialogResult = DialogResult.OK;
      }

      using (Settings xmlwriter = new MPSettings())
      {
        xmlwriter.SetValueAsBool("general", "AdvancedConfigMode", radioButtonAdvanced.Checked);
      }

      this.Close();
    }
 private void SaveSettings()
 {
   // Don't save setting if skin value was not set
   if (_btnSkin != null && _btnSkin.Label != "Skin:")
   {
     using (Settings xmlwriter = new MPSettings())
     {
       xmlwriter.SetValue("gui", "language", _btnLanguage.Label);
       xmlwriter.SetValue("skin", "name", _btnSkin.Label);
       xmlwriter.SetValueAsBool("gui", "myprefix", _btnLanguagePrefix.Selected);
     }
     Config.SkinName = _btnSkin.Label;
   }
 }
Beispiel #45
0
 /// <summary>
 /// Saves movie player settings and codec info.
 /// </summary>
 public override void SaveSettings()
 {
   if (_init == false)
   {
     return;
   }
   using (Settings xmlwriter = new MPSettings())
   {
     xmlwriter.SetValueAsBool("movieplayer", "autodecodersettings", autoDecoderSettings.Checked);
     xmlwriter.SetValueAsBool("movieplayer", "forcesourcesplitter", ForceSourceSplitter.Checked);
     xmlwriter.SetValueAsBool("movieplayer", "usemoviecodects", mpCheckBoxTS.Checked);
     xmlwriter.SetValue("movieplayer", "audiorenderer", audioRendererComboBox.Text);
     // Set codecs
     xmlwriter.SetValue("movieplayer", "mpeg2audiocodec", audioCodecComboBox.Text);
     xmlwriter.SetValue("movieplayer", "mpeg2videocodec", videoCodecComboBox.Text);
     xmlwriter.SetValue("movieplayer", "h264videocodec", h264videoCodecComboBox.Text);
     xmlwriter.SetValue("movieplayer", "vc1ivideocodec", vc1ivideoCodecComboBox.Text);
     xmlwriter.SetValue("movieplayer", "vc1videocodec", vc1videoCodecComboBox.Text);
     xmlwriter.SetValue("movieplayer", "xvidvideocodec", xvidvideoCodecComboBox.Text);
     xmlwriter.SetValue("movieplayer", "aacaudiocodec", aacAudioCodecComboBox.Text);
     xmlwriter.SetValue("movieplayer", "splitterfilter", SplitterComboBox.Text);
     xmlwriter.SetValue("movieplayer", "splitterfilefilter", SplitterFileComboBox.Text);
     xmlwriter.SetValueAsBool("movieplayer", "settinglavplitter", settingLAVSlitter);
   }
 }
    public override void SaveSettings()
    {
      CheckAndResetSettings();
      bool rtsp = singleSeat ? mpUseRtspCheckBox.Checked : !mpUseRtspCheckBox.Checked;

      using (Settings xmlwriter = new MPSettings())
      {
        xmlwriter.SetValueAsBool("tvservice", "usertsp", rtsp);
        xmlwriter.SetValue("tvservice", "recordingpath", textBoxRecording.Text);
        xmlwriter.SetValue("tvservice", "timeshiftingpath", textBoxTimeshifting.Text);
        xmlwriter.SetValueAsBool("tvservice", "AdvancedOptions", true);
      }
      DebugSettings.DoNotAllowSlowMotionDuringZapping = mpDoNotAllowSlowMotionDuringZappingCheckBox.Checked;
    }
    private void SaveSettings()
    {
      using (Settings xmlwriter = new MPSettings())
      {
        xmlwriter.SetValueAsBool("general", "autochangerefreshrate", btnEnableDynamicRefreshRate.Selected);
        xmlwriter.SetValueAsBool("general", "notify_on_refreshrate", btnNotify.Selected);
        xmlwriter.SetValueAsBool("general", "use_default_hz", btnUseDefaultRefreshRate.Selected);
        xmlwriter.SetValueAsBool("general", "devicereset", btnUseDeviceReset.Selected);
        xmlwriter.SetValueAsBool("general", "force_refresh_rate", btnForceRefreshRateChange.Selected);
        
        if (_defaultHzIndex >= 0)
        {
          string rate = RefreshRateData(lcRefreshRatesList.ListItems[_defaultHzIndex]).Refreshrate;
          xmlwriter.SetValue("general", "default_hz", rate);
        }
        else
        {
          xmlwriter.SetValue("general", "default_hz", string.Empty);
        }

        //delete all refreshrate entries, then re-add them.
        Settings xmlreader = new MPSettings();
        for (int i = 1; i < 100; i++)
        {
          string name = xmlreader.GetValueAsString("general", "refreshrate0" + Convert.ToString(i) + "_name", "");

          if (string.IsNullOrEmpty(name))
          {
            continue;
          }

          xmlwriter.RemoveEntry("general", name + "_fps");
          xmlwriter.RemoveEntry("general", name + "_hz");
          xmlwriter.RemoveEntry("general", "refreshrate0" + Convert.ToString(i) + "_ext");
          xmlwriter.RemoveEntry("general", "refreshrate0" + Convert.ToString(i) + "_name");
        }

        int j = 1;
        foreach (GUIListItem item in lcRefreshRatesList.ListItems)
        {
          string name = RefreshRateData(item).Name;
          string fps = RefreshRateData(item).FrameRate;
          string hz = RefreshRateData(item).Refreshrate;
          string extCmd = RefreshRateData(item).Action;

          xmlwriter.SetValue("general", name + "_fps", fps);
          xmlwriter.SetValue("general", name + "_hz", hz);
          xmlwriter.SetValue("general", "refreshrate0" + Convert.ToString(j) + "_ext", extCmd);
          xmlwriter.SetValue("general", "refreshrate0" + Convert.ToString(j) + "_name", name);
          j++;
        }
      }
    }
Beispiel #48
0
        private static void LoadSettings()
        {
            if (!_settingsLoaded)
            {
                Log.Debug("Tvhome: LoadSettings()");
                using (Settings xmlreader = new MPSettings())
                {
                    if (PluginMain.DisableRadio)
                    {
                        xmlreader.SetValueAsBool("pluginswindows", "ArgusTV.UI.MediaPortal.RadioHome", false);
                        xmlreader.SetValueAsBool("home", "ARGUS Radio", false);
                        xmlreader.SetValueAsBool("myplugins", "ARGUS Radio", false);
                    }

                    string strValue = xmlreader.GetValueAsString("mytv", "defaultar", "Normal");
                    _preNotifyConfig = xmlreader.GetValueAsInt("mytv", "notifyTVBefore", 300);
                    _notifyTVTimeout = xmlreader.GetValueAsInt("mytv", "notifyTVTimeout", 15);
                    _playNotifyBeep = xmlreader.GetValueAsBool("mytv", "notifybeep", true);
                    _enableRecNotification = xmlreader.GetValueAsBool("mytv", "enableRecNotifier", false);
                    _autoTurnOnTv = xmlreader.GetValueAsBool("mytv", "autoturnontv", false);
                    _showlastactivemodule = xmlreader.GetValueAsBool("general", "showlastactivemodule", false);
                    GUIGraphicsContext.ARType = global::MediaPortal.Util.Utils.GetAspectRatio(strValue);
                    _settingsLoaded = true;
                }
            }
        }
Beispiel #49
0
    private static void AddVideoFiles(string path, ref ArrayList availableFiles)
    {
      //
      // Count the files in the current directory
      //
      bool currentCreateVideoThumbs = false;

      try
      {
        VirtualDirectory dir = new VirtualDirectory();
        dir.SetExtensions(Util.Utils.VideoExtensions);
        // Temporary disable thumbcreation
        using (Profile.Settings xmlreader = new MPSettings())
        {
          currentCreateVideoThumbs = xmlreader.GetValueAsBool("thumbnails", "videoondemand", true);
        }
        using (Profile.Settings xmlwriter = new MPSettings())
        {
          xmlwriter.SetValueAsBool("thumbnails", "videoondemand", false);
        }

        List<GUIListItem> items = dir.GetDirectoryUnProtectedExt(path, true);

        foreach (GUIListItem item in items)
        {
          if (item.IsFolder)
          {
            if (item.Label != "..")
            {
              if (item.Path.ToUpperInvariant().IndexOf("VIDEO_TS") >= 0)
              {
                string strFile = String.Format(@"{0}\VIDEO_TS.IFO", item.Path);
                availableFiles.Add(strFile);
              }
              if (item.Path.ToUpperInvariant().IndexOf("BDMV") >= 0)
              {
                string strFile = String.Format(@"{0}\index.bdmv", item.Path);
                availableFiles.Add(strFile);
              }
              else
              {
                AddVideoFiles(item.Path, ref availableFiles);
              }
            }
          }
          else
          {
            availableFiles.Add(item.Path);
          }
        }
      }
      catch (Exception e)
      {
        Log.Info("Exception counting files:{0}", e);
        // Ignore
      }
      finally
      {
        // Restore thumbcreation setting
        using (Profile.Settings xmlwriter = new MPSettings())
        {
          xmlwriter.SetValueAsBool("thumbnails", "videoondemand", currentCreateVideoThumbs);
        }
      }
    }
Beispiel #50
0
    public override void SaveSettings()
    {
      using (Settings xmlwriter = new MPSettings())
      {
        xmlwriter.SetValueAsBool("movies", "repeat", repeatPlaylistCheckBox.Checked);
        xmlwriter.SetValue("movies", "playlists", folderNameTextBox.Text);
        xmlwriter.SetValue("movies", "playallinfolder", comboBoxPlayAll.SelectedIndex);
        xmlwriter.SetValueAsBool("movies", "keepfolderstogether", chbKeepFoldersTogether.Checked);

        xmlwriter.SetValueAsBool("movies", "markwatched", checkBoxShowWatched.Checked);
        xmlwriter.SetValue("movies", "playedpercentagewatched", playedPercentageTrackBar.Value);
        
        xmlwriter.SetValueAsBool("comskip", "automaticskip", comSkipCheckBox.Checked);

        xmlwriter.SetValue("subtitles", "engine", subEnginesCombo.SelectedItem);
        xmlwriter.SetValue("subtitles", "paths", subPaths.Text);

        xmlwriter.SetValue("subtitles", "shadow", shadowDepthUpDown.Value);
        xmlwriter.SetValue("subtitles", "borderWidth", borderWidthUpDown.Value);
        xmlwriter.SetValueAsBool("subtitles", "borderOutline", borderOutlineRadioButton.Checked);

        foreach (CultureInfo ci in CultureInfo.GetCultures(CultureTypes.NeutralCultures))
        {
          if (ci.EnglishName == defaultSubtitleLanguageComboBox.Text)
          {
            xmlwriter.SetValue("subtitles", "language", ci.Name);
          }
        }

        xmlwriter.SetValue("subtitles", "fontface", fontName);
        xmlwriter.SetValue("subtitles", "color", fontColor);
        xmlwriter.SetValueAsBool("subtitles", "bold", fontIsBold);
        xmlwriter.SetValue("subtitles", "fontsize", fontSize);
        xmlwriter.SetValue("subtitles", "charset", fontCharset);

        xmlwriter.SetValue("subtitles", "delayInterval", delayTextBox.Value);
        xmlwriter.SetValue("FFDShow", "audiodelayInterval", delayVideoTextBox.Value);
        xmlwriter.SetValueAsBool("subtitles", "saveNever", saveNeverRadioButton.Checked);
        xmlwriter.SetValueAsBool("subtitles", "saveAsk", saveAskRadioButton.Checked);

        xmlwriter.SetValueAsBool("subtitles", "subStyleOverride", subStyleOverrideCheckBox.Checked);
        xmlwriter.SetValueAsBool("subtitles", "subPosRelative", subPosRelativeCheckBox.Checked);

        foreach (CultureInfo ci in CultureInfo.GetCultures(CultureTypes.NeutralCultures))
        {
          if (ci.EnglishName == defaultAudioLanguageComboBox.Text)
          {
            xmlwriter.SetValue("movieplayer", "audiolanguage", ci.Name);
          }
        }
        if (subtitlesSelectionComboBox.SelectedIndex == 0) //"Subtitles won't be auto loaded"
        {
          xmlwriter.SetValueAsBool("subtitles", "selectionoff", true);
          xmlwriter.SetValueAsBool("subtitles", "enabled", false);
          xmlwriter.SetValueAsBool("subtitles", "autoloadSubtitle", false);
          xmlwriter.SetValue("subtitles", "selection", subtitlesSelectionComboBox.SelectedItem);
        }
        else if (subtitlesSelectionComboBox.SelectedIndex == 1) //"Subtitles will be auto loaded by language preference"
        {
          xmlwriter.SetValueAsBool("subtitles", "selectionoff", false);
          xmlwriter.SetValueAsBool("subtitles", "enabled", true);
          xmlwriter.SetValueAsBool("subtitles", "autoloadSubtitle", false);
          xmlwriter.SetValue("subtitles", "selection", subtitlesSelectionComboBox.SelectedItem);
        }
        else if (subtitlesSelectionComboBox.SelectedIndex == 2) //"Subtitles will be auto loaded by first available"
        {
          xmlwriter.SetValueAsBool("subtitles", "selectionoff", false);
          xmlwriter.SetValueAsBool("subtitles", "enabled", true);
          xmlwriter.SetValueAsBool("subtitles", "autoloadSubtitle", true);
          xmlwriter.SetValue("subtitles", "selection", subtitlesSelectionComboBox.SelectedItem);
        }
        else if (subtitlesSelectionComboBox.SelectedIndex == 3) //"Subtitles will only display forced subtitles *"
        {
          xmlwriter.SetValueAsBool("subtitles", "selectionoff", false);
          xmlwriter.SetValueAsBool("subtitles", "enabled", false);
          xmlwriter.SetValueAsBool("subtitles", "autoloadSubtitle", false);
          xmlwriter.SetValue("subtitles", "selection", subtitlesSelectionComboBox.SelectedItem);
        }
        xmlwriter.SetValueAsBool("movieplayer", "audiodefaultlanguage", audioDefaultCheckBox.Checked);
        xmlwriter.SetValueAsBool("movieplayer", "streamlavselection", streamLAVSelectionCheckBox.Checked);
      }
    }
Beispiel #51
0
 public void ShowPlugin()
 {
     using (Settings xmlwriter = new MPSettings())
     {
         SetupForm setupForm = new SetupForm();
         setupForm.ServerSettings = PluginMain.LoadServerSettings();
         setupForm.NoClientStandbyWhenNotHome = PluginMain.NoClientStandbyWhenNotHome;
         setupForm.PreferRtspForLiveTv = PluginMain.PreferRtspForLiveTv;
         setupForm.PlayRecordingsOverRtsp = PluginMain.PlayRecordingsOverRtsp;
         setupForm.AutoStreamingMode = PluginMain.AutoStreamingMode;
         setupForm.DisableRadio = PluginMain.DisableRadio;
         if (setupForm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             xmlwriter.SetValue(_settingSection, SettingName.Server, setupForm.ServerSettings.ServerName);
             xmlwriter.SetValue(_settingSection, SettingName.TcpPort, setupForm.ServerSettings.Port);
             xmlwriter.SetValue(_settingSection, SettingName.MacAddresses, setupForm.ServerSettings.WakeOnLan.MacAddresses);
             xmlwriter.SetValue(_settingSection, SettingName.IPAddress, setupForm.ServerSettings.WakeOnLan.IPAddress);
             xmlwriter.SetValueAsBool(_settingSection, SettingName.UseWakeOnLan, setupForm.ServerSettings.WakeOnLan.Enabled);
             xmlwriter.SetValue(_settingSection, SettingName.WakeOnLanTimeoutSeconds, setupForm.ServerSettings.WakeOnLan.TimeoutSeconds);
             xmlwriter.SetValueAsBool(_settingSection, SettingName.NoClientStandbyWhenNotHome, setupForm.NoClientStandbyWhenNotHome);
             xmlwriter.SetValueAsBool(_settingSection, SettingName.AvoidRtspForLiveTv, !setupForm.PreferRtspForLiveTv);
             xmlwriter.SetValueAsBool(_settingSection, SettingName.PlayRecordingsOverRtsp, setupForm.PlayRecordingsOverRtsp);
             xmlwriter.SetValueAsBool(_settingSection, SettingName.AutoStreamingMode, setupForm.AutoStreamingMode);
             xmlwriter.SetValueAsBool(_settingSection, SettingName.IsSingleSeat, setupForm.IsSingleSeat);
             xmlwriter.SetValueAsBool(_settingSection, SettingName.DisableRadio, setupForm.DisableRadio);
             PluginMain.ClearCachedBooleanSettings();
         }
     }
 }
Beispiel #52
0
    public override void SaveSettings()
    {
      using (Settings xmlwriter = new MPSettings())
      {
        string prefLangs = "";
        xmlwriter.SetValue("tvservice", "hostname", mpTextBoxHostname.Text);
        xmlwriter.SetValueAsBool("tvservice", "preferac3", mpCheckBoxPrefAC3.Checked);
        xmlwriter.SetValueAsBool("tvservice", "preferAudioTypeOverLang", mpCheckBoxPrefAudioOverLang.Checked);

        xmlwriter.SetValueAsBool("tvservice", "dvbbitmapsubtitles", mpCheckBoxEnableDVBSub.Checked);
        xmlwriter.SetValueAsBool("tvservice", "dvbttxtsubtitles", mpCheckBoxEnableTTXTSub.Checked);
        xmlwriter.SetValueAsBool("tvservice", "ccsubtitles", mpCheckBoxEnableCCSub.Checked);
        xmlwriter.SetValueAsBool("tvservice", "autoshowsubwhentvstarts", mpCheckBoxAutoShowSubWhenTvStarts.Checked);
        xmlwriter.SetValueAsBool("tvservice", "audiodualmono", enableAudioDualMonoModes.Checked);
        xmlwriter.SetValueAsBool("mytv", "hideAllChannelsGroup", cbHideAllChannels.Checked);
        xmlwriter.SetValueAsBool("myradio", "hideAllChannelsGroup", cbHideAllChannels.Checked);
        //currently we use the same checkbox for radio but different settings in config file
        xmlwriter.SetValueAsBool("mytv", "showChannelStateIcons", cbShowChannelStateIcons.Checked);
        xmlwriter.SetValueAsBool("mytv", "continuousScrollGuide", cbContinuousScrollGuide.Checked);
        xmlwriter.SetValueAsBool("mytv", "relaxTsReader", cbRelaxTsReader.Checked);

        xmlwriter.SetValueAsBool("tvservice", "isWakeOnLanEnabled", mpCheckBoxIsWakeOnLanEnabled.Checked);
        xmlwriter.SetValue("tvservice", "WOLTimeOut", mpNumericTextBoxWOLTimeOut.Text);
        xmlwriter.SetValueAsBool("tvservice", "isAutoMacAddressEnabled", mpCheckBoxIsAutoMacAddressEnabled.Checked);
        xmlwriter.SetValue("tvservice", "macAddress", mpTextBoxMacAddress.Text);

        xmlwriter.SetValueAsBool("mytv", "enableRecNotifier", chkRecnotifications.Checked);
        xmlwriter.SetValue("mytv", "notifyTVBefore", txtNotifyBefore.Text);
        xmlwriter.SetValue("mytv", "notifyTVTimeout", txtNotifyAfter.Text);
        xmlwriter.SetValueAsBool("mytv", "notifybeep", checkBoxNotifyPlaySound.Checked);
        xmlwriter.SetValue("mytv", "showEpisodeInfo", comboboxShowEpisodeInfo.SelectedIndex);

        foreach (ListViewItem item in mpListViewPreferredAudioLang.Items)
        {
          prefLangs += (string)item.Name + ";";
        }
        xmlwriter.SetValue("tvservice", "preferredaudiolanguages", prefLangs);

        prefLangs = "";
        foreach (ListViewItem item in mpListViewPreferredSubLang.Items)
        {
          prefLangs += (string)item.Name + ";";
        }
        xmlwriter.SetValue("tvservice", "preferredsublanguages", prefLangs);

        //When TvServer is changed, if user changed mode (SingleSeat/MultiSeat), he needs to review the RTSP setting in DebugOptions section
        if ((xmlwriter.GetValueAsBool("tvservice", "DebugOptions", false) || SettingsForm.debug_options) &&
            (_SingleSeat != Network.IsSingleSeat()))
        {
          MessageBox.Show("Please review your RTSP settings in \"DebugOptions\" section", "Warning",
                          MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
        }

      }
    }
Beispiel #53
0
    public override void SaveSettings()
    {
      if (_init == false)
      {
        return;
      }

      using (Settings xmlwriter = new MPSettings())
      {
        xmlwriter.SetValue("bdplayerAR", "defaultar", defaultZoomModeComboBox.SelectedItem);

        xmlwriter.SetValueAsBool("bdplayer", "allowarnormal", cbAllowNormal.Checked);
        xmlwriter.SetValueAsBool("bdplayer", "allowaroriginal", cbAllowOriginal.Checked);
        xmlwriter.SetValueAsBool("bdplayer", "allowarzoom", cbAllowZoom.Checked);
        xmlwriter.SetValueAsBool("bdplayer", "allowarzoom149", cbAllowZoom149.Checked);
        xmlwriter.SetValueAsBool("bdplayer", "allowarstretch", cbAllowStretch.Checked);
        xmlwriter.SetValueAsBool("bdplayer", "allowarnonlinear", cbAllowNonLinearStretch.Checked);
        xmlwriter.SetValueAsBool("bdplayer", "allowarletterbox", cbAllowLetterbox.Checked);
      }
    }
    private void SaveSettings()
    {
      if (!_settingsSaved)
      {
        _settingsSaved = true;
        using (Settings xmlwriter = new MPSettings())
        {
          if (btnClassic.Selected)
          {
            xmlwriter.SetValue("volume", "handler", 0);
          }
          else if (btnWinXP.Selected)
          {
            xmlwriter.SetValue("volume", "handler", 1);
          }
          else if (btnLogarithmic.Selected)
          {
            xmlwriter.SetValue("volume", "handler", 2);
          }
          else if (btnCustom.Selected)
          {
            xmlwriter.SetValue("volume", "handler", 3);
          }
          else if (btnVistaWin7.Selected)
          {
            xmlwriter.SetValue("volume", "handler", 4);
          }

          bool useDigital = btnWave.Selected;
          if (_useMixing)
          {
            useDigital = true;
          }
          xmlwriter.SetValueAsBool("volume", "digital", useDigital);
          xmlwriter.SetValue("volume", "table", _customVolume);
          xmlwriter.SetValueAsBool("volume", "defaultVolumeOSD", btnEnableOSDVolume.Selected);
        }
      }
    }
Beispiel #55
0
 private void okButton_Click(object sender, EventArgs e)
 {
   this.DialogResult = DialogResult.OK;
   using (Settings xmlwriter = new MPSettings())
   {
     xmlwriter.SetValue("subtitles", "subPicsBufferAhead", subPicsAheadUpDown.Value);
     xmlwriter.SetValue("subtitles", "textureSize", textureComboBox.SelectedItem);
     xmlwriter.SetValue("subtitles", "adjustY", posYUpDown.Value);
     xmlwriter.SetValueAsBool("subtitles", "pow2tex", pow2texCheckBox.Checked);
     xmlwriter.SetValueAsBool("subtitles", "disableAnimation", disableAnimCheckBox.Checked);
   }
   this.Hide();
 }
Beispiel #56
0
 public override void SaveSettings()
 {
   using (Settings xmlwriter = new MPSettings())
   {
     //Use Internel Menu
     xmlwriter.SetValueAsBool("bdplayer", "useInternalBDPlayer", useInternalBDPlayer.Checked);
     xmlwriter.SetValue("bdplayer", "audiolanguage", defaultAudioLanguageComboBox.Text);
     xmlwriter.SetValue("bdplayer", "subtitlelanguage", defaultSubtitleLanguageComboBox.Text);
     xmlwriter.SetValue("bdplayer", "audiotype", preferredAudioTypeComboBox.Text);
     xmlwriter.SetValue("bdplayer", "regioncode", RegionCodeComboBox.SelectedItem);
     xmlwriter.SetValue("bdplayer", "parentalcontrol", ParentalControlUpDown.Value.ToString());
     xmlwriter.SetValueAsBool("bdplayer", "subtitlesenabled", SubsEnabled.Checked);
   }
 }
Beispiel #57
0
  /// <summary>
  /// saves last active module.
  /// </summary>
  private void SaveLastActiveModule()
  {
    // persist the currently selected module to XML for later use.
    Log.Debug("Main: SaveLastActiveModule - enabled {0}", _showLastActiveModule);
    bool currentmodulefullscreen = Currentmodulefullscreen();
    string currentmodulefullscreenstate = GUIPropertyManager.GetProperty("#currentmodulefullscreenstate");
    string currentmoduleid = GUIPropertyManager.GetProperty("#currentmoduleid");

    if (_showLastActiveModule && !Utils.IsGUISettingsWindow(GUIWindowManager.GetPreviousActiveWindow()))
    {
      using (Settings xmlreader = new MPSettings())
      {
        if (currentmodulefullscreen)
        {
          currentmoduleid = Convert.ToString(GUIWindowManager.GetPreviousActiveWindow());
        }
        
        if (!currentmodulefullscreen && currentmodulefullscreenstate == "True")
        {
          currentmodulefullscreen = true;
        }

        if (currentmoduleid.Length == 0)
        {
          currentmoduleid = "0";
        }

        string section;
        switch (GUIWindowManager.ActiveWindow)
        {
          case (int)GUIWindow.Window.WINDOW_PICTURES:
            section = "pictures";
            break;

          case (int)GUIWindow.Window.WINDOW_MUSIC:
            section = "music";
             break;

          case (int)GUIWindow.Window.WINDOW_VIDEOS:
            section = "movies";
            break;

          default:
            section = "";
            break;
        }

        bool rememberLastFolder = xmlreader.GetValueAsBool(section, "rememberlastfolder", false);
        string lastFolder = xmlreader.GetValueAsString(section, "lastfolder", "");

        var virtualDir = new VirtualDirectory();
        virtualDir.LoadSettings(section);

        int pincode;
        bool lastFolderPinProtected = virtualDir.IsProtectedShare(lastFolder, out pincode);
        if (rememberLastFolder && lastFolderPinProtected)
        {
          lastFolder = "root";
          xmlreader.SetValue(section, "lastfolder", lastFolder);
          Log.Debug("Main: reverting to root folder, pin protected folder was open, SaveLastFolder {0}", lastFolder);
        }

        xmlreader.SetValue("general", "lastactivemodule", currentmoduleid);
        xmlreader.SetValueAsBool("general", "lastactivemodulefullscreen", currentmodulefullscreen);
        Log.Debug("Main: SaveLastActiveModule - module {0}", currentmoduleid);
        Log.Debug("Main: SaveLastActiveModule - fullscreen {0}", currentmodulefullscreen);
      }
    }
  }
    public void GetVideoFiles(string path, ref ArrayList availableFiles)
    {
      //
      // Count the files in the current directory
      //
      try
      {
        VirtualDirectory dir = new VirtualDirectory();
        dir.SetExtensions(Util.Utils.VideoExtensions);
        ArrayList imagePath = new ArrayList();
        
        // Thumbs creation spam no1 causing this call
        //
        // Temporary disable thumbcreation
        //
        using (Settings xmlReaderWriter = new MPSettings())
        {
          _currentCreateVideoThumbs = xmlReaderWriter.GetValueAsBool("thumbnails", "tvrecordedondemand", true);
          xmlReaderWriter.SetValueAsBool("thumbnails", "tvrecordedondemand", false);
        }

        List<GUIListItem> items = dir.GetDirectoryUnProtectedExt(path, true);
        
        foreach (GUIListItem item in items)
        {
          if (item.IsFolder)
          {
            if (item.Label != "..")
            {
              if (item.Path.ToUpperInvariant().IndexOf(@"\VIDEO_TS") >= 0)
              {
                string strFile = String.Format(@"{0}\VIDEO_TS.IFO", item.Path);
                availableFiles.Add(strFile);
              }
              else if (item.Path.ToUpperInvariant().IndexOf(@"\BDMV") >= 0)
              {
                string strFile = String.Format(@"{0}\index.bdmv", item.Path);
                availableFiles.Add(strFile);
              }
              else
              {
                GetVideoFiles(item.Path, ref availableFiles);
              }
            }
          }
          else
          {
            bool skipDuplicate = false;

            if (VirtualDirectory.IsImageFile(Path.GetExtension(item.Path)))
            {
              string filePath = Path.GetDirectoryName(item.Path) + @"\" + Path.GetFileNameWithoutExtension(item.Path);

              if (!imagePath.Contains(filePath))
              {
                imagePath.Add(filePath);
              }
              else
              {
                skipDuplicate = true;
              }
            }
            if (!skipDuplicate)
            {
              string extension = Path.GetExtension(item.Path);

              if (extension != null && extension.ToUpperInvariant() != @".IFO" && extension.ToUpperInvariant() != ".BDMV")
              {
                availableFiles.Add(item.Path);
              }
            }
          }
        }
      }
      catch (Exception e)
      {
        Log.Info("VideoDatabase: Exception counting video files:{0}", e);
      }
      finally
      {
        // Restore thumbcreation setting
        using (Settings xmlwriter = new MPSettings())
        {
          xmlwriter.SetValueAsBool("thumbnails", "tvrecordedondemand", _currentCreateVideoThumbs);
        }
      }
    }
    // Check and add, if necessary, media info for video files
    // Use (file, pathID and fileID) or (full filename with path and fileID)
    private void CheckMediaInfo(string file, string fullPathFilename, int pathID, int fileID, bool refresh)
    {
      string strSQL = string.Empty;
      string strFilenameAndPath = string.Empty;

      // Get path name from pathID
      strSQL = String.Format("SELECT * FROM path WHERE idPath={0}", pathID);
      SQLiteResultSet results = m_db.Execute(strSQL);
      // No ftp or http videos
      string path = DatabaseUtility.Get(results, 0, "strPath");

      if (path.IndexOf("remote:") >= 0 || path.IndexOf("http:") >= 0)
      {
        return;
      }

      // We can use (path+file) or full path filename
      if (fullPathFilename == string.Empty)
      {
        strFilenameAndPath = path + file.Replace("''", "'");
      }
      else
      {
        strFilenameAndPath = fullPathFilename;
      }

      // Prevent empty database record for empty media scan
      if (!File.Exists(strFilenameAndPath))
      {
        return;
      }

      // Check if we processed file allready
      strSQL = String.Format("SELECT * FROM filesmediainfo WHERE idFile={0}", fileID);
      results = m_db.Execute(strSQL);

      if (results.Rows.Count == 0 || refresh)
      {
        Log.Info("VideoDatabase media info scanning file: {0}", strFilenameAndPath);
        bool isImage = false;
        string drive = string.Empty;
        bool daemonAutoPlay = false;
        string autoplayVideo = string.Empty;

        if (VirtualDirectory.IsImageFile(Path.GetExtension(strFilenameAndPath)))
        {
          if (!DaemonTools.IsMounted(strFilenameAndPath))
          {
            using (Settings xmlreader = new MPSettings())
            {
              daemonAutoPlay = xmlreader.GetValueAsBool("daemon", "askbeforeplaying", false);
              autoplayVideo = xmlreader.GetValueAsString("general", "autoplay_video", "Ask");
              xmlreader.SetValueAsBool("daemon", "askbeforeplaying", false);
              xmlreader.SetValue("general", "autoplay_video", "No");
            }

            if (!DaemonTools.Mount(strFilenameAndPath, out drive))
            {
              return;
            }
          }
          isImage = true;
        }

        MediaInfoWrapper mInfo = new MediaInfoWrapper(strFilenameAndPath);

        if (isImage && DaemonTools.IsMounted(strFilenameAndPath))
        {
          DaemonTools.UnMount();
          using (Settings xmlwriter = new MPSettings())
          {
            xmlwriter.SetValueAsBool("daemon", "askbeforeplaying", daemonAutoPlay);
            xmlwriter.SetValue("general", "autoplay_video", autoplayVideo);
          }
        }

        int subtitles = 0;

        if (mInfo.HasSubtitles)
        {
          subtitles = 1;
        }

        try
        {
          if (results.Rows.Count == 0)
          {
            strSQL = String.Format(
              "INSERT INTO filesmediainfo (idFile, videoCodec, videoResolution, aspectRatio, hasSubtitles, audioCodec, audioChannels) VALUES({0},'{1}','{2}','{3}',{4},'{5}','{6}')",
              fileID,
              Util.Utils.MakeFileName(mInfo.VideoCodec),
              mInfo.VideoResolution,
              mInfo.AspectRatio,
              subtitles,
              Util.Utils.MakeFileName(mInfo.AudioCodec),
              mInfo.AudioChannelsFriendly);
          }
          else
          {
            strSQL = String.Format(
              "UPDATE filesmediainfo SET videoCodec='{1}', videoResolution='{2}', aspectRatio='{3}', hasSubtitles='{4}', audioCodec='{5}', audioChannels='{6}' WHERE idFile={0}",
              fileID,
              Util.Utils.MakeFileName(mInfo.VideoCodec),
              mInfo.VideoResolution,
              mInfo.AspectRatio,
              subtitles,
              Util.Utils.MakeFileName(mInfo.AudioCodec),
              mInfo.AudioChannelsFriendly);
          }

          // Prevent empty record for future or unknown codecs
          if (mInfo.VideoCodec == string.Empty)
          {
            return;
          }

          m_db.Execute(strSQL);
          SetVideoDuration(fileID, mInfo.VideoDuration / 1000);
          ArrayList movieFiles = new ArrayList();
          int movieId = VideoDatabase.GetMovieId(strFilenameAndPath);
          VideoDatabase.GetFilesForMovie(movieId, ref movieFiles);
          SetMovieDuration(movieId, MovieDuration(movieFiles));

          //Update movie subtitle field
          strSQL = String.Format("UPDATE movie SET hasSubtitles={0} WHERE idMovie={1} ", subtitles, movieId);
          m_db.Execute(strSQL);
        }
        catch (ThreadAbortException)
        {
          // Will be logged in thread main code
        }
        catch (Exception) { }
      }
    }
    private void SaveSettings()
    {
      using (Profile.Settings xmlwriter = new MPSettings())
      {
        // Music
        switch (_section)
        {
          case "music":
            xmlwriter.SetValue("music", "playlists", _musicPlayListFolder);
            xmlwriter.SetValueAsBool("musicfiles", "repeat", btnMusicrepeatplaylist.Selected);
            xmlwriter.SetValueAsBool("musicfiles", "autoshuffle", btnMusicautoshuffle.Selected);
            xmlwriter.SetValueAsBool("musicfiles", "savePlaylistOnExit", btnMusicsavecurrentasdefault.Selected);
            xmlwriter.SetValueAsBool("musicfiles", "resumePlaylistOnMusicEnter", btnMusicloaddefault.Selected);
            xmlwriter.SetValueAsBool("musicfiles", "playlistIsCurrent", btnMusicplaylistscreen.Selected );
            break;

          case "movies":
            xmlwriter.SetValue("movies", "playlists", _videosPlayListFolder);
            xmlwriter.SetValueAsBool("movies", "repeat", btnVideosrepeatplaylist.Selected);
            break;
        }
      }
    }