本文整理汇总了C#中MPSettings类的典型用法代码示例。如果您正苦于以下问题:C# MPSettings类的具体用法?C# MPSettings怎么用?C# MPSettings使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MPSettings类属于命名空间,在下文中一共展示了MPSettings类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Init
private void Init()
{
try
{
_deviceClass = HidGuid;
_doubleClickTime = GetDoubleClickTime();
_deviceBuffer = new byte[256];
_deviceWatcher = new DeviceWatcher();
_deviceWatcher.Create();
_deviceWatcher.Class = _deviceClass;
_deviceWatcher.DeviceArrival += new DeviceEventHandler(OnDeviceArrival);
_deviceWatcher.DeviceRemoval += new DeviceEventHandler(OnDeviceRemoval);
_deviceWatcher.SettingsChanged += new SettingsChanged(OnSettingsChanged);
_deviceWatcher.RegisterDeviceArrival();
// Read if we use Master or Wave volume
using (Settings reader = new MPSettings())
{
isDigital = reader.GetValueAsBool("volume", "digital", false);
}
Open();
}
catch (Exception e)
{
Log.Info("Remote.Init: {0}", e.Message);
}
}
开发者ID:cmendozac,项目名称:MediaPortal-1,代码行数:30,代码来源:Remote.cs
示例2: LoadSettings
public override void LoadSettings()
{
if (_init == false)
{
return;
}
using (Settings xmlreader = new MPSettings())
{
cbAllowNormal.Checked = xmlreader.GetValueAsBool("bdplayer", "allowarnormal", true);
cbAllowOriginal.Checked = xmlreader.GetValueAsBool("bdplayer", "allowaroriginal", true);
cbAllowZoom.Checked = xmlreader.GetValueAsBool("bdplayer", "allowarzoom", true);
cbAllowZoom149.Checked = xmlreader.GetValueAsBool("bdplayer", "allowarzoom149", true);
cbAllowStretch.Checked = xmlreader.GetValueAsBool("bdplayer", "allowarstretch", true);
cbAllowNonLinearStretch.Checked = xmlreader.GetValueAsBool("bdplayer", "allowarnonlinear", true);
cbAllowLetterbox.Checked = xmlreader.GetValueAsBool("bdplayer", "allowarletterbox", true);
//
// Set default aspect ratio
//
string defaultAspectRatio = xmlreader.GetValueAsString("movieplayer", "defaultar",
defaultZoomModeComboBox.Items[0].ToString());
foreach (Geometry.Type item in Enum.GetValues(typeof (Geometry.Type)))
{
string currentAspectRatio = Util.Utils.GetAspectRatio(item);
if (defaultAspectRatio == currentAspectRatio)
{
defaultZoomModeComboBox.SelectedItem = currentAspectRatio;
break;
}
}
}
}
开发者ID:arangas,项目名称:MediaPortal-1,代码行数:33,代码来源:BDZoom.cs
示例3: LoadSettings
private void LoadSettings()
{
using (Profile.Settings xmlreader = new MPSettings())
{
// Music
string playListFolder = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
playListFolder += @"\My Playlists";
_musicPlayListFolder = xmlreader.GetValueAsString("music", "playlists", playListFolder);
if (string.Compare(_musicPlayListFolder, playListFolder) == 0)
{
if (Directory.Exists(playListFolder) == false)
{
try
{
Directory.CreateDirectory(playListFolder);
}
catch (Exception) { }
}
}
btnMusicrepeatplaylist.Selected = xmlreader.GetValueAsBool("musicfiles", "repeat", false);
btnMusicautoshuffle.Selected = xmlreader.GetValueAsBool("musicfiles", "autoshuffle", false);
btnMusicsavecurrentasdefault.Selected = xmlreader.GetValueAsBool("musicfiles", "savePlaylistOnExit", true);
btnMusicloaddefault.Selected = xmlreader.GetValueAsBool("musicfiles", "resumePlaylistOnMusicEnter", true);
btnMusicplaylistscreen.Selected= xmlreader.GetValueAsBool("musicfiles", "playlistIsCurrent", true);
// Videos
_videosPlayListFolder = xmlreader.GetValueAsString("movies", "playlists", playListFolder);
btnVideosrepeatplaylist.Selected = xmlreader.GetValueAsBool("movies", "repeat", true);
}
}
开发者ID:nio22,项目名称:MediaPortal-1,代码行数:32,代码来源:GUISettingsCommon_Playlist.cs
示例4: TvNotifyManager
public TvNotifyManager()
{
using (Settings xmlreader = new MPSettings())
{
_enableRecNotification = xmlreader.GetValueAsBool("mytv", "enableRecNotifier", false);
_preNotifyConfig = xmlreader.GetValueAsInt("mytv", "notifyTVBefore", 300);
}
_busy = false;
_timer = new Timer();
_timer.Stop();
// check every 15 seconds for notifies
_dummyuser = new User();
_dummyuser.IsAdmin = false;
_dummyuser.Name = "Free channel checker";
_timer.Interval = 15000;
_timer.Enabled = true;
// Execute TvNotifyManager in a separate thread, so that it doesn't block the Main UI Render thread when Tvservice connection died
new Thread(() =>
{
_timer.Tick += new EventHandler(_timer_Tick);
}
) {Name = "TvNotifyManager"}.Start();
_notifiedRecordings = new ArrayList();
}
开发者ID:arangas,项目名称:MediaPortal-1,代码行数:26,代码来源:TvNotifyManager.cs
示例5: 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
示例6: LoadSettings
public override void LoadSettings()
{
using (Settings xmlreader = new MPSettings())
{
pixelRatioCheckBox.Checked = xmlreader.GetValueAsBool("dvdplayer", "pixelratiocorrection", false);
aspectRatioComboBox.Text = xmlreader.GetValueAsString("dvdplayer", "armode", "Follow stream");
displayModeComboBox.Text = xmlreader.GetValueAsString("dvdplayer", "displaymode", "Default");
//
// Load all available aspect ratio
//
defaultZoomModeComboBox.Items.Clear();
foreach (Geometry.Type item in Enum.GetValues(typeof (Geometry.Type)))
{
defaultZoomModeComboBox.Items.Add(Util.Utils.GetAspectRatio(item));
}
//
// Set default aspect ratio
//
string defaultAspectRatio = xmlreader.GetValueAsString("dvdplayer", "defaultar",
defaultZoomModeComboBox.Items[0].ToString());
foreach (Geometry.Type item in Enum.GetValues(typeof (Geometry.Type)))
{
string currentAspectRatio = Util.Utils.GetAspectRatio(item);
if (defaultAspectRatio == currentAspectRatio)
{
defaultZoomModeComboBox.SelectedItem = currentAspectRatio;
break;
}
}
}
}
开发者ID:arangas,项目名称:MediaPortal-1,代码行数:33,代码来源:DVDZoom.cs
示例7: 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;
}
}
开发者ID:arangas,项目名称:MediaPortal-1,代码行数:26,代码来源:AppCommandListener.cs
示例8: SaveSettings
private void SaveSettings()
{
using (Settings xmlreader = new MPSettings())
{
xmlreader.SetValue("tvservice", "hostname", _hostName);
}
}
开发者ID:nio22,项目名称:MediaPortal-1,代码行数:7,代码来源:TvSetup.cs
示例9: LoadSettings
public override void LoadSettings()
{
using (Settings xmlreader = new MPSettings())
{
try
{
defaultSubtitleLanguageComboBox.SelectedItem = xmlreader.GetValueAsString("bdplayer", "subtitlelanguage", m_strDefaultSubtitleLanguageISO);
}
catch (Exception ex)
{
CultureInfo ci = new CultureInfo(m_strDefaultSubtitleLanguageISO);
Log.Error("LoadSettings - failed to load default subtitle language, using {0} - {1} ", ci.EnglishName, ex);
defaultSubtitleLanguageComboBox.SelectedItem = ci.EnglishName;
}
//Use Internel Menu
useBDInternalMenu.Checked = xmlreader.GetValueAsBool("bdplayer", "useInternalBDMenu", false);
try
{
defaultAudioLanguageComboBox.SelectedItem=xmlreader.GetValueAsString("bdplayer", "audiolanguage", m_strDefaultAudioLanguageISO);
}
catch (Exception ex)
{
CultureInfo ci = new CultureInfo(m_strDefaultAudioLanguageISO);
Log.Error("LoadSettings - failed to load default audio language, using {0} - {1} ", ci.EnglishName, ex);
defaultAudioLanguageComboBox.SelectedItem = ci.EnglishName;
}
}
}
开发者ID:arangas,项目名称:MediaPortal-1,代码行数:29,代码来源:BD_global.cs
示例10: LoadSettings
public override void LoadSettings()
{
if (_serialPort != null && _serialPort.IsOpen)
_serialPort.Close();
using (Settings reader = new MPSettings())
{
DeviceModelName = reader.GetValueAsString("Auto3DPlugin", "OptomaModel", "Default");
PortName = reader.GetValueAsString("Auto3DPlugin", "OptomaPort", "None");
}
if (_serialPort != null)
{
_serialPort.PortName = PortName;
try
{
if (_serialPort.PortName != "None")
_serialPort.Open();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Auto3D");
Log.Info("Auto3D: " + ex.Message);
}
}
}
开发者ID:yartat,项目名称:Auto3D,代码行数:27,代码来源:OptomaBeamer.cs
示例11: LoadSettings
private void LoadSettings()
{
using (Settings xmlreader = new MPSettings())
{
_hostName = xmlreader.GetValueAsString("tvservice", "hostname", "");
}
}
开发者ID:nio22,项目名称:MediaPortal-1,代码行数:7,代码来源:TvSetup.cs
示例12: 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
示例13: LoadSettings
public void LoadSettings()
{
using (Settings xmlreader = new MPSettings())
{
defStyle = new SubtitleStyle();
defStyle.Load(xmlreader);
delayInterval = xmlreader.GetValueAsInt("subtitles", "delayInterval", 250);
bool save = xmlreader.GetValueAsBool("subtitles", "saveNever", true);
if (save)
{
autoSaveType = AutoSaveTypeEnum.NEVER;
}
else
{
save = xmlreader.GetValueAsBool("subtitles", "saveAsk", false);
autoSaveType = (save ? AutoSaveTypeEnum.ASK : AutoSaveTypeEnum.ALWAYS);
}
posRelativeToFrame = xmlreader.GetValueAsBool("subtitles", "subPosRelative", false);
overrideASSStyle = xmlreader.GetValueAsBool("subtitles", "subStyleOverride", false);
subPaths = xmlreader.GetValueAsString("subtitles", "paths", @".\");
adjustPosY = xmlreader.GetValueAsInt("subtitles", "adjustY", 0);
autoShow = xmlreader.GetValueAsBool("subtitles", "enabled", true);
selectionOff = xmlreader.GetValueAsBool("subtitles", "selectionoff", true);
LoadAdvancedSettings(xmlreader);
}
}
开发者ID:arangas,项目名称:MediaPortal-1,代码行数:28,代码来源:SubSettings.cs
示例14: 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
示例15: IsPluginEnabled
internal static bool IsPluginEnabled(string name)
{
using (Settings xmlreader = new MPSettings())
{
return xmlreader.GetValueAsBool("plugins", name, false);
}
}
开发者ID:ministerkrister,项目名称:Trailers,代码行数:7,代码来源:Utility.cs
示例16: LoadSettings
public override void LoadSettings()
{
if (_serialPort != null && _serialPort.IsOpen)
_serialPort.Close();
using (Settings reader = new MPSettings())
{
DeviceModelName = reader.GetValueAsString("Auto3DPlugin", "EpsonModel", "Default");
PortName = reader.GetValueAsString("Auto3DPlugin", "EpsonPort", "None");
}
if (_serialPort != null)
{
_serialPort.PortName = PortName;
try
{
if (_serialPort.PortName != "None")
_serialPort.Open();
}
catch (Exception ex)
{
Auto3DHelpers.ShowAuto3DMessage("Opening serial port failed: " + ex.Message, false, 0);
Log.Info("Auto3D: " + ex.Message);
}
}
}
开发者ID:yartat,项目名称:Auto3D,代码行数:27,代码来源:EpsonBeamer.cs
示例17: 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
示例18: SaveSettings
private void SaveSettings()
{
using (Profile.Settings xmlwriter = new MPSettings())
{
xmlwriter.SetValue("mpsettings", "pin", Util.Utils.EncryptPin(_pin));
}
}
开发者ID:doskabouter,项目名称:MediaPortal-1,代码行数:7,代码来源:GUISettings.cs
示例19: OnPageLoad
protected override void OnPageLoad()
{
base.OnPageLoad();
//Load settings
Log.Info("GUISkipSteps: {0}", "Load settings");
string regValue = string.Empty;
using (Settings xmlreader = new MPSettings())
{
try
{
regValue = xmlreader.GetValueAsString("movieplayer", "skipsteps", DEFAULT_SETTING);
if (regValue == string.Empty) // config after wizard run 1st
{
regValue = DEFAULT_SETTING;
Log.Info("GeneralSkipSteps - creating new Skip-Settings {0}", "");
}
else if (OldStyle(regValue))
{
regValue = ConvertToNewStyle(regValue);
}
labelCurrent.Label = regValue;
}
catch (Exception ex)
{
Log.Info("GeneralSkipSteps - Exception while loading Skip-Settings: {0}", ex.ToString());
}
}
SetCheckMarksBasedOnString(regValue);
GUIControl.FocusControl(GetID, checkMarkButtonStep1.GetID);
}
开发者ID:sanyaade-embedded-systems,项目名称:MediaPortal-1,代码行数:32,代码来源:GUISettingsSkipSteps.cs
示例20: 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
注:本文中的MPSettings类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论