Onkyo = 0x09B0,
Yamaha = 0xA0DE,
Philips = 0x903E,
+ Sony = 0x080046,
Unknown = 0
};
this.components = new System.ComponentModel.Container();
this.tabControl1 = new System.Windows.Forms.TabControl();
this.Configuration = new System.Windows.Forms.TabPage();
+ this.cbVendorOverride = new System.Windows.Forms.CheckBox();
+ this.cbVendorId = new System.Windows.Forms.ComboBox();
this.lPowerOff = new System.Windows.Forms.Label();
this.cbPowerOffDevices = new System.Windows.Forms.CheckedListBox();
this.lWakeDevices = new System.Windows.Forms.Label();
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.cbVendorId = new System.Windows.Forms.ComboBox();
- this.cbVendorOverride = new System.Windows.Forms.CheckBox();
this.tabControl1.SuspendLayout();
this.Configuration.SuspendLayout();
this.tbButtons.SuspendLayout();
this.Configuration.Text = "Configuration";
this.Configuration.UseVisualStyleBackColor = true;
//
+ // cbVendorOverride
+ //
+ this.cbVendorOverride.AutoSize = true;
+ this.cbVendorOverride.Location = new System.Drawing.Point(10, 156);
+ this.cbVendorOverride.Name = "cbVendorOverride";
+ this.cbVendorOverride.Size = new System.Drawing.Size(130, 17);
+ this.cbVendorOverride.TabIndex = 29;
+ this.cbVendorOverride.Text = "Override TV vendor id";
+ this.cbVendorOverride.UseVisualStyleBackColor = true;
+ this.cbVendorOverride.CheckedChanged += new System.EventHandler(this.cbVendorOverride_CheckedChanged);
+ //
+ // cbVendorId
+ //
+ this.cbVendorId.Enabled = false;
+ this.cbVendorId.FormattingEnabled = true;
+ this.cbVendorId.Items.AddRange(new object[] {
+ "- autodetect -",
+ "LG",
+ "Onkyo",
+ "Panasonic",
+ "Philips",
+ "Pioneer",
+ "Samsung",
+ "Sony",
+ "Yamaha"});
+ this.cbVendorId.Location = new System.Drawing.Point(174, 153);
+ this.cbVendorId.Name = "cbVendorId";
+ this.cbVendorId.Size = new System.Drawing.Size(121, 21);
+ this.cbVendorId.TabIndex = 28;
+ this.cbVendorId.Text = "- autodetect -";
+ this.helpDeviceType.SetToolTip(this.cbVendorId, "Only set this value when autodetection isn\'t working");
+ //
// lPowerOff
//
this.lPowerOff.AutoSize = true;
this.lStatus.TabIndex = 2;
this.lStatus.Text = "Initialising...";
//
- // cbVendorId
- //
- this.cbVendorId.Enabled = false;
- this.cbVendorId.FormattingEnabled = true;
- this.cbVendorId.Items.AddRange(new object[] {
- "- autodetect -",
- "LG",
- "Onkyo",
- "Panasonic",
- "Philips",
- "Pioneer",
- "Samsung",
- "Sony",
- "Yamaha"});
- this.cbVendorId.Location = new System.Drawing.Point(174, 153);
- this.cbVendorId.Name = "cbVendorId";
- this.cbVendorId.Size = new System.Drawing.Size(121, 21);
- this.cbVendorId.TabIndex = 28;
- this.cbVendorId.Text = "- autodetect -";
- this.helpDeviceType.SetToolTip(this.cbVendorId, "Only set this value when autodetection isn\'t working");
- //
- // cbVendorOverride
- //
- this.cbVendorOverride.AutoSize = true;
- this.cbVendorOverride.Location = new System.Drawing.Point(10, 156);
- this.cbVendorOverride.Name = "cbVendorOverride";
- this.cbVendorOverride.Size = new System.Drawing.Size(130, 17);
- this.cbVendorOverride.TabIndex = 29;
- this.cbVendorOverride.Text = "Override TV vendor id";
- this.cbVendorOverride.UseVisualStyleBackColor = true;
- //
// CecConfigGUI
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
SetControlEnabled(cbPowerOffOnStandby, val);
SetControlEnabled(cbWakeDevices, false); // TODO not implemented yet
SetControlEnabled(cbPowerOffDevices, false); // TODO not implemented yet
- SetControlEnabled(cbVendorOverride, false); // TODO not implemented yet
- SetControlEnabled(cbVendorId, false); // TODO not implemented yet
+ SetControlEnabled(cbVendorOverride, val);
+ SetControlEnabled(cbVendorId, val && cbVendorOverride.Checked);
SetControlEnabled(bClose, val);
SetControlEnabled(bSave, val);
if (dialog.ShowDialog() == DialogResult.OK)
{
- FileStream fs = (FileStream)dialog.OpenFile();
+ FileStream fs = null;
+ string error = string.Empty;
+ try
+ {
+ fs = (FileStream)dialog.OpenFile();
+ }
+ catch (Exception ex)
+ {
+ error = ex.Message;
+ }
if (fs == null)
{
- MessageBox.Show("Cannot open '" + dialog.FileName + "' for writing", "Pulse-Eight USB-CEC Adapter", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ MessageBox.Show("Cannot open '" + dialog.FileName + "' for writing" + (error.Length > 0 ? ": " + error : string.Empty ), "Pulse-Eight USB-CEC Adapter", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
else
{
}
SetControlsEnabled(true);
}
+
+ private void cbVendorOverride_CheckedChanged(object sender, EventArgs e)
+ {
+ if (cbVendorOverride.Checked)
+ {
+ cbVendorId.Enabled = true;
+ switch (cbVendorId.Text)
+ {
+ case "LG":
+ Config.TvVendor = CecVendorId.LG;
+ break;
+ case "Onkyo":
+ Config.TvVendor = CecVendorId.Onkyo;
+ break;
+ case "Panasonic":
+ Config.TvVendor = CecVendorId.Panasonic;
+ break;
+ case "Philips":
+ Config.TvVendor = CecVendorId.Philips;
+ break;
+ case "Pioneer":
+ Config.TvVendor = CecVendorId.Pioneer;
+ break;
+ case "Samsung":
+ Config.TvVendor = CecVendorId.Samsung;
+ break;
+ case "Sony":
+ Config.TvVendor = CecVendorId.Sony;
+ break;
+ case "Yamaha":
+ Config.TvVendor = CecVendorId.Yamaha;
+ break;
+ default:
+ Config.TvVendor = CecVendorId.Unknown;
+ break;
+ }
+ }
+ else
+ {
+ cbVendorId.Enabled = false;
+ Config.TvVendor = CecVendorId.Unknown;
+ }
+ }
#endregion
#region Key configuration tab
SetControlText(tbPhysicalAddress, string.Format("{0,4:X}", Config.PhysicalAddress));
SetControlText(cbConnectedDevice, Config.BaseDevice == CecLogicalAddress.AudioSystem ? AVRVendorString : TVVendorString);
SetControlText(cbPortNumber, Config.HDMIPort.ToString());
+ switch (config.DeviceTypes.Types[0])
+ {
+ case CecDeviceType.RecordingDevice:
+ SetControlText(cbDeviceType, "Recorder");
+ break;
+ case CecDeviceType.PlaybackDevice:
+ SetControlText(cbDeviceType, "Player");
+ break;
+ case CecDeviceType.Tuner:
+ SetControlText(cbDeviceType, "Tuner");
+ break;
+ default:
+ SetControlText(cbDeviceType, "Recorder");
+ break;
+ }
+ if (config.TvVendor != CecVendorId.Unknown)
+ {
+ SetCheckboxChecked(cbVendorOverride, true);
+ SetControlText(cbVendorId, Lib.ToString(config.TvVendor));
+ }
+ else
+ {
+ SetCheckboxChecked(cbVendorOverride, false);
+ SetControlText(cbVendorId, Lib.ToString(TVVendor));
+ }
+
SetCheckboxChecked(cbUseTVMenuLanguage, Config.UseTVMenuLanguage);
SetCheckboxChecked(cbActivateSource, Config.ActivateSource);
SetCheckboxChecked(cbPowerOffScreensaver, Config.PowerOffScreensaver);
<metadata name="cecButtonConfigBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>662, 17</value>
</metadata>
- <metadata name="CecButtonName.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
- <value>True</value>
- </metadata>
- <metadata name="cecButtonConfigBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>662, 17</value>
- </metadata>
- <metadata name="helpPortNumber.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>17, 17</value>
- </metadata>
- <metadata name="helpConnectedHDMIDevice.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>160, 17</value>
- </metadata>
- <metadata name="helpPhysicalAddress.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>362, 17</value>
- </metadata>
</root>
\ No newline at end of file
bool CCECProcessor::GetCurrentConfiguration(libcec_configuration *configuration)
{
- m_configuration.tvVendor = m_busDevices[CECDEVICE_TV]->GetVendorId();
-
// client version 1.5.0
configuration->clientVersion = m_configuration.clientVersion;
snprintf(configuration->strDeviceName, 13, "%s", m_configuration.strDeviceName);