# HG changeset patch # User StephaneLenclud # Date 1469385994 -7200 # Node ID 5de8f8eaaa548c54825ed88a8c1e9108d88b459b # Parent 4961ede27e0aa00805a0d53749b9ec5a4b980893 Removing obsolete CEC options. diff -r 4961ede27e0a -r 5de8f8eaaa54 Server/App.config --- a/Server/App.config Sun Jul 24 20:36:07 2016 +0200 +++ b/Server/App.config Sun Jul 24 20:46:34 2016 +0200 @@ -37,18 +37,9 @@ 1 - - True - - - True - True - - False - diff -r 4961ede27e0a -r 5de8f8eaaa54 Server/ConsumerElectronicControl.cs --- a/Server/ConsumerElectronicControl.cs Sun Jul 24 20:36:07 2016 +0200 +++ b/Server/ConsumerElectronicControl.cs Sun Jul 24 20:46:34 2016 +0200 @@ -20,7 +20,6 @@ ///TODO: have a more solid implementation public bool MonitorPowerOn; - private bool iReconnectToPowerTv = false; public void TestSendKeys() { @@ -33,28 +32,16 @@ /// /// /// - public void Start(IntPtr aWndHandle, string aDeviceName, byte aHdmiPort, bool aMonitorOn, bool aMonitorOff, bool aReconnectToPowerTv) + public void Start(IntPtr aWndHandle, string aDeviceName, byte aHdmiPort) { //Assuming monitor is on when we start up MonitorPowerOn = true; - iReconnectToPowerTv = aReconnectToPowerTv; - //Create our power setting notifier and register the event we are interested in iPowerSettingNotifier = new PowerManager.SettingNotifier(aWndHandle); - - // - if (aMonitorOn) - { - iPowerSettingNotifier.OnMonitorPowerOn += OnMonitorPowerOn; - } - - // - if (aMonitorOff) - { - iPowerSettingNotifier.OnMonitorPowerOff += OnMonitorPowerOff; - } - + iPowerSettingNotifier.OnMonitorPowerOn += OnMonitorPowerOn; + iPowerSettingNotifier.OnMonitorPowerOff += OnMonitorPowerOff; + //CEC Client = new Cec.Client(aDeviceName,aHdmiPort, CecDeviceType.PlaybackDevice); ConnectCecClient(); @@ -93,41 +80,16 @@ private void OnMonitorPowerOn() { - ManagerEventAction.Current.GetEvent().Trigger(); - - Console.WriteLine("OnMonitorPowerOn"); - - if (iReconnectToPowerTv) - { - ConnectCecClient(); - } - - //Turn on the TV - //iCecClient.Lib.PowerOnDevices(CecLogicalAddress.Tv); - //iCecClient.Lib.SendKeypress(CecLogicalAddress.Tv,CecUserControlCode.PowerOnFunction,true); - //Set ourselves as the active source - Client.Lib.SetActiveSource(CecDeviceType.PlaybackDevice); MonitorPowerOn = true; + //Trigger corresponding event thus executing associated actions + ManagerEventAction.Current.GetEvent().Trigger(); } private void OnMonitorPowerOff() { + MonitorPowerOn = false; + //Trigger corresponding event thus executing associated actions ManagerEventAction.Current.GetEvent().Trigger(); - - Console.WriteLine("OnMonitorPowerOff"); - - if (iReconnectToPowerTv) - { - ConnectCecClient(); - } - - //Try turning off the TV - Client.Lib.StandbyDevices(CecLogicalAddress.Tv); - //iCecClient.Lib.SendKeypress(CecLogicalAddress.Tv, CecUserControlCode.PowerOffFunction, true); - //Tell everyone that we are no longer active - //iCecClient.Lib.SetInactiveView(); - - MonitorPowerOn = false; } /// diff -r 4961ede27e0a -r 5de8f8eaaa54 Server/MainForm.Designer.cs --- a/Server/MainForm.Designer.cs Sun Jul 24 20:36:07 2016 +0200 +++ b/Server/MainForm.Designer.cs Sun Jul 24 20:46:34 2016 +0200 @@ -106,9 +106,6 @@ this.checkBoxCecLogNotice = new System.Windows.Forms.CheckBox(); this.checkBoxCecLogError = new System.Windows.Forms.CheckBox(); this.checkBoxCecLogWarning = new System.Windows.Forms.CheckBox(); - this.checkBoxCecReconnectToPowerTv = new System.Windows.Forms.CheckBox(); - this.checkBoxCecMonitorOn = new System.Windows.Forms.CheckBox(); - this.checkBoxCecMonitorOff = new System.Windows.Forms.CheckBox(); this.checkBoxCecEnabled = new System.Windows.Forms.CheckBox(); this.labelHdmiPort = new System.Windows.Forms.Label(); this.comboBoxHdmiPort = new System.Windows.Forms.ComboBox(); @@ -829,9 +826,6 @@ // tabPageCec // this.tabPageCec.Controls.Add(this.groupBoxCecLogOptions); - this.tabPageCec.Controls.Add(this.checkBoxCecReconnectToPowerTv); - this.tabPageCec.Controls.Add(this.checkBoxCecMonitorOn); - this.tabPageCec.Controls.Add(this.checkBoxCecMonitorOff); this.tabPageCec.Controls.Add(this.checkBoxCecEnabled); this.tabPageCec.Controls.Add(this.labelHdmiPort); this.tabPageCec.Controls.Add(this.comboBoxHdmiPort); @@ -933,39 +927,6 @@ this.checkBoxCecLogWarning.UseVisualStyleBackColor = true; this.checkBoxCecLogWarning.CheckedChanged += new System.EventHandler(this.checkBoxCecLogs_CheckedChanged); // - // checkBoxCecReconnectToPowerTv - // - this.checkBoxCecReconnectToPowerTv.AutoSize = true; - this.checkBoxCecReconnectToPowerTv.Location = new System.Drawing.Point(6, 115); - this.checkBoxCecReconnectToPowerTv.Name = "checkBoxCecReconnectToPowerTv"; - this.checkBoxCecReconnectToPowerTv.Size = new System.Drawing.Size(194, 17); - this.checkBoxCecReconnectToPowerTv.TabIndex = 24; - this.checkBoxCecReconnectToPowerTv.Text = "Reconnect before TV power switch"; - this.checkBoxCecReconnectToPowerTv.UseVisualStyleBackColor = true; - this.checkBoxCecReconnectToPowerTv.CheckedChanged += new System.EventHandler(this.checkBoxCecReconnectToPowerTv_CheckedChanged); - // - // checkBoxCecMonitorOn - // - this.checkBoxCecMonitorOn.AutoSize = true; - this.checkBoxCecMonitorOn.Location = new System.Drawing.Point(6, 92); - this.checkBoxCecMonitorOn.Name = "checkBoxCecMonitorOn"; - this.checkBoxCecMonitorOn.Size = new System.Drawing.Size(192, 17); - this.checkBoxCecMonitorOn.TabIndex = 23; - this.checkBoxCecMonitorOn.Text = "Wake up TV when screen turns on"; - this.checkBoxCecMonitorOn.UseVisualStyleBackColor = true; - this.checkBoxCecMonitorOn.CheckedChanged += new System.EventHandler(this.checkBoxCecMonitorOn_CheckedChanged); - // - // checkBoxCecMonitorOff - // - this.checkBoxCecMonitorOff.AutoSize = true; - this.checkBoxCecMonitorOff.Location = new System.Drawing.Point(6, 69); - this.checkBoxCecMonitorOff.Name = "checkBoxCecMonitorOff"; - this.checkBoxCecMonitorOff.Size = new System.Drawing.Size(219, 17); - this.checkBoxCecMonitorOff.TabIndex = 22; - this.checkBoxCecMonitorOff.Text = "Set TV on standby when screen turns off"; - this.checkBoxCecMonitorOff.UseVisualStyleBackColor = true; - this.checkBoxCecMonitorOff.CheckedChanged += new System.EventHandler(this.checkBoxCecMonitorOff_CheckedChanged); - // // checkBoxCecEnabled // this.checkBoxCecEnabled.AutoSize = true; @@ -1293,13 +1254,10 @@ private System.Windows.Forms.CheckBox checkBoxCecEnabled; private System.Windows.Forms.Label labelHdmiPort; private System.Windows.Forms.ComboBox comboBoxHdmiPort; - private System.Windows.Forms.CheckBox checkBoxCecMonitorOn; - private System.Windows.Forms.CheckBox checkBoxCecMonitorOff; private System.Windows.Forms.Button iButtonStartIdleClient; private System.Windows.Forms.CheckBox iCheckBoxStartIdleClient; private System.Windows.Forms.TabPage tabPageLogs; private System.Windows.Forms.RichTextBox richTextBoxLogs; - private System.Windows.Forms.CheckBox checkBoxCecReconnectToPowerTv; private System.Windows.Forms.Button buttonClearLogs; private System.Windows.Forms.GroupBox groupBoxCecLogOptions; private System.Windows.Forms.CheckBox checkBoxCecLogWarning; diff -r 4961ede27e0a -r 5de8f8eaaa54 Server/MainForm.cs --- a/Server/MainForm.cs Sun Jul 24 20:36:07 2016 +0200 +++ b/Server/MainForm.cs Sun Jul 24 20:46:34 2016 +0200 @@ -1192,9 +1192,6 @@ //CEC settings checkBoxCecEnabled.Checked = Properties.Settings.Default.CecEnabled; - checkBoxCecMonitorOn.Checked = Properties.Settings.Default.CecMonitorOn; - checkBoxCecMonitorOff.Checked = Properties.Settings.Default.CecMonitorOff; - checkBoxCecReconnectToPowerTv.Checked = Properties.Settings.Default.CecReconnectToPowerTv; comboBoxHdmiPort.SelectedIndex = Properties.Settings.Default.CecHdmiPort - 1; //Mini Display settings @@ -2577,30 +2574,6 @@ ResetCec(); } - private void checkBoxCecMonitorOff_CheckedChanged(object sender, EventArgs e) - { - Properties.Settings.Default.CecMonitorOff = checkBoxCecMonitorOff.Checked; - Properties.Settings.Default.Save(); - // - ResetCec(); - } - - private void checkBoxCecMonitorOn_CheckedChanged(object sender, EventArgs e) - { - Properties.Settings.Default.CecMonitorOn = checkBoxCecMonitorOn.Checked; - Properties.Settings.Default.Save(); - // - ResetCec(); - } - - private void checkBoxCecReconnectToPowerTv_CheckedChanged(object sender, EventArgs e) - { - Properties.Settings.Default.CecReconnectToPowerTv = checkBoxCecReconnectToPowerTv.Checked; - Properties.Settings.Default.Save(); - // - ResetCec(); - } - /// /// /// @@ -2617,10 +2590,7 @@ if (Properties.Settings.Default.CecEnabled) { iCecManager.Start(Handle, "CEC", - Properties.Settings.Default.CecHdmiPort, - Properties.Settings.Default.CecMonitorOn, - Properties.Settings.Default.CecMonitorOff, - Properties.Settings.Default.CecReconnectToPowerTv); + Properties.Settings.Default.CecHdmiPort); SetupCecLogLevel(); } diff -r 4961ede27e0a -r 5de8f8eaaa54 Server/Properties/Settings.Designer.cs --- a/Server/Properties/Settings.Designer.cs Sun Jul 24 20:36:07 2016 +0200 +++ b/Server/Properties/Settings.Designer.cs Sun Jul 24 20:46:34 2016 +0200 @@ -145,30 +145,6 @@ [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("True")] - public bool CecMonitorOn { - get { - return ((bool)(this["CecMonitorOn"])); - } - set { - this["CecMonitorOn"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("True")] - public bool CecMonitorOff { - get { - return ((bool)(this["CecMonitorOff"])); - } - set { - this["CecMonitorOff"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("True")] public bool StartIdleClient { get { return ((bool)(this["StartIdleClient"])); @@ -180,18 +156,6 @@ [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("False")] - public bool CecReconnectToPowerTv { - get { - return ((bool)(this["CecReconnectToPowerTv"])); - } - set { - this["CecReconnectToPowerTv"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public global::SharpLib.Ear.ManagerEventAction Actions { get { return ((global::SharpLib.Ear.ManagerEventAction)(this["Actions"])); diff -r 4961ede27e0a -r 5de8f8eaaa54 Server/Properties/Settings.settings --- a/Server/Properties/Settings.settings Sun Jul 24 20:36:07 2016 +0200 +++ b/Server/Properties/Settings.settings Sun Jul 24 20:46:34 2016 +0200 @@ -32,18 +32,9 @@ 1 - - True - - - True - True - - False -