From ee7748a3ead9a4810bf123f745077b6885ba0eb6 Mon Sep 17 00:00:00 2001 From: Lars Op den Kamp Date: Tue, 28 Feb 2012 02:58:15 +0100 Subject: [PATCH] cec-config-gui: added support for the new 'send inactive source' setting --- src/cec-config-gui/CecConfigGUI.Designer.cs | 46 ++++++++++++++------- src/cec-config-gui/CecConfigGUI.cs | 13 +++++- 2 files changed, 42 insertions(+), 17 deletions(-) diff --git a/src/cec-config-gui/CecConfigGUI.Designer.cs b/src/cec-config-gui/CecConfigGUI.Designer.cs index d45e6d3..417aec2 100644 --- a/src/cec-config-gui/CecConfigGUI.Designer.cs +++ b/src/cec-config-gui/CecConfigGUI.Designer.cs @@ -19,6 +19,7 @@ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CecConfigGUI)); this.tabControl1 = new System.Windows.Forms.TabControl(); this.Configuration = new System.Windows.Forms.TabPage(); + this.cbOverrideAddress = new System.Windows.Forms.CheckBox(); this.bReloadConfig = new System.Windows.Forms.Button(); this.cbVendorOverride = new System.Windows.Forms.CheckBox(); this.cbVendorId = new System.Windows.Forms.ComboBox(); @@ -73,7 +74,7 @@ this.helpConnectedHDMIDevice = new System.Windows.Forms.ToolTip(this.components); this.helpPhysicalAddress = new System.Windows.Forms.ToolTip(this.components); this.helpDeviceType = new System.Windows.Forms.ToolTip(this.components); - this.cbOverrideAddress = new System.Windows.Forms.CheckBox(); + this.cbSendInactiveSource = new System.Windows.Forms.CheckBox(); this.tabControl1.SuspendLayout(); this.Configuration.SuspendLayout(); this.tbButtons.SuspendLayout(); @@ -98,6 +99,7 @@ // // Configuration // + this.Configuration.Controls.Add(this.cbSendInactiveSource); this.Configuration.Controls.Add(this.cbOverrideAddress); this.Configuration.Controls.Add(this.bReloadConfig); this.Configuration.Controls.Add(this.cbVendorOverride); @@ -130,6 +132,18 @@ this.Configuration.Text = "Configuration"; this.Configuration.UseVisualStyleBackColor = true; // + // cbOverrideAddress + // + this.cbOverrideAddress.AutoSize = true; + this.cbOverrideAddress.Enabled = false; + this.cbOverrideAddress.Location = new System.Drawing.Point(10, 97); + this.cbOverrideAddress.Name = "cbOverrideAddress"; + this.cbOverrideAddress.Size = new System.Drawing.Size(147, 17); + this.cbOverrideAddress.TabIndex = 31; + this.cbOverrideAddress.Text = "Override physical address"; + this.cbOverrideAddress.UseVisualStyleBackColor = true; + this.cbOverrideAddress.CheckedChanged += new System.EventHandler(this.cbOverrideAddress_CheckedChanged); + // // bReloadConfig // this.bReloadConfig.Enabled = false; @@ -248,7 +262,7 @@ // this.cbPowerOffOnStandby.AutoSize = true; this.cbPowerOffOnStandby.Enabled = false; - this.cbPowerOffOnStandby.Location = new System.Drawing.Point(10, 297); + this.cbPowerOffOnStandby.Location = new System.Drawing.Point(9, 278); this.cbPowerOffOnStandby.Name = "cbPowerOffOnStandby"; this.cbPowerOffOnStandby.Size = new System.Drawing.Size(292, 17); this.cbPowerOffOnStandby.TabIndex = 22; @@ -259,7 +273,7 @@ // this.cbPowerOffScreensaver.AutoSize = true; this.cbPowerOffScreensaver.Enabled = false; - this.cbPowerOffScreensaver.Location = new System.Drawing.Point(10, 273); + this.cbPowerOffScreensaver.Location = new System.Drawing.Point(9, 255); this.cbPowerOffScreensaver.Name = "cbPowerOffScreensaver"; this.cbPowerOffScreensaver.Size = new System.Drawing.Size(301, 17); this.cbPowerOffScreensaver.TabIndex = 21; @@ -270,7 +284,7 @@ // this.cbActivateSource.AutoSize = true; this.cbActivateSource.Enabled = false; - this.cbActivateSource.Location = new System.Drawing.Point(10, 249); + this.cbActivateSource.Location = new System.Drawing.Point(9, 232); this.cbActivateSource.Name = "cbActivateSource"; this.cbActivateSource.Size = new System.Drawing.Size(284, 17); this.cbActivateSource.TabIndex = 19; @@ -281,7 +295,7 @@ // this.cbUseTVMenuLanguage.AutoSize = true; this.cbUseTVMenuLanguage.Enabled = false; - this.cbUseTVMenuLanguage.Location = new System.Drawing.Point(10, 225); + this.cbUseTVMenuLanguage.Location = new System.Drawing.Point(10, 209); this.cbUseTVMenuLanguage.Name = "cbUseTVMenuLanguage"; this.cbUseTVMenuLanguage.Size = new System.Drawing.Size(168, 17); this.cbUseTVMenuLanguage.TabIndex = 18; @@ -292,7 +306,7 @@ // this.lPlayerConfig.AutoSize = true; this.lPlayerConfig.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lPlayerConfig.Location = new System.Drawing.Point(6, 188); + this.lPlayerConfig.Location = new System.Drawing.Point(6, 182); this.lPlayerConfig.Name = "lPlayerConfig"; this.lPlayerConfig.Size = new System.Drawing.Size(198, 24); this.lPlayerConfig.TabIndex = 16; @@ -733,17 +747,16 @@ this.lStatus.TabIndex = 2; this.lStatus.Text = "Initialising..."; // - // cbOverrideAddress + // cbSendInactiveSource // - this.cbOverrideAddress.AutoSize = true; - this.cbOverrideAddress.Enabled = false; - this.cbOverrideAddress.Location = new System.Drawing.Point(10, 97); - this.cbOverrideAddress.Name = "cbOverrideAddress"; - this.cbOverrideAddress.Size = new System.Drawing.Size(147, 17); - this.cbOverrideAddress.TabIndex = 31; - this.cbOverrideAddress.Text = "Override physical address"; - this.cbOverrideAddress.UseVisualStyleBackColor = true; - this.cbOverrideAddress.CheckedChanged += new System.EventHandler(this.cbOverrideAddress_CheckedChanged); + this.cbSendInactiveSource.AutoSize = true; + this.cbSendInactiveSource.Enabled = false; + this.cbSendInactiveSource.Location = new System.Drawing.Point(9, 301); + this.cbSendInactiveSource.Name = "cbSendInactiveSource"; + this.cbSendInactiveSource.Size = new System.Drawing.Size(261, 17); + this.cbSendInactiveSource.TabIndex = 32; + this.cbSendInactiveSource.Text = "Send \'inactive source\' when shutting down XBMC"; + this.cbSendInactiveSource.UseVisualStyleBackColor = true; // // CecConfigGUI // @@ -834,5 +847,6 @@ private System.Windows.Forms.Label lConnectedPhysicalAddress; private System.Windows.Forms.Label lAdapterConfig; private System.Windows.Forms.CheckBox cbOverrideAddress; + private System.Windows.Forms.CheckBox cbSendInactiveSource; } } \ No newline at end of file diff --git a/src/cec-config-gui/CecConfigGUI.cs b/src/cec-config-gui/CecConfigGUI.cs index b404fbd..94ce2ad 100644 --- a/src/cec-config-gui/CecConfigGUI.cs +++ b/src/cec-config-gui/CecConfigGUI.cs @@ -28,7 +28,7 @@ namespace CecConfigGui Config.DeviceTypes.Types[0] = CecDeviceType.RecordingDevice; Config.DeviceName = "CEC Config"; Config.GetSettingsFromROM = true; - Config.ClientVersion = CecClientVersion.Version1_5_0; + Config.ClientVersion = CecClientVersion.Version1_5_1; Callbacks = new CecCallbackWrapper(this); Config.SetCallbacks(Callbacks); LoadXMLConfiguration(ref Config); @@ -160,6 +160,10 @@ namespace CecConfigGui case "port": //TODO break; + // 1.5.1 settings + case "send_inactive_source": + config.SendInactiveSource = value.Equals("1") || value.ToLower().Equals("true") || value.ToLower().Equals("yes"); + break; default: break; } @@ -335,6 +339,7 @@ namespace CecConfigGui SetControlEnabled(cbPowerOffDevices, val); SetControlEnabled(cbVendorOverride, val); SetControlEnabled(cbVendorId, val && cbVendorOverride.Checked); + SetControlEnabled(cbSendInactiveSource, val); SetControlEnabled(bClose, val); SetControlEnabled(bSaveConfig, val); SetControlEnabled(bReloadConfig, val); @@ -536,6 +541,7 @@ namespace CecConfigGui Config.ActivateSource = cbActivateSource.Checked; Config.PowerOffScreensaver = cbPowerOffScreensaver.Checked; Config.PowerOffOnStandby = cbPowerOffOnStandby.Checked; + Config.SendInactiveSource = cbSendInactiveSource.Checked; Config.WakeDevices = WakeDevices; Config.PowerOffDevices = PowerOffDevices; @@ -610,6 +616,10 @@ namespace CecConfigGui output.Append(strSleepDevices.ToString().Trim()); output.AppendLine("\" />"); + // only supported by 1.5.1+ clients + output.AppendLine(""); + output.AppendLine(""); + output.AppendLine(""); writer.Write(output.ToString()); writer.Close(); @@ -1038,6 +1048,7 @@ namespace CecConfigGui SetCheckboxChecked(cbActivateSource, Config.ActivateSource); SetCheckboxChecked(cbPowerOffScreensaver, Config.PowerOffScreensaver); SetCheckboxChecked(cbPowerOffOnStandby, Config.PowerOffOnStandby); + SetCheckboxChecked(cbSendInactiveSource, Config.SendInactiveSource); UpdateSelectedDevice(); for (int iPtr = 0; iPtr < 15; iPtr++) -- 2.34.1