cec-config-gui: added support for the new 'send inactive source' setting
authorLars Op den Kamp <lars@opdenkamp.eu>
Tue, 28 Feb 2012 01:58:15 +0000 (02:58 +0100)
committerLars Op den Kamp <lars@opdenkamp.eu>
Tue, 28 Feb 2012 01:58:15 +0000 (02:58 +0100)
src/cec-config-gui/CecConfigGUI.Designer.cs
src/cec-config-gui/CecConfigGUI.cs

index d45e6d315b32c14e1bca227f86bd82a1403fccee..417aec229f63df1f4532dd6980731ac9360ef09c 100644 (file)
@@ -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);
       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;
       // 
       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;
       // 
       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;
       // 
       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;
       // 
       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;
       // 
       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;
       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
       // 
     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
index b404fbd4eb48b59b3c2f16f9dcd49cbcc75ed505..94ce2ad5a016212f4897d41c74c4c4457fc13d2e 100644 (file)
@@ -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("<!-- the following lines are only supported by v1.5.1+ clients -->");
+              output.AppendLine("<setting id=\"send_inactive_source\" value=\"" + (Config.SendInactiveSource ? 1 : 0) + "\" />");
+
               output.AppendLine("</settings>");
               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++)