本文整理汇总了C#中MPSettings.GetValueAsBool方法的典型用法代码示例。如果您正苦于以下问题:C# MPSettings.GetValueAsBool方法的具体用法?C# MPSettings.GetValueAsBool怎么用?C# MPSettings.GetValueAsBool使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MPSettings
的用法示例。
在下文中一共展示了MPSettings.GetValueAsBool方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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", false);
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;
}
}
}
}
示例2: Init
public void Init()
{
using (Settings xmlreader = new MPSettings())
{
_remoteConfigured = xmlreader.GetValueAsBool("remote", "Centarea", false);
_verboseLogging = xmlreader.GetValueAsBool("remote", "CentareaVerbose", false);
_mapMouseButton = xmlreader.GetValueAsBool("remote", "CentareaMouseOkMap", true);
_mapJoystick = xmlreader.GetValueAsBool("remote", "CentareaJoystickMap", false);
}
if (!_remoteConfigured)
{
return;
}
Log.Debug("Centarea: Initializing Centarea HID remote");
_inputHandler = new InputHandler("Centarea HID");
if (!_inputHandler.IsLoaded)
{
Log.Error("Centarea: Error loading default mapping file - please reinstall MediaPortal");
DeInit();
return;
}
else
{
Log.Info("Centarea: Centarea HID mapping loaded successfully");
_remoteActive = true;
}
}
示例3: Init
private void Init()
{
using (Settings xmlreader = new MPSettings())
{
controlEnabled = xmlreader.GetValueAsBool("remote", "AppCommand", false);
controlEnabledGlobally = xmlreader.GetValueAsBool("remote", "AppCommandBackground", false);
logVerbose = xmlreader.GetValueAsBool("remote", "AppCommandVerbose", false);
}
if (controlEnabled)
{
_inputHandler = new InputHandler("AppCommand");
if (!_inputHandler.IsLoaded)
{
controlEnabled = false;
Log.Info("AppCommand: Error loading default mapping file - please reinstall MediaPortal");
}
}
if (controlEnabledGlobally)
{
_keyboardHook = new KeyboardHook();
_keyboardHook.KeyDown += new KeyEventHandler(OnKeyDown);
_keyboardHook.IsEnabled = true;
}
}
示例4: 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();
}
示例5: 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);
}
示例6: 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);
}
}
示例7: 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;
}
示例8: 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();
}
}
示例9: LastFMConfig
public LastFMConfig()
{
InitializeComponent();
using (var xmlreader = new MPSettings())
{
chkAutoDJ.Checked = xmlreader.GetValueAsBool("lastfm:test", "autoDJ", true);
numRandomness.Value = xmlreader.GetValueAsInt("lastfm:test", "randomness", 100);
chkAnnounce.Checked = xmlreader.GetValueAsBool("lastfm:test", "announce", true);
chkScrobble.Checked = xmlreader.GetValueAsBool("lastfm:test", "scrobble", true);
chkDiferentVersions.Checked = xmlreader.GetValueAsBool("lastfm:test", "allowDiffVersions", true);
}
if (string.IsNullOrEmpty(MusicDatabase.Instance.GetLastFMSK())) return;
LastFMUser user;
try
{
user = LastFMLibrary.GetUserInfo(MusicDatabase.Instance.GetLastFMUser());
}
catch (Exception ex)
{
Log.Error("Error getting user info for: {0}", MusicDatabase.Instance.GetLastFMUser());
Log.Error(ex);
return;
}
if (user == null || string.IsNullOrEmpty(user.UserImgURL)) return;
pbLastFMUser.ImageLocation = user.UserImgURL;
}
示例10: LoadSettings
public override void LoadSettings()
{
base.LoadSettings();
if (_init == false)
{
using (Settings xmlreader = new MPSettings())
{
//VMR9 settings
checkboxMpNonsquare.Checked = xmlreader.GetValueAsBool("general", "nonsquare", true);
// http://msdn2.microsoft.com/en-us/library/ms787438(VS.85).aspx
checkboxDXEclusive.Checked = xmlreader.GetValueAsBool("general", "exclusivemode", true);
mpVMR9FilterMethod.Text = xmlreader.GetValueAsString("general", "dx9filteringmode", "Gaussian Quad Filtering");
// http://msdn2.microsoft.com/en-us/library/ms788066.aspx
checkBoxVMRWebStreams.Checked = xmlreader.GetValueAsBool("general", "usevrm9forwebstreams", true);
checkBoxDecimateMask.Checked = xmlreader.GetValueAsBool("general", "dx9decimatemask", false);
// http://msdn2.microsoft.com/en-us/library/ms787452(VS.85).aspx
bool ValueEVR = false;
try
{
//EVR - VMR9 selection
ValueEVR = OSInfo.OSInfo.VistaOrLater() ? true : false;
}
catch (Exception ex)
{
Log.Error("FilterVideoRendererConfig: Os detection unsuccessful - {0}", ex.Message);
}
radioButtonEVR.Checked = xmlreader.GetValueAsBool("general", "useEVRenderer", ValueEVR);
}
_init = true;
}
}
示例11: LoadSettings
private void LoadSettings()
{
using (Settings xmlreader = new MPSettings())
{
_showAllChannelsGroup = xmlreader.GetValueAsBool("myradio", "showallchannelsgroup", true);
_rememberLastGroup = xmlreader.GetValueAsBool("myradio", "rememberlastgroup", true);
_rootGroup = xmlreader.GetValueAsString("myradio", "rootgroup", "(none)");
_autoTurnOnRadio = xmlreader.GetValueAsBool("myradio", "autoturnonradio", false);
}
}
示例12: LoadSettings
public override void LoadSettings()
{
Log.Info("load volume");
// default default
_useClassicHandler.Checked = true;
using (Settings reader = new MPSettings())
{
string isSettingExist = reader.GetValueAsString("volume", "handler", "");
int volumeStyle = reader.GetValueAsInt("volume", "handler", 1);
bool isDigital = reader.GetValueAsBool("volume", "digital", true);
mpCBHideWinOSD.Checked = reader.GetValueAsBool("volume", "hideWindowsOSD", false);
_useClassicHandler.Checked = volumeStyle == 0;
_useWindowsHandler.Checked = volumeStyle == 1;
_useLogarithmicHandler.Checked = volumeStyle == 2;
_useCustomHandler.Checked = volumeStyle == 3;
_useVistaHandler.Checked = volumeStyle == 4;
// Force a couple of settings for Vista / Windows 7
if (OSInfo.OSInfo.VistaOrLater())
{
volumewarnlb.Visible = true;
if (string.IsNullOrEmpty(isSettingExist))
_useVistaHandler.Checked = true;
}
_customText = reader.GetValueAsString("volume", "table",
"0, 4095, 8191, 12287, 16383, 20479, 24575, 28671, 32767, 36863, 40959, 45055, 49151, 53247, 57343, 61439, 65535");
int startupStyle = reader.GetValueAsInt("volume", "startupstyle", 0);
_useLastKnownLevel.Checked = startupStyle == 0;
_useSystemCurrent.Checked = startupStyle == 1;
_useCustomLevel.Checked = startupStyle == 2;
_customLevel = reader.GetValueAsInt("volume", "startuplevel", 52428);
// When Upmixing has selected, we need to use Wave Volume
if (SettingsForm.audioplayer_mixing)
{
isDigital = true;
}
_useMasterVolume.Checked = !isDigital;
_useWave.Checked = isDigital;
_useVolumeOSD.Checked = reader.GetValueAsBool("volume", "defaultVolumeOSD", true);
}
_customTextbox.Enabled = _useCustomHandler.Checked;
_customTextbox.Text = _customTextbox.Enabled ? _customText : string.Empty;
_levelTextbox.Enabled = _useCustomLevel.Checked;
_levelTextbox.Text = _levelTextbox.Enabled ? _customLevel.ToString() : string.Empty;
}
示例13: LoadSettings
private void LoadSettings()
{
using (Settings xmlreader = new MPSettings())
{
_serverHostName = xmlreader.GetValueAsString("tvservice", "hostname", "");
_preferredLanguages = xmlreader.GetValueAsString("tvservice", "preferredlanguages", "");
_preferAC3 = xmlreader.GetValueAsBool("tvservice", "preferac3", false);
_rebuildGraphOnNewAudioSpecs = xmlreader.GetValueAsBool("tvservice", "rebuildgraphOnNewAudioSpecs", true);
_rebuildGraphOnNewVideoSpecs = xmlreader.GetValueAsBool("tvservice", "rebuildgraphOnNewVideoSpecs", true);
_avoidSeeking = xmlreader.GetValueAsBool("tvservice", "avoidSeeking", false);
}
}
示例14: 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);
}
}
示例15: Init
/// <summary>
///
/// </summary>
private void Init()
{
using (Settings xmlreader = new MPSettings())
{
_controlEnabled = xmlreader.GetValueAsBool("remote", "HidEnabled", false);
Verbose = xmlreader.GetValueAsBool("remote", "HidVerbose", false);
}
if (_controlEnabled)
{
_hidHandler = new HidHandler("Generic-HID");
}
}