/// </summary>
private System.ComponentModel.IContainer components = null;
- /// <summary>
- /// Clean up any resources being used.
- /// </summary>
- /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
#region Windows Form Designer generated code
/// <summary>
this.cbActivateSource = new System.Windows.Forms.CheckBox();
this.cbUseTVMenuLanguage = new System.Windows.Forms.CheckBox();
this.lPlayerConfig = new System.Windows.Forms.Label();
- this.lAdapterConfig = new System.Windows.Forms.Label();
this.cbDeviceType = new System.Windows.Forms.ComboBox();
this.bClose = new System.Windows.Forms.Button();
this.bSaveConfig = new System.Windows.Forms.Button();
this.cbPortNumber = new System.Windows.Forms.ComboBox();
- this.lConnectedPhysicalAddress = new System.Windows.Forms.Label();
this.tbPhysicalAddress = new System.Windows.Forms.TextBox();
this.cbConnectedDevice = new System.Windows.Forms.ComboBox();
this.lDeviceType = 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.lConnectedPhysicalAddress = new System.Windows.Forms.Label();
+ this.lAdapterConfig = new System.Windows.Forms.Label();
this.tabControl1.SuspendLayout();
this.Configuration.SuspendLayout();
this.tbButtons.SuspendLayout();
// cbVendorOverride
//
this.cbVendorOverride.AutoSize = true;
+ this.cbVendorOverride.Enabled = false;
this.cbVendorOverride.Location = new System.Drawing.Point(10, 156);
this.cbVendorOverride.Name = "cbVendorOverride";
this.cbVendorOverride.Size = new System.Drawing.Size(130, 17);
"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.Size = new System.Drawing.Size(157, 21);
this.cbVendorId.TabIndex = 28;
this.cbVendorId.Text = "- autodetect -";
this.helpDeviceType.SetToolTip(this.cbVendorId, "Only set this value when autodetection isn\'t working");
this.lPlayerConfig.TabIndex = 16;
this.lPlayerConfig.Text = "Player Configuration";
//
- // lAdapterConfig
- //
- this.lAdapterConfig.AutoSize = true;
- this.lAdapterConfig.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.lAdapterConfig.Location = new System.Drawing.Point(6, 3);
- this.lAdapterConfig.Name = "lAdapterConfig";
- this.lAdapterConfig.Size = new System.Drawing.Size(213, 24);
- this.lAdapterConfig.TabIndex = 15;
- this.lAdapterConfig.Text = "Adapter Configuration";
- //
// cbDeviceType
//
this.cbDeviceType.Enabled = false;
"Tuner"});
this.cbDeviceType.Location = new System.Drawing.Point(174, 123);
this.cbDeviceType.Name = "cbDeviceType";
- this.cbDeviceType.Size = new System.Drawing.Size(121, 21);
+ this.cbDeviceType.Size = new System.Drawing.Size(157, 21);
this.cbDeviceType.TabIndex = 14;
this.cbDeviceType.Text = "Recorder";
this.helpDeviceType.SetToolTip(this.cbDeviceType, "Set this to \'Player\' when your TV is having problems with \'Recorder\'");
this.helpPortNumber.SetToolTip(this.cbPortNumber, "The HDMI port number, to which you connected your USB-CEC adapter.");
this.cbPortNumber.SelectedIndexChanged += new System.EventHandler(this.connectedDevice_SelectedIndexChanged);
//
- // lConnectedPhysicalAddress
- //
- this.lConnectedPhysicalAddress.AutoSize = true;
- this.lConnectedPhysicalAddress.Location = new System.Drawing.Point(310, 70);
- this.lConnectedPhysicalAddress.Name = "lConnectedPhysicalAddress";
- this.lConnectedPhysicalAddress.Size = new System.Drawing.Size(75, 13);
- this.lConnectedPhysicalAddress.TabIndex = 10;
- this.lConnectedPhysicalAddress.Text = "Address: 0000";
- //
// tbPhysicalAddress
//
this.tbPhysicalAddress.Enabled = false;
this.cbConnectedDevice.FormattingEnabled = true;
this.cbConnectedDevice.Location = new System.Drawing.Point(174, 67);
this.cbConnectedDevice.Name = "cbConnectedDevice";
- this.cbConnectedDevice.Size = new System.Drawing.Size(121, 21);
+ this.cbConnectedDevice.Size = new System.Drawing.Size(157, 21);
this.cbConnectedDevice.TabIndex = 5;
this.helpConnectedHDMIDevice.SetToolTip(this.cbConnectedDevice, "The HDMI device to which the USB-CEC adapter is connected");
this.cbConnectedDevice.SelectedIndexChanged += new System.EventHandler(this.connectedDevice_SelectedIndexChanged);
this.lStatus.TabIndex = 2;
this.lStatus.Text = "Initialising...";
//
+ // lConnectedPhysicalAddress
+ //
+ this.lConnectedPhysicalAddress.AutoSize = true;
+ this.lConnectedPhysicalAddress.Location = new System.Drawing.Point(340, 71);
+ this.lConnectedPhysicalAddress.Name = "lConnectedPhysicalAddress";
+ this.lConnectedPhysicalAddress.Size = new System.Drawing.Size(75, 13);
+ this.lConnectedPhysicalAddress.TabIndex = 10;
+ this.lConnectedPhysicalAddress.Text = "Address: 0000";
+ //
+ // lAdapterConfig
+ //
+ this.lAdapterConfig.AutoSize = true;
+ this.lAdapterConfig.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.lAdapterConfig.Location = new System.Drawing.Point(6, 3);
+ this.lAdapterConfig.Name = "lAdapterConfig";
+ this.lAdapterConfig.Size = new System.Drawing.Size(213, 24);
+ this.lAdapterConfig.TabIndex = 15;
+ this.lAdapterConfig.Text = "Adapter Configuration";
+ //
// CecConfigGUI
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
private System.Windows.Forms.TextBox tbPhysicalAddress;
private System.Windows.Forms.ProgressBar pProgress;
private System.Windows.Forms.Label lStatus;
- private System.Windows.Forms.Label lConnectedPhysicalAddress;
private System.Windows.Forms.TextBox tbLog;
private System.Windows.Forms.ComboBox cbPortNumber;
private System.Windows.Forms.Button bClose;
private System.Windows.Forms.Button bSaveConfig;
private System.Windows.Forms.ComboBox cbDeviceType;
- private System.Windows.Forms.Label lAdapterConfig;
private System.Windows.Forms.CheckBox cbPowerOffOnStandby;
private System.Windows.Forms.CheckBox cbPowerOffScreensaver;
private System.Windows.Forms.CheckBox cbActivateSource;
private System.Windows.Forms.ComboBox cbVendorId;
private System.Windows.Forms.Button bReloadConfig;
private System.Windows.Forms.Button bRescanDevices;
+ private System.Windows.Forms.Label lConnectedPhysicalAddress;
+ private System.Windows.Forms.Label lAdapterConfig;
}
}
\ No newline at end of file
SetControlText(tbPhysicalAddress, string.Format("{0,4:X}", updateEvent.IntValue));
break;
case UpdateEventType.ProgressBar:
+ SetControlVisible(pProgress, true);
SetProgressValue(pProgress, updateEvent.IntValue);
break;
case UpdateEventType.TVVendorId:
UpdatingInfoPanel.SetControlEnabled(UpdatingInfoPanel.bUpdate, true);
UpdatingInfoPanel = null;
}
+ SetControlVisible(pProgress, false);
break;
}
}
private void SetControlsEnabled(bool val)
{
- SetControlEnabled(cbPortNumber, val);
- SetControlEnabled(cbConnectedDevice, cbConnectedDevice.Items.Count > 1 ? val : false);
- SetControlEnabled(tbPhysicalAddress, val);
+ SetControlEnabled(cbPortNumber, val && !Config.AutodetectAddress);
+ SetControlEnabled(cbConnectedDevice, cbConnectedDevice.Items.Count > 1 && !Config.AutodetectAddress ? val : false);
+ SetControlEnabled(tbPhysicalAddress, val && !Config.AutodetectAddress);
SetControlEnabled(cbDeviceType, val);
SetControlEnabled(cbUseTVMenuLanguage, val);
SetControlEnabled(cbActivateSource, val);
}
}
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing)
+ {
+ Lib.DisableCallbacks();
+ Lib.StandbyDevices(CecLogicalAddress.Broadcast);
+ Lib.Close();
+ }
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
#region Actions
public void ReloadXMLConfiguration()
{
Application.Exit();
}
- SendEvent(UpdateEventType.StatusText, "Detecting TV vendor...");
SendEvent(UpdateEventType.ProgressBar, 20);
+ SendEvent(UpdateEventType.StatusText, "Sending power on commands...");
+ Lib.PowerOnDevices(CecLogicalAddress.Broadcast);
+
+ SendEvent(UpdateEventType.StatusText, "Detecting TV vendor...");
+ SendEvent(UpdateEventType.ProgressBar, 30);
SendEvent(UpdateEventType.TVVendorId, (int)Lib.GetDeviceVendorId(CecLogicalAddress.Tv));
SendEvent(UpdateEventType.StatusText, "Detecting menu language...");
- SendEvent(UpdateEventType.ProgressBar, 30);
+ SendEvent(UpdateEventType.ProgressBar, 40);
SendEvent(UpdateEventType.MenuLanguage, Lib.GetDeviceMenuLanguage(CecLogicalAddress.Tv));
- SendEvent(UpdateEventType.ProgressBar, 40);
+ SendEvent(UpdateEventType.ProgressBar, 50);
SendEvent(UpdateEventType.StatusText, "Detecting AVR devices...");
bool hasAVRDevice = Lib.IsActiveDevice(CecLogicalAddress.AudioSystem);
if (hasAVRDevice)
{
- SendEvent(UpdateEventType.ProgressBar, 50);
+ SendEvent(UpdateEventType.ProgressBar, 60);
SendEvent(UpdateEventType.StatusText, "Detecting AVR vendor...");
SendEvent(UpdateEventType.AVRVendorId, (int)Lib.GetDeviceVendorId(CecLogicalAddress.AudioSystem));
}
if (!Lib.GetDevicePowerStatus(CecLogicalAddress.Tv).Equals(CecPowerStatus.On))
{
- SendEvent(UpdateEventType.ProgressBar, 60);
+ SendEvent(UpdateEventType.ProgressBar, 70);
SendEvent(UpdateEventType.StatusText, "Activating the source...");
Lib.SetActiveSource(CecDeviceType.Reserved);
}
- SendEvent(UpdateEventType.ProgressBar, 70);
+ SendEvent(UpdateEventType.ProgressBar, 80);
SendEvent(UpdateEventType.StatusText, "Reading device configuration...");
Lib.GetCurrentConfiguration(Config);
SendEvent(Config);
- SendEvent(UpdateEventType.ProgressBar, 80);
+ SendEvent(UpdateEventType.ProgressBar, 90);
SendEvent(UpdateEventType.StatusText, "Polling active devices");
SendEvent(UpdateEventType.PollDevices);