X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcec-config-gui%2FCecConfigGUI.cs;h=e41c292be80901d16658a6f00ad4189a54cb2bc3;hb=32403cc3b1abb8b186ca4bbe14cb7431a492f768;hp=b8c2b54fa68ca7031ef3b410c72639a63f9e732c;hpb=de49d80bb32eef6589d7d3a2413aa684a39b7e34;p=deb_libcec.git diff --git a/src/cec-config-gui/CecConfigGUI.cs b/src/cec-config-gui/CecConfigGUI.cs index b8c2b54..e41c292 100644 --- a/src/cec-config-gui/CecConfigGUI.cs +++ b/src/cec-config-gui/CecConfigGUI.cs @@ -35,7 +35,7 @@ namespace CecConfigGui CecAdapter[] adapters = Lib.FindAdapters(string.Empty); if (adapters.Length == 0 || !Lib.Open(adapters[0].ComPort, 10000)) { - MessageBox.Show("Could not connect to any CEC adapter. Please check your configuration.", "Pulse-Eight USB-CEC Adapter", MessageBoxButtons.OK); + MessageBox.Show("Could not connect to any CEC adapter. Please check your configuration and try again.", "Pulse-Eight USB-CEC Adapter", MessageBoxButtons.OK); Application.Exit(); } @@ -222,18 +222,14 @@ namespace CecConfigGui this.cecButtonConfigBindingSource.Add(new CecButtonConfigItem("(Samsung) Return", (new CecSharp.CecKeypress() { Keycode = 0x91 }), string.Empty)); } - public int ReceiveCommand(CecCommand command) + public int ConfigurationChanged(LibCECConfiguration config) { - bool bGetNewPhysicalAddress = false; - if (command.Opcode == CecOpcode.ReportPhysicalAddress) - bGetNewPhysicalAddress = true; + SetControlText(this.tbPhysicalAddress, String.Format("{0,4:X}", config.PhysicalAddress)); + return 1; + } - if (bGetNewPhysicalAddress) - { - LibCECConfiguration config = new LibCECConfiguration(); - Lib.GetCurrentConfiguration(config); - SetControlText(this.tbPhysicalAddress, String.Format("{0,4:X}", config.PhysicalAddress)); - } + public int ReceiveCommand(CecCommand command) + { return 1; } @@ -884,6 +880,11 @@ namespace CecConfigGui return Gui.ReceiveLogMessage(message); } + public override int ConfigurationChanged(LibCECConfiguration config) + { + return Gui.ConfigurationChanged(config); + } + private CecConfigGUI Gui; } }