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


C# Profile.MPSettings.GetValueAsString方法代码示例

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


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

示例1: LoadSettings

    public void LoadSettings(string section)
    {
      Clear();
      using (Profile.Settings xmlreader = new Profile.MPSettings())
      {
        string strDefault = xmlreader.GetValueAsString(section, "default", string.Empty);
        for (int i = 0; i < MaximumShares; 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(section, strShareName, string.Empty);
          share.Path = xmlreader.GetValueAsString(section, strSharePath, string.Empty);
          string pinCode = Utils.DecryptPin(xmlreader.GetValueAsString(section, strPincode, string.Empty));
          if (pinCode != string.Empty)
            share.Pincode = Convert.ToInt32(pinCode);
          else
            share.Pincode = -1;

          share.IsFtpShare = xmlreader.GetValueAsBool(section, shareType, false);
          share.FtpServer = xmlreader.GetValueAsString(section, shareServer, string.Empty);
          share.FtpLoginName = xmlreader.GetValueAsString(section, shareLogin, string.Empty);
          share.FtpPassword = xmlreader.GetValueAsString(section, sharePwd, string.Empty);
          share.FtpPort = xmlreader.GetValueAsInt(section, sharePort, 21);
          share.FtpFolder = xmlreader.GetValueAsString(section, remoteFolder, "/");
          share.DefaultLayout = (Layout)xmlreader.GetValueAsInt(section, shareViewPath, (int)Layout.List);

          if (share.Name.Length > 0)
          {
            if (strDefault == share.Name)
            {
              share.Default = true;
              if (defaultshare == null)
              {
                defaultshare = share;
              }
            }
            Add(share);
          }
          else break;
        }
      }
    }
开发者ID:nio22,项目名称:MediaPortal-1,代码行数:53,代码来源:VirtualDirectory.cs

示例2: LoadSettings

 private void LoadSettings()
 {
   using (Profile.Settings xmlreader = new Profile.MPSettings())
   {
     chkboxFixScrollbar.Checked = xmlreader.GetValueAsBool("home", "scrollfixed", false);
     chkBoxUseMyPlugins.Checked = xmlreader.GetValueAsBool("home", "usemyplugins", true);
     chkBoxAnimation.Checked = xmlreader.GetValueAsBool("home", "enableanimation", true);
     checkBoxShowSeconds.Checked = xmlreader.GetValueAsBool("home", "LongTimeFormat", false);
     string text = xmlreader.GetValueAsString("home", "dateformat", "<Day> <DD>.<Month>");
     cboxFormat.Items.Add(text);
     if (!text.Equals("<Day> <DD>.<Month>"))
     {
       cboxFormat.Items.Add("<Day> <DD>.<Month>");
     }
     if (!text.Equals("<Day> <DD> <Month>"))
     {
       cboxFormat.Items.Add("<Day> <DD> <Month>");
     }
     if (!text.Equals("<Day> <Month> <DD>"))
     {
       cboxFormat.Items.Add("<Day> <Month> <DD>");
     }
     cboxFormat.Text = text;
   }
 }
开发者ID:npcomplete111,项目名称:MediaPortal-1,代码行数:25,代码来源:GUIHomeSetupForm.cs

示例3: Init

    public override bool Init()
    {
      using (Profile.Settings xmlreader = new Profile.MPSettings())
      {
        _playlistFolder = xmlreader.GetValueAsString("music", "playlists", string.Empty);
        _savePlaylistOnExit = xmlreader.GetValueAsBool("musicfiles", "savePlaylistOnExit", false);
        _resumePlaylistOnEnter = xmlreader.GetValueAsBool("musicfiles", "resumePlaylistOnMusicEnter", false);
        playlistPlayer.RepeatPlaylist = xmlreader.GetValueAsBool("musicfiles", "repeat", true);
      }

      if (_resumePlaylistOnEnter)
      {
        Log.Info("GUIMusicPlaylist: Loading default playlist {0}", _defaultPlaylist);
        bw = new BackgroundWorker();
        bw.WorkerSupportsCancellation = true;
        bw.WorkerReportsProgress = false;
        bw.DoWork += new DoWorkEventHandler(bw_DoWork);
        bw.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bw_RunWorkerCompleted);
        bw.RunWorkerAsync();
      }
      else
      {
        defaultPlaylistLoaded = true;
      }

      GUIWindowManager.Receivers += new SendMessageHandler(this.OnThreadMessage);
      GUIWindowManager.OnNewAction += new OnActionHandler(this.OnNewAction);
      playlistPlayer.PlaylistChanged += playlistPlayer_Changed; 
      return Load(GUIGraphicsContext.GetThemedSkinFile(@"\myMusicplaylist.xml"));
    }
开发者ID:Eddie-Jee,项目名称:MediaPortal-1,代码行数:30,代码来源:GUIMusicPlaylist.cs

示例4: LoadSettings

 private void LoadSettings()
 {
   using (Profile.Settings xmlreader = new Profile.MPSettings())
   {
     btnDisableSimilarTrackLookup.Selected = !xmlreader.GetValueAsBool("musicmisc", "lookupSimilarTracks", true);
     _vuMeter= xmlreader.GetValueAsString("musicmisc", "vumeter", "none");
     _vuMeter = UppercaseFirst(_vuMeter);
   }
 }
开发者ID:arangas,项目名称:MediaPortal-1,代码行数:9,代码来源:GUISettingsMusic_NowPlaying.cs

示例5: LoadSettings

    private void LoadSettings()
    {
      using (Profile.Settings xmlreader = new Profile.MPSettings())
      {
        _pin = Util.Utils.DecryptPin(xmlreader.GetValueAsString("mpsettings", "pin", string.Empty));

        if (_pin != string.Empty)
        {
          btnLocked.Selected = true;
        }
      }
      
    }
开发者ID:edterbak,项目名称:MediaPortal-1,代码行数:13,代码来源:GUISettings.cs

示例6: LoadSettings

    private void LoadSettings()
    {
      using (Profile.Settings xmlreader = new Profile.MPSettings())
      {
        btnFetchlastfmcovers.Selected = !xmlreader.GetValueAsBool("musicmisc", "fetchlastfmcovers", true);
        btnFetchlastfmtopalbums.Selected = !xmlreader.GetValueAsBool("musicmisc", "fetchlastfmtopalbums", true);
        btnFetchlastfmtracktags.Selected = !xmlreader.GetValueAsBool("musicmisc", "fetchlastfmtracktags", true);
        btnSwitchArtistOnLastFMSubmit.Selected= xmlreader.GetValueAsBool("musicmisc", "switchArtistOnLastFMSubmit",
                                                                              false);

        _vuMeter= xmlreader.GetValueAsString("musicmisc", "vumeter", "none");
        _vuMeter = UppercaseFirst(_vuMeter);
      }
    }
开发者ID:nio22,项目名称:MediaPortal-1,代码行数:14,代码来源:GUISettingsMusic_NowPlaying.cs

示例7: 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";
        }

        _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.DecryptPin(xmlreader.GetValueAsString("filemenu", "pincode", string.Empty));
        _howToPlayAll = xmlreader.GetValueAsInt("movies", "playallinfolder", 3);

        _virtualDirectory = VirtualDirectories.Instance.Movies;

        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);
      }

      if (_currentFolder.Length > 0 && _currentFolder == _virtualStartDirectory)
      {
        VirtualDirectory vDir = new VirtualDirectory();
        vDir.LoadSettings("movies");
        int pincode = 0;
        bool FolderPinProtected = vDir.IsProtectedShare(_currentFolder, out pincode);
        if (FolderPinProtected)
        {
          _currentFolder = string.Empty;
        }
      }

      if (_currentFolder.Length > 0 && !_virtualDirectory.IsRemote(_currentFolder))
      {
        DirectoryInfo dirInfo = new DirectoryInfo(_currentFolder);

        while (dirInfo.Parent != null)
        {
          string dirName = dirInfo.Name;
          dirInfo = dirInfo.Parent;
          string currentParentFolder = @dirInfo.FullName;
          _history.Set(dirName, currentParentFolder);
        }
      }
    }
开发者ID:npcomplete111,项目名称:MediaPortal-1,代码行数:88,代码来源:GUIVideoFiles.cs

示例8: StartBackgroundMusic

    private void StartBackgroundMusic(string path)
    {
      if (g_Player.IsMusic || g_Player.IsRadio || g_Player.IsTV || g_Player.IsVideo)
      {
        return;
      }

      // Load Music related settings here, as the Loadsetting for pictures is called too late for the Backgroundmusic task
      using (Profile.Settings reader = new Profile.MPSettings())
      {
        _musicFileExtensions = reader.GetValueAsString("music", "extensions", ".mp3,.pls,.wpl").Split(',');
        _autoShuffleMusic = reader.GetValueAsBool("musicfiles", "autoshuffle", false);
      }

      foreach (string extension in _musicFileExtensions)
      {
        string filename = string.Format(@"{0}\Folder{1}", path, extension);

        if (File.Exists(filename) == false)
        {
          continue;
        }

        try
        {
          PlayList playlist = playlistPlayer.GetPlaylist(PlayListType.PLAYLIST_MUSIC_TEMP);
          playlist.Clear();
          playlistPlayer.Reset();
          playlistPlayer.CurrentPlaylistType = PlayListType.PLAYLIST_MUSIC_TEMP;

          // Check, if we got a playlist to allow shuffle
          if (Util.Utils.IsPlayList(filename))
          {
            IPlayListIO loader = PlayListFactory.CreateIO(filename);
            if (loader == null)
            {
              return;
            }

            if (!loader.Load(playlist, filename))
            {
              return;
            }

            if (_autoShuffleMusic)
            {
              Random r = new Random((int)DateTime.Now.Ticks);
              int shuffleCount = r.Next() % 50;
              for (int i = 0; i < shuffleCount; ++i)
              {
                playlist.Shuffle();
              }
            }
          }
          else
          {
            PlayListItem playlistItem = new PlayListItem();

            playlistItem.Type = PlayListItem.PlayListItemType.Audio;
            playlistItem.FileName = filename;
            playlistPlayer.GetPlaylist(PlayListType.PLAYLIST_MUSIC_TEMP).Add(playlistItem);
          }
          playlistPlayer.Play(0);

          _isBackgroundMusicPlaying = true;
        }
        catch (Exception e)
        {
          Log.Info("GUISlideShow.StartBackgroundMusic", e.Message);
        }

        break;
      }
    }
开发者ID:npcomplete111,项目名称:MediaPortal-1,代码行数:74,代码来源:GUISlideShow.cs

示例9: LoadSettings

    private void LoadSettings()
    {
      String firstSite = "";
      m_sites.Clear();
      using (Profile.Settings xmlreader = new Profile.MPSettings())
      {
        for (int i = 0; i < NUM_STORIES; i++)
        {
          string strNameTag = String.Format("siteName{0}", i);
          string strURLTag = String.Format("siteURL{0}", i);
          string strEncodingTag = String.Format("siteEncoding{0}", i);
          string strImageTag = String.Format("siteImage{0}", i);
          string strDescriptionTag = String.Format("siteDescription{0}", i);

          string strName = xmlreader.GetValueAsString("rss", strNameTag, "");
          string strURL = xmlreader.GetValueAsString("rss", strURLTag, "");
          string strEncoding = xmlreader.GetValueAsString("rss", strEncodingTag, "windows-1252");
          string strImage = xmlreader.GetValueAsString("rss", strImageTag, "");
          string strDescription = xmlreader.GetValueAsString("rss", strDescriptionTag, "");

          if (strName.Length > 0 && strURL.Length > 0)
          {
            if (strImage.Length == 0)
            {
              strImage = DEFAULT_NEWS_ICON;
            }

            if (firstSite == "")
            {
              m_strSiteName = strName;
              m_strSiteURL = strURL;
              m_strSiteIcon = strImage;
              m_strDescription = String.IsNullOrEmpty(m_strDescription) ? strName : strDescription;
              m_strSiteEncoding = strEncoding;
              firstSite = strURL;
            }

            Site loc = new Site();
            loc.m_Name = strName;
            loc.m_URL = strURL;
            loc.m_Image = strImage;
            loc.m_Description = strDescription;
            loc.m_Encoding = strEncoding;
            m_sites.Add(loc);
          }
        }

        // General settings
        m_iRSSRefresh = xmlreader.GetValueAsInt("rss", "iRefreshTime", 15);
        m_bRSSAutoRefresh = false;
        if (xmlreader.GetValueAsInt("rss", "bAutoRefresh", 0) != 0)
        {
          m_bRSSAutoRefresh = true;
        }
      }
    }
开发者ID:hkjensen,项目名称:MediaPortal-1,代码行数:56,代码来源:GUIRSSFeed.cs

示例10: LoadSettings

    private void LoadSettings()
    {
      using (Profile.Settings xmlreader = new Profile.MPSettings())
      {
        _noLargeThumbnails = xmlreader.GetValueAsBool("thumbnails", "picturenolargethumbondemand", true);

        lcFolders.Clear();
        _scanShare = 0;
        SettingsSharesHelper settingsSharesHelper = new SettingsSharesHelper();
        // Load share settings
        settingsSharesHelper.LoadSettings("pictures");

        foreach (GUIListItem item in settingsSharesHelper.ShareListControl)
        {
          string driveLetter = FolderInfo(item).Folder.Substring(0, 3).ToUpperInvariant();

          if (driveLetter.StartsWith("\\\\") || Util.Utils.getDriveType(driveLetter) == 3 ||
              Util.Utils.getDriveType(driveLetter) == 4)
          {
            item.IsPlayed = false;

            if (FolderInfo(item).ScanShare)
            {
              item.IsPlayed = true;
              item.Label2 = GUILocalizeStrings.Get(193); // Scan
              _scanShare++;
            }
            item.OnItemSelected += OnItemSelected;
            item.Label = FolderInfo(item).Folder;

            item.Path = FolderInfo(item).Folder;
            lcFolders.Add(item);
          }
        }
        _defaultShare = xmlreader.GetValueAsString("pictures", "default", "");
        _rememberLastFolder = xmlreader.GetValueAsBool("pictures", "rememberlastfolder", false);
        _addOpticalDiskDrives = xmlreader.GetValueAsBool("pictures", "AddOpticalDiskDrives", true);
        _autoSwitchRemovableDrives = xmlreader.GetValueAsBool("pictures", "SwitchRemovableDrives", true);
      }
    }
开发者ID:arangas,项目名称:MediaPortal-1,代码行数:40,代码来源:GUISettingsPictures_Database.cs

示例11: 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;
          }
        }
      }
    }
开发者ID:npcomplete111,项目名称:MediaPortal-1,代码行数:89,代码来源:GUIWindowWeather.cs

示例12: SavePlayList

    private void SavePlayList()
    {
      string strNewFileName = playlistPlayer.CurrentPlaylistName;
      if (GetKeyboard(ref strNewFileName))
      {
        string strPath = Path.GetFileNameWithoutExtension(strNewFileName);
        string strPlayListPath = string.Empty;
        using (Profile.Settings xmlreader = new Profile.MPSettings())
        {
          strPlayListPath = xmlreader.GetValueAsString("music", "playlists", string.Empty);
          strPlayListPath = Util.Utils.RemoveTrailingSlash(strPlayListPath);
        }

        strPath += ".m3u";
        if (strPlayListPath.Length != 0)
        {
          strPath = strPlayListPath + @"\" + strPath;
        }
        PlayList playlist = new PlayList();
        for (int i = 0; i < facadeLayout.Count; ++i)
        {
          GUIListItem pItem = facadeLayout[i];
          PlayListItem newItem = new PlayListItem();
          newItem.FileName = pItem.Path;
          newItem.Description = pItem.Label;
          newItem.Duration = pItem.Duration;
          newItem.Type = PlayListItem.PlayListItemType.Audio;
          playlist.Add(newItem);
        }
        IPlayListIO saver = new PlayListM3uIO();
        saver.Save(playlist, strPath);
      }
    }
开发者ID:akhilgt,项目名称:MediaPortal-1,代码行数:33,代码来源:GUIMusicPlaylist.cs

示例13: LoadSettings

    /// <summary>
    /// Load Settings
    /// </summary>
    private void LoadSettings()
    {
      using (Profile.Settings xmlreader = new Profile.MPSettings())
      {
        _SoundDevice = xmlreader.GetValueAsString("audioplayer", "sounddevice", "Default Sound Device");
        int vizType = xmlreader.GetValueAsInt("musicvisualization", "vizType", (int)VisualizationInfo.PluginType.None);
        string vizName = xmlreader.GetValueAsString("musicvisualization", "name", "");
        string vizPath = xmlreader.GetValueAsString("musicvisualization", "path", "");
        string vizClsid = xmlreader.GetValueAsString("musicvisualization", "clsid", "");
        int vizPreset = xmlreader.GetValueAsInt("musicvisualization", "preset", 0);

        VizPluginInfo = new VisualizationInfo((VisualizationInfo.PluginType)vizType, vizPath, vizName, vizClsid,
                                              vizPreset);

        VizFPS = xmlreader.GetValueAsInt("musicvisualization", "fps", 30);
        _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;
        }

        _DefaultCrossFadeIntervalMS = _CrossFadeIntervalMS;

        _SoftStop = xmlreader.GetValueAsBool("audioplayer", "fadeOnStartStop", true);

        _Mixing = xmlreader.GetValueAsBool("audioplayer", "mixing", false);

        _useASIO = xmlreader.GetValueAsBool("audioplayer", "asio", false);
        _asioDevice = xmlreader.GetValueAsString("audioplayer", "asiodevice", "None");
        _asioBalance = (float)xmlreader.GetValueAsInt("audioplayer", "asiobalance", 0) / 100.00f;

        bool doGaplessPlayback = xmlreader.GetValueAsBool("audioplayer", "gaplessPlayback", false);

        if (doGaplessPlayback)
        {
          _CrossFadeIntervalMS = 200;
          _playBackType = (int)PlayBackType.GAPLESS;
        }
        else
        {
          if (_CrossFadeIntervalMS == 0)
          {
            _playBackType = (int)PlayBackType.NORMAL;
            _CrossFadeIntervalMS = 100;
          }
          else
          {
            _playBackType = (int)PlayBackType.CROSSFADE;
          }
        }
      }
    }
开发者ID:ncoH,项目名称:MediaPortal-1,代码行数:74,代码来源:BassAudio.cs

示例14: LoadSettings

    /// <summary>
    /// Load Settings
    /// </summary>
    private void LoadSettings()
    {
      using (Profile.Settings xmlreader = new Profile.MPSettings())
      {
        int vizType = xmlreader.GetValueAsInt("musicvisualization", "vizType", (int)VisualizationInfo.PluginType.None);
        string vizName = xmlreader.GetValueAsString("musicvisualization", "name", "");
        string vizPath = xmlreader.GetValueAsString("musicvisualization", "path", "");
        string vizClsid = xmlreader.GetValueAsString("musicvisualization", "clsid", "");
        int vizPreset = xmlreader.GetValueAsInt("musicvisualization", "preset", 0);

        VizPluginInfo = new VisualizationInfo((VisualizationInfo.PluginType)vizType, vizPath, vizName, vizClsid,
                                              vizPreset);

        if (vizType == (int)VisualizationInfo.PluginType.Sonique)
        {
          VizPluginInfo.UseOpenGL = xmlreader.GetValueAsBool("musicvisualization", "useOpenGL", true);
          VizPluginInfo.RenderTiming = xmlreader.GetValueAsInt("musicvisualization", "renderTiming", 25);
          VizPluginInfo.ViewPortSize = xmlreader.GetValueAsInt("musicvisualization", "viewPort", 0);
        }

        VizFPS = xmlreader.GetValueAsInt("musicvisualization", "fps", 30);
      }
    }
开发者ID:edalex86,项目名称:MediaPortal-1,代码行数:26,代码来源:BassAudioEngine.cs

示例15: LoadSettings

    public void LoadSettings(string section)
    {
      Clear();
      using (Profile.Settings xmlreader = new Profile.MPSettings())
      {
        string strDefault = xmlreader.GetValueAsString(section, "default", string.Empty);
        for (int i = 0; i < MaximumShares; 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);
          string sharewakeonlan = String.Format("sharewakeonlan{0}", i);
          string sharedonotfolderjpgifpin = String.Format("sharedonotfolderjpgifpin{0}", i);
          Share share = new Share();
          share.Name = xmlreader.GetValueAsString(section, strShareName, string.Empty);
          share.Path = xmlreader.GetValueAsString(section, strSharePath, string.Empty);
          share.Pincode = Utils.DecryptPassword(xmlreader.GetValueAsString(section, strPincode, string.Empty));
          share.IsFtpShare = xmlreader.GetValueAsBool(section, shareType, false);
          share.FtpServer = xmlreader.GetValueAsString(section, shareServer, string.Empty);
          share.FtpLoginName = xmlreader.GetValueAsString(section, shareLogin, string.Empty);
          share.FtpPassword = Utils.DecryptPassword(xmlreader.GetValueAsString(section, sharePwd, string.Empty));
          share.FtpPort = xmlreader.GetValueAsInt(section, sharePort, 21);
          share.FtpFolder = xmlreader.GetValueAsString(section, remoteFolder, "/");
          share.DefaultLayout = (Layout)xmlreader.GetValueAsInt(section, shareViewPath, (int)Layout.List);
          share.ShareWakeOnLan = xmlreader.GetValueAsBool(section, sharewakeonlan, false);
          share.DonotFolderJpgIfPin = xmlreader.GetValueAsBool(section, sharedonotfolderjpgifpin, true);

          if (share.Name.Length > 0)
          {
            if (strDefault == share.Name)
            {
              share.Default = true;
              if (defaultshare == null)
              {
                defaultshare = share;
              }
            }
            Add(share);
          }
          else break;
        }

        List<string> usbHdd = Utils.GetAvailableUsbHardDisks();

        if (usbHdd.Count > 0)
        {
          foreach (string drive in usbHdd)
          {
            bool driveFound = false;
            string driveName = Utils.GetDriveName(drive);

            if (driveName.Length == 0)
            {
              driveName = String.Format("({0}:) Removable", drive.Substring(0, 1).ToUpper());
            }
            else
            {
              driveName = String.Format("({0}:) {1}", drive.Substring(0, 1).ToUpper(), driveName);
            }

            foreach (var share in m_shares)
            {
              if (share.Path.StartsWith(drive))
              {
                driveFound = true;
                break;
              }
            }

            if (driveFound == false)
            {
              Share removableShare = new Share(driveName, drive);
              removableShare.RuntimeAdded = true;
              Add(removableShare);
            }
          }
        }
      }
    }
开发者ID:cmendozac,项目名称:MediaPortal-1,代码行数:87,代码来源:VirtualDirectory.cs


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