Ejemplo n.º 1
0
        public BDPlayerBuilder()
        {
            BDPlayerSettings settings = ServiceRegistration.Get <ISettingsManager>().Load <BDPlayerSettings>();

            if (settings.BDSourceFilter == null)
            {
                // Try to init settings with the first available source filter
                CodecInfo sourceFilter = BDSourceFilterConfig.SupportedSourceFilters.FirstOrDefault(codecInfo => FilterGraphTools.IsThisComObjectInstalled(new Guid(codecInfo.CLSID)));
                if (sourceFilter != null)
                {
                    settings.BDSourceFilter = sourceFilter;
                    ServiceRegistration.Get <ISettingsManager>().Save(settings);
                }
            }

            Enabled = settings.BDSourceFilter != null;

            if (Enabled)
            {
                LogInfo("Detected BluRay Source Filter '{0}' on the system.", settings.BDSourceFilter.Name);
            }
            else
            {
                LogWarn("No BluRay Source Filter was detected on the system.");
            }
        }
        public override void Save()
        {
            // Save settings via the SettingsManager
            BDPlayerSettings settings = SettingsManager.Load <BDPlayerSettings>();

            settings.BDSourceFilter = _codecList[Selected];
            SettingsManager.Save(settings);
        }
        public override void Load()
        {
            // Load settings from the SettingsManager
            BDPlayerSettings settings = SettingsManager.Load <BDPlayerSettings>();

            if (settings != null && settings.BDSourceFilter != null)
            {
                _currentSelection = settings.BDSourceFilter.GetCLSID();
            }
            base.Load();
        }