示例#1
0
 /// <summary>
 /// Loads the configuration of this section
 /// </summary>
 public void LoadConfiguration()
 {
     using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")))
     {
         VideoOutputDriver videoOutputDriverStandardValue = VideoOutputDriver.DirectX;
         if (OSInfo.OSInfo.OSList.WindowsVista == OSInfo.OSInfo.GetOSName() || OSInfo.OSInfo.OSList.Windows2008 == OSInfo.OSInfo.GetOSName() || OSInfo.OSInfo.OSList.Windows7 == OSInfo.OSInfo.GetOSName())
         {
             videoOutputDriverStandardValue = VideoOutputDriver.Direct3D;
         }
         videoOutputDriver.SelectedIndex = xmlreader.GetValueAsInt("mplayer", "videoOutputDriver", (int)videoOutputDriverStandardValue);
         postProcessing.SelectedIndex    = xmlreader.GetValueAsInt("mplayer", "postProcessing", (int)PostProcessing.Maximum);
         aspectRatio.SelectedIndex       = xmlreader.GetValueAsInt("mplayer", "aspectRatio", (int)AspectRatio.Automatic);
         deinterlace.SelectedIndex       = xmlreader.GetValueAsInt("mplayer", "deinterlace", (int)Deinterlace.Adaptive);
         noiseDenoise.SelectedIndex      = xmlreader.GetValueAsInt("mplayer", "noise", (int)NoiseDenoise.Nothing);
         framedrop.Checked       = xmlreader.GetValueAsBool("mplayer", "framedrop", false);
         directRendering.Checked = xmlreader.GetValueAsBool("mplayer", "directRendering", true);
         doubleBuffering.Checked = xmlreader.GetValueAsBool("mplayer", "doubleBuffering", true);
     }
 }
        /// <summary>
        /// Reads the whole configuration
        /// </summary>
        private void ReadConfig()
        {
            try
              {
            ExtensionSettings mplayerSetting = new ExtensionSettings(".mplayer", PlayMode.Unrecognized, "", true);
            _extensionSettings = new Dictionary<string, ExtensionSettings>();
            _extensionSettings.Add(mplayerSetting.Name, mplayerSetting);
            _extensionSettingsExtPlayer = new Dictionary<string, ExtensionSettings>();
            _extensionSettingsExtPlayer.Add(mplayerSetting.Name, mplayerSetting);
            ExtensionSettings settings;
            using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")))
            {
              _osdMode = (OSDMode)xmlreader.GetValueAsInt("mplayer", "osd", (int)OSDMode.InternalMPlayer);
              _rebuildIndex = xmlreader.GetValueAsBool("mplayer", "rebuildIndex", false);
              _priorityBoost = xmlreader.GetValueAsBool("mplayer", "priorityBoost", true);
              _framedrop = xmlreader.GetValueAsBool("mplayer", "framedrop", false);
              _doubleBuffering = xmlreader.GetValueAsBool("mplayer", "doubleBuffering", true);
              _directRendering = xmlreader.GetValueAsBool("mplayer", "directRendering", true);
              _audioNormalize = xmlreader.GetValueAsBool("mplayer", "audioNormalize", false);
              _passthroughAC3_DTS = xmlreader.GetValueAsBool("mplayer", "passthroughAC3DTS", false);
              _soundOutputDriver = (SoundOutputDriver)xmlreader.GetValueAsInt("mplayer", "soundOutputDriver", (int)SoundOutputDriver.DirectSound);
              _soundOutputDevice = xmlreader.GetValueAsInt("mplayer", "soundOutputDevice", 0);
              _deinterlace = (Deinterlace)xmlreader.GetValueAsInt("mplayer", "deinterlace", (int)Deinterlace.Adaptive);
              _aspectRatio = (AspectRatio)xmlreader.GetValueAsInt("mplayer", "aspectRatio", (int)AspectRatio.Automatic);
              _postProcessing = (PostProcessing)xmlreader.GetValueAsInt("mplayer", "postProcessing", (int)PostProcessing.Maximum);
              _audioChannels = (AudioChannels)xmlreader.GetValueAsInt("mplayer", "audioChannels", (int)AudioChannels.Default);
              _noiseDenoise = (NoiseDenoise)xmlreader.GetValueAsInt("mplayer", "noise", (int)NoiseDenoise.Nothing);
              _cacheSize = xmlreader.GetValueAsInt("mplayer", "cacheSize", 0);
              _audioDelayStep = xmlreader.GetValueAsInt("mplayer", "audioDelayStep", 100);
              _subtitleDelayStep = xmlreader.GetValueAsInt("mplayer", "subtitleDelayStep", 100);
              _subtitlePosition = xmlreader.GetValueAsInt("mplayer", "subtitlePosition", 100);
              _subtitleSize = xmlreader.GetValueAsInt("mplayer", "subtitleSize", 5);
              string subtitleFontName = xmlreader.GetValueAsString("mplayer", "subtitleFontName", "Arial");
              _subtitleFontSet = CheckSubtitleFont(subtitleFontName, out _subtitleFontFileName);
              _mplayerPath = xmlreader.GetValueAsString("mplayer", "mplayerPath", "C:\\Program Files\\MPlayer\\");
              xmlreader.GetValueAsString("mplayer", "mplayerPath", "C:\\Program Files\\MPlayer\\Mplayer.exe");
              string arguments = xmlreader.GetValueAsString("mplayer", "generalArguments", "");
              settings = new ExtensionSettings("general", PlayMode.Unrecognized, arguments, false);
              _extensionSettings.Add(settings.Name, settings);
              arguments = xmlreader.GetValueAsString("mplayer", "dvdArguments", String.Empty);
              settings = new ExtensionSettings("dvd://", PlayMode.Video, arguments, false);
              _extensionSettings.Add(settings.Name, settings);
              arguments = xmlreader.GetValueAsString("mplayer", "vcdArguments", String.Empty);
              settings = new ExtensionSettings("vcd://", PlayMode.Video, arguments, false);
              _extensionSettings.Add(settings.Name, settings);
              arguments = xmlreader.GetValueAsString("mplayer", "svcdArguments", String.Empty);
              settings = new ExtensionSettings("svcd://", PlayMode.Video, arguments, false);
              _extensionSettings.Add(settings.Name, settings);
              arguments = xmlreader.GetValueAsString("mplayer", "cueArguments", String.Empty);
              settings = new ExtensionSettings("cue://", PlayMode.Unrecognized, arguments, false);
              _extensionSettings.Add(settings.Name, settings);
              arguments = xmlreader.GetValueAsString("mplayer", "ftpArguments", String.Empty);
              settings = new ExtensionSettings("ftp://", PlayMode.Unrecognized, arguments, false);
              _extensionSettings.Add(settings.Name, settings);
              arguments = xmlreader.GetValueAsString("mplayer", "httpArguments", String.Empty);
              settings = new ExtensionSettings("http://", PlayMode.Unrecognized, arguments, false);
              _extensionSettings.Add(settings.Name, settings);
              settings = new ExtensionSettings("http_proxy://", PlayMode.Unrecognized, arguments, false);
              _extensionSettings.Add(settings.Name, settings);
              arguments = xmlreader.GetValueAsString("mplayer", "mmsArguments", String.Empty);
              settings = new ExtensionSettings("mms://", PlayMode.Unrecognized, arguments, false);
              _extensionSettings.Add(settings.Name, settings);
              settings = new ExtensionSettings("mmst://", PlayMode.Unrecognized, arguments, false);
              _extensionSettings.Add(settings.Name, settings);
              arguments = xmlreader.GetValueAsString("mplayer", "mpstArguments", String.Empty);
              settings = new ExtensionSettings("mpst://", PlayMode.Unrecognized, arguments, false);
              _extensionSettings.Add(settings.Name, settings);
              arguments = xmlreader.GetValueAsString("mplayer", "rtspArguments", String.Empty);
              settings = new ExtensionSettings("rtsp://", PlayMode.Unrecognized, arguments, false);
              _extensionSettings.Add(settings.Name, settings);
              settings = new ExtensionSettings("rtp://", PlayMode.Unrecognized, arguments, false);
              _extensionSettings.Add(settings.Name, settings);
              arguments = xmlreader.GetValueAsString("mplayer", "sdpArguments", String.Empty);
              settings = new ExtensionSettings("sdp://", PlayMode.Unrecognized, arguments, false);
              _extensionSettings.Add(settings.Name, settings);
              arguments = xmlreader.GetValueAsString("mplayer", "udpArguments", String.Empty);
              settings = new ExtensionSettings("udp://", PlayMode.Unrecognized, arguments, false);
              _extensionSettings.Add(settings.Name, settings);
              arguments = xmlreader.GetValueAsString("mplayer", "unsvArguments", String.Empty);
              settings = new ExtensionSettings("unsv://", PlayMode.Unrecognized, arguments, false);
              _extensionSettings.Add(settings.Name, settings);
              _enableSubtitles = xmlreader.GetValueAsBool("mplayer", "enableSubtitles", false);
              _videoOutputDriver = (VideoOutputDriver)xmlreader.GetValueAsInt("mplayer", "videoOutputDriver", (int)VideoOutputDriver.DirectX);
              string timeout = (xmlreader.GetValueAsString("movieplayer", "skipsteptimeout", "1500"));

              if (timeout == string.Empty)
            _seekStepTimeout = 1500;
              else
            _seekStepTimeout = Convert.ToInt16(timeout);

              String m_strLanguage = xmlreader.GetValueAsString("skin", "language", "English");
              LocalizeStrings.Load(m_strLanguage);
            }
            LoadXMLData();
              }
              catch (Exception e)
              {
            Log.Error(e);
              }
              _supportedExtensions = new String[_extensionSettingsExtPlayer.Count];
              _extensionSettingsExtPlayer.Keys.CopyTo(_supportedExtensions, 0);
        }
示例#3
0
        /// <summary>
        /// Reads the whole configuration
        /// </summary>
        private void ReadConfig()
        {
            try
            {
                ExtensionSettings mplayerSetting = new ExtensionSettings(".mplayer", PlayMode.Unrecognized, "", true);
                _extensionSettings = new Dictionary <string, ExtensionSettings>();
                _extensionSettings.Add(mplayerSetting.Name, mplayerSetting);
                _extensionSettingsExtPlayer = new Dictionary <string, ExtensionSettings>();
                _extensionSettingsExtPlayer.Add(mplayerSetting.Name, mplayerSetting);
                ExtensionSettings settings;
                using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")))
                {
                    _osdMode            = (OSDMode)xmlreader.GetValueAsInt("mplayer", "osd", (int)OSDMode.InternalMPlayer);
                    _rebuildIndex       = xmlreader.GetValueAsBool("mplayer", "rebuildIndex", false);
                    _priorityBoost      = xmlreader.GetValueAsBool("mplayer", "priorityBoost", true);
                    _framedrop          = xmlreader.GetValueAsBool("mplayer", "framedrop", false);
                    _doubleBuffering    = xmlreader.GetValueAsBool("mplayer", "doubleBuffering", true);
                    _directRendering    = xmlreader.GetValueAsBool("mplayer", "directRendering", true);
                    _audioNormalize     = xmlreader.GetValueAsBool("mplayer", "audioNormalize", false);
                    _passthroughAC3_DTS = xmlreader.GetValueAsBool("mplayer", "passthroughAC3DTS", false);
                    _soundOutputDriver  = (SoundOutputDriver)xmlreader.GetValueAsInt("mplayer", "soundOutputDriver", (int)SoundOutputDriver.DirectSound);
                    _soundOutputDevice  = xmlreader.GetValueAsInt("mplayer", "soundOutputDevice", 0);
                    _deinterlace        = (Deinterlace)xmlreader.GetValueAsInt("mplayer", "deinterlace", (int)Deinterlace.Adaptive);
                    _aspectRatio        = (AspectRatio)xmlreader.GetValueAsInt("mplayer", "aspectRatio", (int)AspectRatio.Automatic);
                    _postProcessing     = (PostProcessing)xmlreader.GetValueAsInt("mplayer", "postProcessing", (int)PostProcessing.Maximum);
                    _audioChannels      = (AudioChannels)xmlreader.GetValueAsInt("mplayer", "audioChannels", (int)AudioChannels.Default);
                    _noiseDenoise       = (NoiseDenoise)xmlreader.GetValueAsInt("mplayer", "noise", (int)NoiseDenoise.Nothing);
                    _cacheSize          = xmlreader.GetValueAsInt("mplayer", "cacheSize", 0);
                    _audioDelayStep     = xmlreader.GetValueAsInt("mplayer", "audioDelayStep", 100);
                    _subtitleDelayStep  = xmlreader.GetValueAsInt("mplayer", "subtitleDelayStep", 100);
                    _subtitlePosition   = xmlreader.GetValueAsInt("mplayer", "subtitlePosition", 100);
                    _subtitleSize       = xmlreader.GetValueAsInt("mplayer", "subtitleSize", 5);
                    string subtitleFontName = xmlreader.GetValueAsString("mplayer", "subtitleFontName", "Arial");
                    _subtitleFontSet = CheckSubtitleFont(subtitleFontName, out _subtitleFontFileName);
                    _mplayerPath     = xmlreader.GetValueAsString("mplayer", "mplayerPath", "C:\\Program Files\\MPlayer\\");
                    xmlreader.GetValueAsString("mplayer", "mplayerPath", "C:\\Program Files\\MPlayer\\Mplayer.exe");
                    string arguments = xmlreader.GetValueAsString("mplayer", "generalArguments", "");
                    settings = new ExtensionSettings("general", PlayMode.Unrecognized, arguments, false);
                    _extensionSettings.Add(settings.Name, settings);
                    arguments = xmlreader.GetValueAsString("mplayer", "dvdArguments", String.Empty);
                    settings  = new ExtensionSettings("dvd://", PlayMode.Video, arguments, false);
                    _extensionSettings.Add(settings.Name, settings);
                    arguments = xmlreader.GetValueAsString("mplayer", "vcdArguments", String.Empty);
                    settings  = new ExtensionSettings("vcd://", PlayMode.Video, arguments, false);
                    _extensionSettings.Add(settings.Name, settings);
                    arguments = xmlreader.GetValueAsString("mplayer", "svcdArguments", String.Empty);
                    settings  = new ExtensionSettings("svcd://", PlayMode.Video, arguments, false);
                    _extensionSettings.Add(settings.Name, settings);
                    arguments = xmlreader.GetValueAsString("mplayer", "cueArguments", String.Empty);
                    settings  = new ExtensionSettings("cue://", PlayMode.Unrecognized, arguments, false);
                    _extensionSettings.Add(settings.Name, settings);
                    arguments = xmlreader.GetValueAsString("mplayer", "ftpArguments", String.Empty);
                    settings  = new ExtensionSettings("ftp://", PlayMode.Unrecognized, arguments, false);
                    _extensionSettings.Add(settings.Name, settings);
                    arguments = xmlreader.GetValueAsString("mplayer", "httpArguments", String.Empty);
                    settings  = new ExtensionSettings("http://", PlayMode.Unrecognized, arguments, false);
                    _extensionSettings.Add(settings.Name, settings);
                    settings = new ExtensionSettings("http_proxy://", PlayMode.Unrecognized, arguments, false);
                    _extensionSettings.Add(settings.Name, settings);
                    arguments = xmlreader.GetValueAsString("mplayer", "mmsArguments", String.Empty);
                    settings  = new ExtensionSettings("mms://", PlayMode.Unrecognized, arguments, false);
                    _extensionSettings.Add(settings.Name, settings);
                    settings = new ExtensionSettings("mmst://", PlayMode.Unrecognized, arguments, false);
                    _extensionSettings.Add(settings.Name, settings);
                    arguments = xmlreader.GetValueAsString("mplayer", "mpstArguments", String.Empty);
                    settings  = new ExtensionSettings("mpst://", PlayMode.Unrecognized, arguments, false);
                    _extensionSettings.Add(settings.Name, settings);
                    arguments = xmlreader.GetValueAsString("mplayer", "rtspArguments", String.Empty);
                    settings  = new ExtensionSettings("rtsp://", PlayMode.Unrecognized, arguments, false);
                    _extensionSettings.Add(settings.Name, settings);
                    settings = new ExtensionSettings("rtp://", PlayMode.Unrecognized, arguments, false);
                    _extensionSettings.Add(settings.Name, settings);
                    arguments = xmlreader.GetValueAsString("mplayer", "sdpArguments", String.Empty);
                    settings  = new ExtensionSettings("sdp://", PlayMode.Unrecognized, arguments, false);
                    _extensionSettings.Add(settings.Name, settings);
                    arguments = xmlreader.GetValueAsString("mplayer", "udpArguments", String.Empty);
                    settings  = new ExtensionSettings("udp://", PlayMode.Unrecognized, arguments, false);
                    _extensionSettings.Add(settings.Name, settings);
                    arguments = xmlreader.GetValueAsString("mplayer", "unsvArguments", String.Empty);
                    settings  = new ExtensionSettings("unsv://", PlayMode.Unrecognized, arguments, false);
                    _extensionSettings.Add(settings.Name, settings);
                    _enableSubtitles   = xmlreader.GetValueAsBool("mplayer", "enableSubtitles", false);
                    _videoOutputDriver = (VideoOutputDriver)xmlreader.GetValueAsInt("mplayer", "videoOutputDriver", (int)VideoOutputDriver.DirectX);
                    string timeout = (xmlreader.GetValueAsString("movieplayer", "skipsteptimeout", "1500"));

                    if (timeout == string.Empty)
                    {
                        _seekStepTimeout = 1500;
                    }
                    else
                    {
                        _seekStepTimeout = Convert.ToInt16(timeout);
                    }

                    String m_strLanguage = xmlreader.GetValueAsString("skin", "language", "English");
                    LocalizeStrings.Load(m_strLanguage);
                }
                LoadXMLData();
            }
            catch (Exception e)
            {
                Log.Error(e);
            }
            _supportedExtensions = new String[_extensionSettingsExtPlayer.Count];
            _extensionSettingsExtPlayer.Keys.CopyTo(_supportedExtensions, 0);
        }