本文整理汇总了C#中Profile.MPSettings.GetValueAsInt方法的典型用法代码示例。如果您正苦于以下问题:C# Profile.MPSettings.GetValueAsInt方法的具体用法?C# Profile.MPSettings.GetValueAsInt怎么用?C# Profile.MPSettings.GetValueAsInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Profile.MPSettings
的用法示例。
在下文中一共展示了Profile.MPSettings.GetValueAsInt方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadSettings
private void LoadSettings()
{
using (Profile.Settings xmlreader = new Profile.MPSettings())
{
m_iSpeedHorizontal = xmlreader.GetValueAsInt("gui", "ScrollSpeedRight", 1);
m_iSpeedVertical = xmlreader.GetValueAsInt("gui", "ScrollSpeedDown", 4);
m_iListLoopDelay = xmlreader.GetValueAsInt("gui", "listLoopDelay", 100);
}
}
示例2: LoadSettings
// Need change for 1.3.0
#region Serialization
private void LoadSettings()
{
using (Profile.Settings xmlreader = new Profile.MPSettings())
{
// Mark Watched
btnMarkWatched.Selected = xmlreader.GetValueAsBool("movies", "markwatched", true);
btnKeepFoldersTogether.Selected = xmlreader.GetValueAsBool("movies", "keepfolderstogether", false);
btnCommercialSkip.Selected = xmlreader.GetValueAsBool("comskip", "automaticskip", false);
_watchedPercentage = xmlreader.GetValueAsInt("movies", "playedpercentagewatched", 95);
_videoAudioDelay = xmlreader.GetValueAsInt("FFDShow", "audiodelayInterval", 50);
}
}
示例3: LoadSettings
private void LoadSettings()
{
using (Profile.Settings xmlreader = new Profile.MPSettings())
{
checkBoxUseTrayIcon.Checked = xmlreader.GetValueAsBool("audioscrobbler", "showtrayicon", true);
checkBoxShowBallonTips.Checked = xmlreader.GetValueAsBool("audioscrobbler", "showballontips", true);
checkBoxSubmitToProfile.Checked = xmlreader.GetValueAsBool("audioscrobbler", "submitradiotracks", true);
checkBoxDirectSkip.Checked = xmlreader.GetValueAsBool("audioscrobbler", "directskip", false);
numericUpDownListEntries.Value = xmlreader.GetValueAsInt("audioscrobbler", "listentrycount", 24);
comboBoxStreamPlayerType.SelectedIndex = xmlreader.GetValueAsInt("audioscrobbler", "streamplayertype", 0);
checkBoxOneClickMode.Checked = xmlreader.GetValueAsBool("audioscrobbler", "oneclickstart", false);
}
}
示例4: LoadSettings
private void LoadSettings()
{
using (Profile.Settings xmlreader = new Profile.MPSettings())
{
m_iSpeed = xmlreader.GetValueAsInt("pictures", "speed", 3);
m_iTransistion = xmlreader.GetValueAsInt("pictures", "transition", 20);
m_iKenBurnsSpeed = xmlreader.GetValueAsInt("pictures", "kenburnsspeed", 20);
m_bKenBurns = xmlreader.GetValueAsBool("pictures", "kenburns", false);
m_bRandom = xmlreader.GetValueAsBool("pictures", "random", false);
m_bXFade = (!m_bRandom & !m_bKenBurns);
cmShuffleSlideShows.Selected = xmlreader.GetValueAsBool("pictures", "autoShuffle", false);
cmLoopSlideShows.Selected = xmlreader.GetValueAsBool("pictures", "autoRepeat", false);
cmExifSlideShows.Selected = xmlreader.GetValueAsBool("pictures", "useExif", true);
cmPicasaSlideShows.Selected = xmlreader.GetValueAsBool("pictures", "usePicasa", false);
cmGroupByDaySlideShows.Selected = xmlreader.GetValueAsBool("pictures", "useDayGrouping", false);
cmEnablePlaySlideShows.Selected = xmlreader.GetValueAsBool("pictures", "enableVideoPlayback", false);
cmPlayInSlideShows.Selected = xmlreader.GetValueAsBool("pictures", "playVideosInSlideshows", false);
}
}
示例5: LoadSettings
private void LoadSettings()
{
using (Profile.Settings xmlreader = new Profile.MPSettings())
{
_speed = xmlreader.GetValueAsInt("pictures", "speed", 3);
_slideShowTransistionFrames = xmlreader.GetValueAsInt("pictures", "transition", 20);
_kenBurnTransistionSpeed = xmlreader.GetValueAsInt("pictures", "kenburnsspeed", 20);
_useKenBurns = xmlreader.GetValueAsBool("pictures", "kenburns", false);
_useRandomTransitions = xmlreader.GetValueAsBool("pictures", "random", true);
_autoShuffle = xmlreader.GetValueAsBool("pictures", "autoShuffle", false);
_autoRepeat = xmlreader.GetValueAsBool("pictures", "autoRepeat", false);
}
}
示例6: LoadSettings
protected override void LoadSettings()
{
base.LoadSettings();
using (Profile.Settings xmlreader = new Profile.MPSettings())
{
MusicState.StartWindow = xmlreader.GetValueAsInt("music", "startWindow", GetID);
MusicState.View = xmlreader.GetValueAsString("music", "startview", string.Empty);
_createMissingFolderThumbCache = xmlreader.GetValueAsBool("thumbnails", "musicfolderondemand", true);
_createMissingFolderThumbs = xmlreader.GetValueAsBool("musicfiles", "createMissingFolderThumbs", false);
_useFolderThumbs = xmlreader.GetValueAsBool("musicfiles", "useFolderThumbs", true);
_selectOption = xmlreader.GetValueAsString("musicfiles", "selectOption", "play");
_addAllOnSelect = xmlreader.GetValueAsBool("musicfiles", "addall", true);
_playlistIsCurrent = xmlreader.GetValueAsBool("musicfiles", "playlistIsCurrent", true);
for (int i = 0; i < _sortModes.Length; ++i)
{
_sortTags1[i] = xmlreader.GetValueAsString("mymusic", _sortModes[i] + "1", _defaultSortTags1[i]);
_sortTags2[i] = xmlreader.GetValueAsString("mymusic", _sortModes[i] + "2", _defaultSortTags2[i]);
}
string playListFolder = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
playListFolder += @"\My Playlists";
m_strPlayListPath = xmlreader.GetValueAsString("music", "playlists", playListFolder);
m_strPlayListPath = Util.Utils.RemoveTrailingSlash(m_strPlayListPath);
_shareList.Clear();
string strDefault = xmlreader.GetValueAsString("music", "default", string.Empty);
for (int i = 0; i < VirtualDirectory.MaxSharesCount; i++)
{
string strShareName = String.Format("sharename{0}", i);
string strSharePath = String.Format("sharepath{0}", i);
string strPincode = String.Format("pincode{0}", i);
string shareType = String.Format("sharetype{0}", i);
string shareServer = String.Format("shareserver{0}", i);
string shareLogin = String.Format("sharelogin{0}", i);
string sharePwd = String.Format("sharepassword{0}", i);
string sharePort = String.Format("shareport{0}", i);
string remoteFolder = String.Format("shareremotepath{0}", i);
string shareViewPath = String.Format("shareview{0}", i);
Share share = new Share();
share.Name = xmlreader.GetValueAsString("music", strShareName, string.Empty);
share.Path = xmlreader.GetValueAsString("music", strSharePath, string.Empty);
share.Pincode = xmlreader.GetValueAsInt("music", strPincode, -1);
share.IsFtpShare = xmlreader.GetValueAsBool("music", shareType, false);
share.FtpServer = xmlreader.GetValueAsString("music", shareServer, string.Empty);
share.FtpLoginName = xmlreader.GetValueAsString("music", shareLogin, string.Empty);
share.FtpPassword = xmlreader.GetValueAsString("music", sharePwd, string.Empty);
share.FtpPort = xmlreader.GetValueAsInt("music", sharePort, 21);
share.FtpFolder = xmlreader.GetValueAsString("music", remoteFolder, "/");
share.DefaultLayout = (Layout)xmlreader.GetValueAsInt("music", shareViewPath, (int)Layout.List);
if (share.Name.Length > 0)
{
if (strDefault == share.Name)
{
share.Default = true;
}
_shareList.Add(share);
}
else
{
break;
}
}
}
}
示例7: LoadSettings
private void LoadSettings()
{
_listLocations.Clear();
using (Profile.Settings xmlreader = new Profile.MPSettings())
{
_locationCode = xmlreader.GetValueAsString("weather", "location", string.Empty);
_temperatureFarenheit = xmlreader.GetValueAsString("weather", "temperature", "C");
int loadWind = xmlreader.GetValueAsInt("weather", "speed", 0);
switch (loadWind)
{
case 0:
_currentWindUnit = WindUnit.Kmh;
break;
case 1:
_currentWindUnit = WindUnit.mph;
break;
case 2:
_currentWindUnit = WindUnit.ms;
break;
case 3:
_currentWindUnit = WindUnit.Kn;
break;
case 4:
_currentWindUnit = WindUnit.Bft;
break;
default:
_currentWindUnit = WindUnit.Bft;
break;
}
_refreshIntercal = xmlreader.GetValueAsInt("weather", "refresh", 60);
_lastRefreshTime = DateTime.Now.AddMinutes(-(_refreshIntercal + 1));
_skipConnectionTest = xmlreader.GetValueAsBool("weather", "skipconnectiontest", false);
Log.Info("GUIWindowWeather: SkipConnectionTest: {0}", _skipConnectionTest);
bool bFound = false;
for (int i = 0; i < VirtualDirectory.MaxSharesCount; i++)
{
string cityTag = String.Format("city{0}", i);
string strCodeTag = String.Format("code{0}", i);
string strSatUrlTag = String.Format("sat{0}", i);
string strTempUrlTag = String.Format("temp{0}", i);
string strUVUrlTag = String.Format("uv{0}", i);
string strWindsUrlTag = String.Format("winds{0}", i);
string strHumidUrlTag = String.Format("humid{0}", i);
string strPrecipUrlTag = String.Format("precip{0}", i);
string city = xmlreader.GetValueAsString("weather", cityTag, string.Empty);
string strCode = xmlreader.GetValueAsString("weather", strCodeTag, string.Empty);
string strSatURL = xmlreader.GetValueAsString("weather", strSatUrlTag, string.Empty);
string strTempURL = xmlreader.GetValueAsString("weather", strTempUrlTag, string.Empty);
string strUVURL = xmlreader.GetValueAsString("weather", strUVUrlTag, string.Empty);
string strWindsURL = xmlreader.GetValueAsString("weather", strWindsUrlTag, string.Empty);
string strHumidURL = xmlreader.GetValueAsString("weather", strHumidUrlTag, string.Empty);
string strPrecipURL = xmlreader.GetValueAsString("weather", strPrecipUrlTag, string.Empty);
if (city.Length > 0 && strCode.Length > 0)
{
if (strSatURL.Length == 0)
{
//strSatURL = "http://www.heute.de/CMO/frontend/subsystem_we/WeShowPicture/0,6008,161,00.gif";
//strSatURL = @"http://images.intellicast.com/WeatherImg/SatelliteLoop/hieusat_None_anim.gif";
//strSatURL = @"http://www.sat24.com/image.ashx?country=eu&type=loop&sat=vis";
strSatURL = @"http://www.sat24.com/image.ashx?country=eu";
}
LocationInfo loc = new LocationInfo();
loc.City = city;
loc.CityCode = strCode;
loc.UrlSattelite = strSatURL;
loc.UrlTemperature = strTempURL;
loc.UrlUvIndex = strUVURL;
loc.UrlWinds = strWindsURL;
loc.UrlHumidity = strHumidURL;
loc.UrlPrecip = strPrecipURL;
_listLocations.Add(loc);
if (String.Compare(_locationCode, strCode, true) == 0)
{
bFound = true;
}
}
}
if (!bFound)
{
if (_listLocations.Count > 0)
{
_locationCode = ((LocationInfo)_listLocations[0]).CityCode;
}
}
}
}
示例8: LoadSettings
private void LoadSettings()
{
using (Profile.Settings xmlreader = new Profile.MPSettings())
{
m_iSpeed = xmlreader.GetValueAsInt("pictures", "speed", 3);
m_iTransistion = xmlreader.GetValueAsInt("pictures", "transition", 20);
m_iKenBurnsSpeed = xmlreader.GetValueAsInt("pictures", "kenburnsspeed", 20);
m_bKenBurns = xmlreader.GetValueAsBool("pictures", "kenburns", false);
m_bRandom = xmlreader.GetValueAsBool("pictures", "random", false);
m_bXFade = (!m_bRandom & !m_bKenBurns);
cmShuffleSlideShows.Selected = xmlreader.GetValueAsBool("pictures", "autoShuffle", false);
cmLoopSlideShows.Selected = xmlreader.GetValueAsBool("pictures", "autoRepeat", false);
}
}
示例9: LoadButtonNames
protected override void LoadButtonNames()
{
if (menuMain == null)
{
return;
}
menuMain.ButtonInfos.Clear();
ArrayList plugins = PluginManager.SetupForms;
using (Profile.Settings xmlreader = new Profile.MPSettings())
{
foreach (ISetupForm setup in plugins)
{
string plugInText;
string focusTexture;
string nonFocusTexture;
string hover;
string nonFocusHover;
if (setup.GetHome(out plugInText, out focusTexture, out nonFocusTexture, out hover))
{
if (setup.PluginName().Equals("Home"))
{
continue;
}
IShowPlugin showPlugin = setup as IShowPlugin;
string showInPlugIns = xmlreader.GetValue("myplugins", setup.PluginName());
if ((showInPlugIns == null) || (showInPlugIns.Length < 1))
{
if ((showPlugin != null) && (showPlugin.ShowDefaultHome() == true))
{
continue;
}
}
else
{
if (showInPlugIns.ToLowerInvariant().Equals("no"))
{
continue;
}
}
if ((focusTexture == null) || (focusTexture.Length < 1))
{
focusTexture = setup.PluginName();
}
if ((nonFocusTexture == null) || (nonFocusTexture.Length < 1))
{
nonFocusTexture = setup.PluginName();
}
if ((hover == null) || (hover.Length < 1))
{
hover = setup.PluginName();
}
focusTexture = GetFocusTextureFileName(focusTexture);
nonFocusTexture = GetNonFocusTextureFileName(nonFocusTexture);
nonFocusHover = GetNonFocusHoverFileName(hover);
hover = GetHoverFileName(hover);
int index = xmlreader.GetValueAsInt("pluginSorting", "my Plugins", Int32.MaxValue);
menuMain.ButtonInfos.Add(new MenuButtonInfo(plugInText, setup.GetWindowId(), focusTexture, nonFocusTexture,
hover, nonFocusHover, index));
}
}
}
}
示例10: SetOutputContext
public override bool SetOutputContext(OutputContextType outputType)
{
if (VisualizationWindow == null)
{
return false;
}
if (_Initialized && !firstRun)
{
return true;
}
// If width or height are 0 the call to CreateVis will fail.
// If width or height are 1 the window is in transition so we can ignore it.
if (VisualizationWindow.Width <= 1 || VisualizationWindow.Height <= 1)
{
return false;
}
if (VizPluginInfo == null || VizPluginInfo.FilePath.Length == 0 || !File.Exists(VizPluginInfo.FilePath))
{
return false;
}
string vizPath = VizPluginInfo.FilePath;
string configFile = Path.Combine(System.Windows.Forms.Application.StartupPath, @"musicplayer\plugins\visualizations\Sonique\vis.ini");
try
{
// Call Play befor use BASSVIS_ExecutePlugin (moved here)
BassVis.BASSVIS_SetPlayState(_visParam, BASSVIS_PLAYSTATE.Play);
using (Profile.Settings xmlreader = new Profile.MPSettings())
{
VizPluginInfo.UseOpenGL = xmlreader.GetValueAsBool("musicvisualization", "useOpenGL", true);
VizPluginInfo.UseCover = xmlreader.GetValueAsBool("musicvisualization", "useCover", true);
VizPluginInfo.RenderTiming = xmlreader.GetValueAsInt("musicvisualization", "renderTiming", 25);
VizPluginInfo.ViewPortSize = xmlreader.GetValueAsInt("musicvisualization", "viewPort", 0);
}
// Create the Visualisation
visExec = new BASSVIS_EXEC(vizPath);
visExec.SON_ConfigFile = configFile;
visExec.SON_ParentHandle = VisualizationWindow.Handle;
visExec.Width = VisualizationWindow.Width;
visExec.Height = VisualizationWindow.Height;
visExec.SON_UseOpenGL = VizPluginInfo.UseOpenGL;
visExec.SON_ViewportWidth = VizPluginInfo.ViewPortSizeX;
visExec.SON_ViewportHeight = VizPluginInfo.ViewPortSizeY;
visExec.Left = VisualizationWindow.Left;
visExec.Top = VisualizationWindow.Top;
visExec.SON_ShowFPS = true;
// can not check IsRadio on first start
// so ProgressBar and Cover Visible state will hide after change to the next Plugin to
if (Bass.IsRadio)
{
// no duration deactivate ProgressBar
visExec.SON_ShowPrgBar = false;
// Cover-Support used only on first start if VizPluginInfo.UseCover = true
// after or change the plugin in FullScreen, Cover-Support will disable for RadioStreams
visExec.SON_UseCover = false;
}
else
{
visExec.SON_ShowPrgBar = true;
visExec.SON_UseCover = VizPluginInfo.UseCover;
}
BassVis.BASSVIS_ExecutePlugin(visExec, _visParam);
if (_visParam.VisHandle != 0)
{
// Config Settings
BassVis.BASSVIS_SetOption(_visParam, BASSVIS_CONFIGFLAGS.BASSVIS_SONIQUEVIS_CONFIG_RENDERTIMING, VizPluginInfo.RenderTiming);
BassVis.BASSVIS_SetOption(_visParam, BASSVIS_CONFIGFLAGS.BASSVIS_SONIQUEVIS_CONFIG_USESLOWFADE, 1);
BassVis.BASSVIS_SetOption(_visParam, BASSVIS_CONFIGFLAGS.BASSVIS_SONIQUEVIS_CONFIG_SLOWFADE, 5);
BassVis.BASSVIS_SetOption(_visParam, BASSVIS_CONFIGFLAGS.BASSVIS_CONFIG_FFTAMP, 5);
// SetForegroundWindow
GUIGraphicsContext.form.Activate();
}
firstRun = false;
}
catch (Exception ex)
{
Log.Error(
"Visualization Manager: Sonique visualization engine initialization failed with the following exception {0}",
ex);
}
_Initialized = _visParam.VisHandle != 0;
return _visParam.VisHandle != 0;
}
示例11: LoadSettings
protected override void LoadSettings()
{
base.LoadSettings();
using (Profile.Settings xmlreader = new Profile.MPSettings())
{
currentLayout = (Layout) xmlreader.GetValueAsInt(SerializeName, "layout", (int) Layout.List);
m_bSortAscending = xmlreader.GetValueAsBool(SerializeName, "sortasc", true);
VideoState.StartWindow = xmlreader.GetValueAsInt("movies", "startWindow", GetID);
VideoState.View = xmlreader.GetValueAsString("movies", "startview", "369");
// Prevent unaccesible My Videos from corrupted config
if (!IsVideoWindow(VideoState.StartWindow))
{
VideoState.StartWindow = GetID;
VideoState.View = "369";
}
_addVideoFilesToDb = xmlreader.GetValueAsBool("gui", "addVideoFilesToDb", false);
_isFuzzyMatching = xmlreader.GetValueAsBool("movies", "fuzzyMatching", false);
_scanSkipExisting = xmlreader.GetValueAsBool("moviedatabase", "scanskipexisting", false);
_getActors = xmlreader.GetValueAsBool("moviedatabase", "getactors", true);
_markWatchedFiles = xmlreader.GetValueAsBool("movies", "markwatched", true);
//_eachFolderIsMovie = xmlreader.GetValueAsBool("movies", "eachFolderIsMovie", false);
_fileMenuEnabled = xmlreader.GetValueAsBool("filemenu", "enabled", true);
_fileMenuPinCode = Util.Utils.DecryptPassword(xmlreader.GetValueAsString("filemenu", "pincode", string.Empty));
_howToPlayAll = xmlreader.GetValueAsInt("movies", "playallinfolder", 3);
_watchedPercentage = xmlreader.GetValueAsInt("movies", "playedpercentagewatched", 95);
_videoInfoInShare = xmlreader.GetValueAsBool("moviedatabase", "movieinfoshareview", false);
_BDInternalMenu = xmlreader.GetValueAsBool("bdplayer", "useInternalBDPlayer", true);
_virtualDirectory = VirtualDirectories.Instance.Movies;
// External player
_useInternalVideoPlayer = xmlreader.GetValueAsBool("movieplayer", "internal", true);
_useInternalDVDVideoPlayer = xmlreader.GetValueAsBool("dvdplayer", "internal", true);
_externalPlayerExtensions = xmlreader.GetValueAsString("movieplayer", "extensions", "");
_wolTimeout = xmlreader.GetValueAsInt("WOL", "WolTimeout", 10);
_wolResendTime = xmlreader.GetValueAsInt("WOL", "WolResendTime", 1);
if (_virtualStartDirectory == string.Empty)
{
if (_virtualDirectory.DefaultShare != null)
{
if (_virtualDirectory.DefaultShare.IsFtpShare)
{
//remote:hostname?port?login?password?folder
_currentFolder = _virtualDirectory.GetShareRemoteURL(_virtualDirectory.DefaultShare);
_virtualStartDirectory = _currentFolder;
}
else
{
_currentFolder = _virtualDirectory.DefaultShare.Path;
_virtualStartDirectory = _virtualDirectory.DefaultShare.Path;
}
}
}
_askBeforePlayingDVDImage = xmlreader.GetValueAsBool("daemon", "askbeforeplaying", false);
if (xmlreader.GetValueAsBool("movies", "rememberlastfolder", false))
{
string lastFolder = xmlreader.GetValueAsString("movies", "lastfolder", _currentFolder);
if (VirtualDirectory.IsImageFile(Path.GetExtension(lastFolder)))
{
lastFolder = "root";
}
if (lastFolder != "root")
{
_currentFolder = lastFolder;
}
}
_switchRemovableDrives = xmlreader.GetValueAsBool("movies", "SwitchRemovableDrives", true);
_useOnlyNfoScraper = xmlreader.GetValueAsBool("moviedatabase", "useonlynfoscraper", false);
_doNotUseDatabase = xmlreader.GetValueAsBool("moviedatabase", "donotusedatabase", false);
}
if (_currentFolder.Length > 0 && _currentFolder == _virtualStartDirectory)
{
VirtualDirectory vDir = new VirtualDirectory();
vDir.LoadSettings("movies");
}
}
示例12: LoadSettings
/// <summary>
/// Load Settings
/// </summary>
private void LoadSettings()
{
using (Profile.Settings xmlreader = new Profile.MPSettings())
{
Log.Info("BASS: Loading Settings");
string strAudioPlayer = xmlreader.GetValueAsString("audioplayer", "playerId", "0");
_audioPlayer = (AudioPlayer)Enum.Parse(typeof (AudioPlayer), strAudioPlayer);
_soundDevice = xmlreader.GetValueAsString("audioplayer", "sounddevice", "Default Sound Device");
_soundDeviceID = xmlreader.GetValueAsString("audioplayer", "sounddeviceid", "");
_streamVolume = xmlreader.GetValueAsInt("audioplayer", "streamOutputLevel", 85);
_bufferingMs = xmlreader.GetValueAsInt("audioplayer", "buffering", 5000);
if (_bufferingMs <= 0)
{
_bufferingMs = 1000;
}
else if (_bufferingMs > 8000)
{
_bufferingMs = 8000;
}
_crossFadeIntervalMs = xmlreader.GetValueAsInt("audioplayer", "crossfade", 4000);
if (_crossFadeIntervalMs < 0)
{
_crossFadeIntervalMs = 0;
}
else if (_crossFadeIntervalMs > 16000)
{
_crossFadeIntervalMs = 16000;
}
_softStop = xmlreader.GetValueAsBool("audioplayer", "fadeOnStartStop", true);
_useSkipSteps = xmlreader.GetValueAsBool("audioplayer", "useSkipSteps", false);
_enableReplaygain = xmlreader.GetValueAsBool("audioplayer", "enableReplayGain", false);
_enableAlbumReplaygain = xmlreader.GetValueAsBool("audioplayer", "enableAlbumReplayGain", false);
_asioBalance = (float)xmlreader.GetValueAsInt("audioplayer", "asiobalance", 0) / 100.00f;
_wasApiExclusiveMode = xmlreader.GetValueAsBool("audioplayer", "wasapiExclusive", false);
_wasApiSpeakers = xmlreader.GetValueAsInt("audioplayer", "wasApiSpeakers", 1);
bool doGaplessPlayback = xmlreader.GetValueAsBool("audioplayer", "gaplessPlayback", false);
if (doGaplessPlayback)
{
_crossFadeIntervalMs = 200;
_playBackType = PlayBackType.GAPLESS;
}
else
{
if (_crossFadeIntervalMs == 0)
{
_playBackType = PlayBackType.NORMAL;
//_crossFadeIntervalMs = 100;
}
else
{
_playBackType = PlayBackType.CROSSFADE;
}
}
_upMixMono = xmlreader.GetValueAsInt("audioplayer", "upMixMono", 0);
_upMixStereo = xmlreader.GetValueAsInt("audioplayer", "upMixStereo", 0);
_upMixQuadro = xmlreader.GetValueAsInt("audioplayer", "upMixQuadro", 0);
_upMixFiveDotOne = xmlreader.GetValueAsInt("audioplayer", "upMixFiveDotOne", 0);
}
}
示例13: LoadSettings
private static void LoadSettings()
{
try
{
using (Profile.Settings xmlreader = new Profile.MPSettings())
{
int configQuality = xmlreader.GetValueAsInt("thumbnails", "quality", 2);
switch (configQuality)
{
case 0:
Quality = ThumbQuality.fastest;
SetEncoderParams(25);
Log.Warn("Thumbs: MediaPortal is using the fastest thumbnail mode");
break;
case 1:
Quality = ThumbQuality.fast;
SetEncoderParams(33);
Log.Info("Thumbs: MediaPortal is using fast thumbnails");
break;
case 2:
Quality = ThumbQuality.average;
SetEncoderParams(50);
Log.Info("Thumbs: MediaPortal is using average thumbnails");
break;
case 3:
Quality = ThumbQuality.higher;
SetEncoderParams(77);
Log.Info("Thumbs: MediaPortal is using high quality thumbnails");
break;
case 4:
Quality = ThumbQuality.highest;
SetEncoderParams(97);
Log.Warn("Thumbs: MediaPortal is using very high quality thumbnail mode");
break;
case 5:
Quality = ThumbQuality.uhd;
SetEncoderParams(100);
Log.Warn("Thumbs: MediaPortal is using UHD quality thumbnail mode");
break;
}
}
}
catch (Exception ex)
{
Log.Error("Thumbs: Error loading thumbnail quality - {0}", ex.Message);
}
}
示例14: InitWindSpeedSelect
private void InitWindSpeedSelect()
{
int unit;
string currentWindUnit;
using (Profile.Settings xmlreader = new Profile.MPSettings())
{
unit = xmlreader.GetValueAsInt("weather", "speed", 0);
}
switch (unit)
{
case 0:
currentWindUnit = GUILocalizeStrings.Get(561); // km/h
break;
case 1:
currentWindUnit = GUILocalizeStrings.Get(562); // mph
break;
case 2:
currentWindUnit = GUILocalizeStrings.Get(564); // m/s
break;
case 3:
currentWindUnit = GUILocalizeStrings.Get(563); // kn
break;
case 4:
currentWindUnit = GUILocalizeStrings.Get(565); // bft
break;
default:
currentWindUnit = GUILocalizeStrings.Get(565); // bft
break;
}
ArrayList availableUnits = new ArrayList();
availableUnits.Add(GUILocalizeStrings.Get(561)); // km/h
availableUnits.Add(GUILocalizeStrings.Get(562)); // mph
availableUnits.Add(GUILocalizeStrings.Get(563)); // kn
availableUnits.Add(GUILocalizeStrings.Get(564)); // m/s
availableUnits.Add(GUILocalizeStrings.Get(565)); // bft
int index = 0;
foreach (string au in availableUnits)
{
btnWindSpeedSelect.AddItem(au, index);
if (au == currentWindUnit)
{
btnWindSpeedSelect.SelectedItem = index;
}
index++;
}
}
示例15: InitRefreshInterval
private void InitRefreshInterval()
{
int refresh;
using (Profile.Settings xmlreader = new Profile.MPSettings())
{
refresh = xmlreader.GetValueAsInt("weather", "refresh", 60);
}
btnRefreshInterval.AddItemRange(1, 60); // minutes
btnRefreshInterval.SelectedItem = refresh;
}