当前位置: 首页>>代码示例>>C#>>正文


C# MPSettings.GetValueAsInt方法代码示例

本文整理汇总了C#中MPSettings.GetValueAsInt方法的典型用法代码示例。如果您正苦于以下问题:C# MPSettings.GetValueAsInt方法的具体用法?C# MPSettings.GetValueAsInt怎么用?C# MPSettings.GetValueAsInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MPSettings的用法示例。


在下文中一共展示了MPSettings.GetValueAsInt方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: VolumeHandler

    public VolumeHandler(int[] volumeTable)
    {
      bool isDigital;

      using (Settings reader = new MPSettings())
      {
        int levelStyle = reader.GetValueAsInt("volume", "startupstyle", 0);

        if (levelStyle == 0)
        {
          _startupVolume = Math.Max(0, Math.Min(65535, reader.GetValueAsInt("volume", "lastknown", 52428)));
        }

        if (levelStyle == 1)
        {
        }

        if (levelStyle == 2)
        {
          _startupVolume = Math.Max(0, Math.Min(65535, reader.GetValueAsInt("volume", "startuplevel", 52428)));
        }

        isDigital = reader.GetValueAsBool("volume", "digital", false);

        _showVolumeOSD = reader.GetValueAsBool("volume", "defaultVolumeOSD", true);
      }

      _mixer = new Mixer.Mixer();
      _mixer.Open(0, isDigital);
      _volumeTable = volumeTable;
      _mixer.ControlChanged += mixer_ControlChanged;
    }
开发者ID:doskabouter,项目名称:MediaPortal-1,代码行数:32,代码来源:VolumeHandler.cs

示例2: LoadSettings

    public override void LoadSettings()
    {
      int windowid = 0;

      using (Settings xmlreader = new MPSettings())
      {
        checkBoxEnableScreensaver.Checked = xmlreader.GetValueAsBool("general", "IdleTimer", true);
        numericUpDownDelay.Value = xmlreader.GetValueAsInt("general", "IdleTimeValue", 300);
        radioBtnBlankScreen.Checked = xmlreader.GetValueAsBool("general", "IdleBlanking", true);
        radioButtonLoadPlugin.Checked = xmlreader.GetValueAsBool("general", "IdlePlugin", false);
        windowid = xmlreader.GetValueAsInt("general", "IdlePluginWindow", 0);
      }    
      pluginsComboBox.DataSource = loadedPlugins;
      pluginsComboBox.DisplayMember = "PluginName";
      pluginsComboBox.ValueMember = "PluginName";
      if (windowid != 0)
      {
        for (int i = 0; i < loadedPlugins.Count; i++)
        {
          ItemTag t = loadedPlugins[i];
          if (t.WindowId == windowid)
          {
            pluginsComboBox.SelectedIndex = i;
            break;
          }
        }
      }
    }
开发者ID:hkjensen,项目名称:MediaPortal-1,代码行数:28,代码来源:GuiScreensaver.cs

示例3: VolumeHandler

    public VolumeHandler(int[] volumeTable)
    {
      bool isDigital = true;
      //string mixerControlledComponent = "Wave";

      using (Settings reader = new MPSettings())
      {
        int levelStyle = reader.GetValueAsInt("volume", "startupstyle", 0);

        if (levelStyle == 0)
        {
          _startupVolume = Math.Max(0, Math.Min(65535, reader.GetValueAsInt("volume", "lastknown", 52428)));
        }

        if (levelStyle == 1)
        {
          _startupVolume = _mixer.Volume;
        }

        if (levelStyle == 2)
        {
          _startupVolume = Math.Max(0, Math.Min(65535, reader.GetValueAsInt("volume", "startuplevel", 52428)));
        }

        //mixerControlledComponent = reader.GetValueAsString("volume", "controlledMixer", "Wave");
        isDigital = reader.GetValueAsBool("volume", "digital", false);

        _showVolumeOSD = reader.GetValueAsBool("volume", "defaultVolumeOSD", true);
      }

      _mixer = new Mixer.Mixer();
      _mixer.Open(0, isDigital);
      _volumeTable = volumeTable;
      _mixer.ControlChanged += new Mixer.MixerEventHandler(mixer_ControlChanged);
    }
开发者ID:nio22,项目名称:MediaPortal-1,代码行数:35,代码来源:VolumeHandler.cs

示例4: LoadSettings

    private void LoadSettings()
    {
      // load settings
      using (Settings reader = new MPSettings())
      {
        int hours, minutes;
        hours = reader.GetValueAsInt("musicdbreorg", "hours", 0);
        minutes = reader.GetValueAsInt("musicdbreorg", "minutes", 0);
        VerifySchedule(ref hours, ref minutes);
        hoursTextBox.Text = hours.ToString();
        minutesTextBox.Text = minutes.ToString();
        if (hoursTextBox.Text.Length == 1)
        {
          hoursTextBox.Text = "0" + hoursTextBox.Text;
        }
        if (minutesTextBox.Text.Length == 1)
        {
          minutesTextBox.Text = "0" + minutesTextBox.Text;
        }

        cbMonday.Checked = reader.GetValueAsBool("musicdbreorg", "monday", true);
        cbTuesday.Checked = reader.GetValueAsBool("musicdbreorg", "tuesday", true);
        cbWednesday.Checked = reader.GetValueAsBool("musicdbreorg", "wednesday", true);
        cbThursday.Checked = reader.GetValueAsBool("musicdbreorg", "thursday", true);
        cbFriday.Checked = reader.GetValueAsBool("musicdbreorg", "friday", true);
        cbSaturday.Checked = reader.GetValueAsBool("musicdbreorg", "saturday", true);
        cbSunday.Checked = reader.GetValueAsBool("musicdbreorg", "sunday", true);
      }
    }
开发者ID:arangas,项目名称:MediaPortal-1,代码行数:29,代码来源:MusicDBReorgSettings.cs

示例5: LoadSettings

    public override void LoadSettings()
    {
      //Load parameters from XML File
      string preferredAudioLanguages;
      string preferredSubLanguages;

      using (Settings xmlreader = new MPSettings())
      {
        cbTurnOnTv.Checked = xmlreader.GetValueAsBool("mytv", "autoturnontv", false);
        cbAutoFullscreen.Checked = xmlreader.GetValueAsBool("mytv", "autofullscreen", false);
        byIndexCheckBox.Checked = xmlreader.GetValueAsBool("mytv", "byindex", true);
        showChannelNumberCheckBox.Checked = xmlreader.GetValueAsBool("mytv", "showchannelnumber", false);

        int channelNumberMaxLen = xmlreader.GetValueAsInt("mytv", "channelnumbermaxlength", 3);
        channelNumberMaxLengthNumUpDn.Value = channelNumberMaxLen;

        int DeInterlaceMode = xmlreader.GetValueAsInt("mytv", "deinterlace", 0);
        if (DeInterlaceMode < 0 || DeInterlaceMode > 3)
        {
          DeInterlaceMode = 3;
        }
        cbDeinterlace.SelectedIndex = DeInterlaceMode;

        mpCheckBoxPrefAC3.Checked = xmlreader.GetValueAsBool("tvservice", "preferac3", false);
        mpCheckBoxPrefAudioOverLang.Checked = xmlreader.GetValueAsBool("tvservice", "preferAudioTypeOverLang", true);
        preferredAudioLanguages = xmlreader.GetValueAsString("tvservice", "preferredaudiolanguages", "");
        preferredSubLanguages = xmlreader.GetValueAsString("tvservice", "preferredsublanguages", "");

        mpCheckBoxEnableDVBSub.Checked = xmlreader.GetValueAsBool("tvservice", "dvbbitmapsubtitles", false);
        mpCheckBoxEnableTTXTSub.Checked = xmlreader.GetValueAsBool("tvservice", "dvbttxtsubtitles", false);
        mpCheckBoxEnableCCSub.Checked = xmlreader.GetValueAsBool("tvservice", "ccsubtitles", false);
        mpCheckBoxAutoShowSubWhenTvStarts.Checked = xmlreader.GetValueAsBool("tvservice", "autoshowsubwhentvstarts", true);
        enableAudioDualMonoModes.Checked = xmlreader.GetValueAsBool("tvservice", "audiodualmono", false);
        cbHideAllChannels.Checked = xmlreader.GetValueAsBool("mytv", "hideAllChannelsGroup", false);
        cbShowChannelStateIcons.Checked = xmlreader.GetValueAsBool("mytv", "showChannelStateIcons", true);
        cbContinuousScrollGuide.Checked = xmlreader.GetValueAsBool("mytv", "continuousScrollGuide", false);
        cbRelaxTsReader.Checked = xmlreader.GetValueAsBool("mytv", "relaxTsReader", false);

        chkRecnotifications.Checked = xmlreader.GetValueAsBool("mytv", "enableRecNotifier", false);
        txtNotifyBefore.Text = xmlreader.GetValueAsString("mytv", "notifyTVBefore", "300");
        txtNotifyAfter.Text = xmlreader.GetValueAsString("mytv", "notifyTVTimeout", "15");
        checkBoxNotifyPlaySound.Checked = xmlreader.GetValueAsBool("mytv", "notifybeep", true);
        cbConfirmTimeshiftStop.Checked = xmlreader.GetValueAsBool("mytv", "confirmTimeshiftStop", true);
        int showEpisodeinfo = xmlreader.GetValueAsInt("mytv", "showEpisodeInfo", 0);
        if (showEpisodeinfo > this.ShowEpisodeOptions.Length)
        {
          showEpisodeinfo = 0;
        }
        comboboxShowEpisodeInfo.SelectedIndex = showEpisodeinfo;
      }

      // Enable this Panel if the TvPlugin exists in the plug-in Directory
      Enabled = true;

      // Retrieve the languages and language codes for the Epg.
      List<KeyValuePair<String, String>> langs = TvLibrary.Epg.Languages.Instance.GetLanguagePairs();
      FillLists(mpListViewAvailAudioLang, mpListViewPreferredAudioLang, preferredAudioLanguages, langs);
      FillLists(mpListViewAvailSubLang, mpListViewPreferredSubLang, preferredSubLanguages, langs);
      _SingleSeat = Network.IsSingleSeat();
    }
开发者ID:Erls-Corporation,项目名称:MediaPortal-1,代码行数:60,代码来源:TV.cs

示例6: LoadSettings

 public override void LoadSettings()
 {
   using (Settings xmlreader = new MPSettings())
   {
     textBoxDisplayTimeout.Text = Convert.ToString(xmlreader.GetValueAsInt("movieplayer", "osdtimeout", 0));
     textBoxZapDelay.Text = Convert.ToString(xmlreader.GetValueAsInt("movieplayer", "zapdelay", 2));
     textBoxZapTimeout.Text = Convert.ToString(xmlreader.GetValueAsInt("movieplayer", "zaptimeout", 5));
   }
 }
开发者ID:arangas,项目名称:MediaPortal-1,代码行数:9,代码来源:GuiOSD.cs

示例7: LoadSettings

 /// <summary>
 /// 
 /// </summary>
 public override void LoadSettings()
 {
   using (Settings xmlreader = new MPSettings())
   {
     HorizontalScrollSpeedUpDown.Value = xmlreader.GetValueAsInt("gui", "ScrollSpeedRight", 1);
     VerticalScrollSpeedUpDown.Value = xmlreader.GetValueAsInt("gui", "ScrollSpeedDown", 4);
     listLoopDelayUpDown.Value = xmlreader.GetValueAsInt("gui", "listLoopDelay", 100);
   }
 }
开发者ID:arangas,项目名称:MediaPortal-1,代码行数:12,代码来源:GuiControls.cs

示例8: LoadSettings

 private void LoadSettings()
 {
   using (Settings xmlreader = new MPSettings())
   {
     _displayTimeout = xmlreader.GetValueAsInt("movieplayer", "osdtimeout", 0);
     _zapDelay = xmlreader.GetValueAsInt("movieplayer", "zapdelay", 2);
     _zapTimeout = xmlreader.GetValueAsInt("movieplayer", "zaptimeout", 5);
   }
 }
开发者ID:hkjensen,项目名称:MediaPortal-1,代码行数:9,代码来源:GUISettingsGUI_OnScreenDisplay.cs

示例9: DlgWol

    public DlgWol()
    {
      InitializeComponent();

      using (Settings xmlreader = new MPSettings())
      {
        mpUpDownWolTimeout.Value = xmlreader.GetValueAsInt("WOL", "WolTimeout", 10);
        mpUpDownWolResend.Value = xmlreader.GetValueAsInt("WOL", "WolResendTime", 1);
        mpUpDownWaitTime.Value = xmlreader.GetValueAsInt("WOL", "WaitTimeAfterWOL", 0);
      }
    }
开发者ID:arangas,项目名称:MediaPortal-1,代码行数:11,代码来源:DlgWol.cs

示例10: LoadSettings

 private static void LoadSettings()
 {
   using (Settings xmlreader = new MPSettings())
   {
     PreviewColumns = xmlreader.GetValueAsInt("thumbnails", "videothumbcols", 1);
     PreviewRows = xmlreader.GetValueAsInt("thumbnails", "videothumbrows", 1);
     LeaveShareThumb = xmlreader.GetValueAsBool("thumbnails", "videosharepreview", false);
     preRecordInterval = xmlreader.GetValueAsInt("thumbnails", "preRecordInterval", 1);
     Log.Debug("VideoThumbCreator: Settings loaded - using {0} columns and {1} rows. Share thumb = {2}, preRecordInterval = {3}.",
               PreviewColumns, PreviewRows, LeaveShareThumb, preRecordInterval);
   }
 }
开发者ID:Eddie-Jee,项目名称:MediaPortal-1,代码行数:12,代码来源:VideoThumbCreator.cs

示例11: LoadSettings

 public void LoadSettings()
 {
   using (Settings reader = new MPSettings())
   {
     homeOnlyCheckBox.Checked = reader.GetValueAsBool("psclientplugin", "homeonly", true);
     extLogCheckBox.Checked = reader.GetValueAsBool("psclientplugin", "extensivelogging", false);
     shutModeComboBox.SelectedIndex = reader.GetValueAsInt("psclientplugin", "shutdownmode", 1);
     forceCheckBox.Checked = reader.GetValueAsBool("psclientplugin", "forceshutdown", false);
     enableShutdownCheckBox.Checked = reader.GetValueAsBool("psclientplugin", "shutdownenabled", false);
     idleNumericUpDown.Value = reader.GetValueAsInt("psclientplugin", "idletimeout", 5);
   }
 }
开发者ID:arangas,项目名称:MediaPortal-1,代码行数:12,代码来源:PowerSchedulerClientSetup.cs

示例12: LoadSettings

 private static void LoadSettings()
 {
   using (Settings xmlreader = new MPSettings())
   {
     PreviewColumns = xmlreader.GetValueAsInt("thumbnails", "videothumbcols", 1);
     PreviewRows = xmlreader.GetValueAsInt("thumbnails", "videothumbrows", 1);
     LeaveShareThumb = xmlreader.GetValueAsBool("thumbnails", "videosharepreview", false);
     Log.Debug("VideoThumbCreator: Settings loaded - using {0} columns and {1} rows. Share thumb = {2}",
               PreviewColumns, PreviewRows, LeaveShareThumb);
     NeedsConfigRefresh = false;
   }
 }
开发者ID:NJK125,项目名称:MediaPortal-1,代码行数:12,代码来源:VideoThumbCreator.cs

示例13: LoadSettings

    private void LoadSettings()
    {
      using (Settings xmlreader = new MPSettings())
      {

        _iQuality = xmlreader.GetValueAsInt("thumbnails", "quality", 3);
        _iQuality++;
        btnEnableMusicThumbs.Selected = xmlreader.GetValueAsBool("thumbnails", "musicfolderondemand", true);
        btnEnablePicturesThumbs.Selected = xmlreader.GetValueAsBool("thumbnails", "picturenolargethumbondemand", false);
        btnEnableVideosThumbs.Selected = xmlreader.GetValueAsBool("thumbnails", "videoondemand", true);
        btnEnableLeaveThumbInFolder.Selected = xmlreader.GetValueAsBool("thumbnails", "videosharepreview", false);
        _iColumns = xmlreader.GetValueAsInt("thumbnails", "videothumbcols", 1);
        _iRows = xmlreader.GetValueAsInt("thumbnails", "videothumbrows", 1);
      }
    }
开发者ID:hkjensen,项目名称:MediaPortal-1,代码行数:15,代码来源:GUISettingsGUI_Thumbnails.cs

示例14: LoadSettings

    private void LoadSettings()
    {
      using (Settings xmlreader = new MPSettings())
      {
        int volumeStyle = xmlreader.GetValueAsInt("volume", "handler", 1);
        bool isDigital = xmlreader.GetValueAsBool("volume", "digital", true);
        btnClassic.Selected = volumeStyle == 0;
        btnWinXP.Selected = volumeStyle == 1;
        btnLogarithmic.Selected= volumeStyle == 2;
        btnCustom.Selected = volumeStyle == 3;
        btnVistaWin7.Selected = volumeStyle == 4;
        _customVolume = xmlreader.GetValueAsString("volume", "table",
                                              "0, 4095, 8191, 12287, 16383, 20479, 24575, 28671, 32767, 36863, 40959, 45055, 49151, 53247, 57343, 61439, 65535");

        // When Upmixing has selected, we need to use Wave Volume
        _useMixing = xmlreader.GetValueAsBool("audioplayer", "mixing", false);
        
        if (_useMixing)
        {
          isDigital = true;
        }

        btnMasterVolume.Selected = !isDigital;
        btnWave.Selected = isDigital;

        btnEnableOSDVolume.Selected = xmlreader.GetValueAsBool("volume", "defaultVolumeOSD", true);
      }
    }
开发者ID:splatterpop,项目名称:MediaPortal-1,代码行数:28,代码来源:GUISettingsGeneral_Volume.cs

示例15: HcwHelper

    private bool restartIRApp = false; // Restart Haupp. IR-app. after MP quit

    /// <summary>
    /// Initialization
    /// </summary>
    public HcwHelper()
    {
      InitializeComponent();

      using (Settings xmlreader = new MPSettings())
      {
        logVerbose = xmlreader.GetValueAsBool("remote", "HCWVerboseLog", false);
        port = xmlreader.GetValueAsInt("remote", "HCWHelperPort", 2110);
        hcwEnabled = xmlreader.GetValueAsBool("remote", "HCW", false);
      }

      connection = new Connection(logVerbose);
      if (hcwEnabled && (GetDllPath() != string.Empty) && connection.Start(port) &&
          irremote.IRSetDllDirectory(GetDllPath()))
      {
        Thread checkThread = new Thread(new ThreadStart(CheckThread));
        checkThread.IsBackground = true;
        checkThread.Priority = ThreadPriority.Highest;
        checkThread.Name = "HcwHelperChecker";
        checkThread.Start();
        connection.ReceiveEvent += new Connection.ReceiveEventHandler(OnReceive);
        StartIR();
      }
      else
      {
        connection.Send(port + 1, "APP", "STOP", DateTime.Now);
        Application.Exit();
      }
    }
开发者ID:arangas,项目名称:MediaPortal-1,代码行数:34,代码来源:HCWHelper.cs


注:本文中的MPSettings.GetValueAsInt方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。