예제 #1
0
        public override int ConfigurationChanged(LibCECConfiguration config)
        {
            Settings.PhysicalAddress.Value = Config.PhysicalAddress;
            Settings.ConnectedDevice.Value = Config.BaseDevice == CecLogicalAddress.AudioSystem ? CecLogicalAddress.AudioSystem : CecLogicalAddress.Tv;
            Settings.HDMIPort.Value        = Config.HDMIPort;
            Settings.WakeDevices.Value     = Config.WakeDevices;
            Settings.PowerOffDevices.Value = Config.PowerOffDevices;
            Settings.ActivateSource.Value  = Config.ActivateSource;
            Settings.DeviceType.Value      = config.DeviceTypes.Types[0];

            if (config.TvVendor != CecVendorId.Unknown)
            {
                Settings.OverrideTVVendor.Value = true;
                Settings.TVVendor.Value         = config.TvVendor;
            }
            else
            {
                Settings.OverrideTVVendor.Value = false;
            }

            _gui.SetControlText(_gui, Resources.app_name + " - libCEC " + Lib.VersionToString(Config.ServerVersion));

            CECActions.UpdatePhysicalAddress();
            return(1);
        }
예제 #2
0
        public override int ConfigurationChanged(LibCECConfiguration config)
        {
            Config.Update(config);
            Settings.PhysicalAddress.Value = config.PhysicalAddress;
            if (config.AutodetectAddress)
            {
                Settings.DetectPhysicalAddress.Value = true;
                Settings.ConnectedDevice.Value       = CecLogicalAddress.Unknown;
                Settings.HDMIPort.Value = 0;
                _gui.SetControlEnabled(Settings.ConnectedDevice.ValueControl, false);
                _gui.SetControlEnabled(Settings.HDMIPort.ValueControl, false);
            }
            else
            {
                Settings.ConnectedDevice.Value       = config.BaseDevice == CecLogicalAddress.AudioSystem ? CecLogicalAddress.AudioSystem : CecLogicalAddress.Tv;
                Settings.HDMIPort.Value              = config.HDMIPort;
                Settings.DetectPhysicalAddress.Value = false;
                _gui.SetControlEnabled(Settings.ConnectedDevice.ValueControl, true);
                _gui.SetControlEnabled(Settings.HDMIPort.ValueControl, true);
            }
            Settings.WakeDevices.Value     = Config.WakeDevices;
            Settings.PowerOffDevices.Value = Config.PowerOffDevices;
            Settings.ActivateSource.Value  = Config.ActivateSource;
            Settings.DeviceType.Value      = config.DeviceTypes.Types[0];
            Settings.TVAutoPowerOn.Value   = (config.AutoPowerOn == BoolSetting.Enabled);

            if (config.TvVendor != CecVendorId.Unknown)
            {
                Settings.OverrideTVVendor.Value = true;
                Settings.TVVendor.Value         = config.TvVendor;
            }
            else
            {
                Settings.OverrideTVVendor.Value = false;
            }

            _gui.SetControlText(_gui, Resources.app_name + " - libCEC " + Lib.VersionToString(Config.ServerVersion));

            if (Config.AdapterType == CecAdapterType.PulseEightExternal || Config.AdapterType == CecAdapterType.PulseEightDaughterboard)
            {
                var versionAvailable = int.Parse(Resources.cec_firmware_version);
                _gui.SetControlVisible(_gui.pbFirmwareUpgrade, true);
                _gui.SetControlVisible(_gui.lFirmware, true);
                _gui.SetControlVisible(_gui.lFirmwareVersion, true);
                _gui.SetControlVisible(_gui.bFirmwareUpgrade, (File.Exists(FirmwareUpgradeExe)));
                _gui.SetControlText(_gui.lFirmwareVersion, "v" + Config.FirmwareVersion + " " + Config.FirmwareBuildDate);
                _gui.SetControlEnabled(_gui.bFirmwareUpgrade, ((Config.FirmwareVersion < versionAvailable) || (Config.FirmwareVersion > 100)));
            }
            else
            {
                _gui.SetControlVisible(_gui.pbFirmwareUpgrade, false);
                _gui.SetControlVisible(_gui.lFirmware, false);
                _gui.SetControlVisible(_gui.lFirmwareVersion, false);
                _gui.SetControlVisible(_gui.bFirmwareUpgrade, false);
            }
            _gui.SetControlVisible(Settings.TVAutoPowerOn.ValueControl, (Config.FirmwareVersion >= 9));

            CECActions.UpdatePhysicalAddress();
            return(1);
        }