3 namespace CecConfigGui.actions
5 class UpdatePhysicalAddress : UpdateProcess
7 public UpdatePhysicalAddress(ref LibCecSharp lib, ushort physicalAddress)
10 PhysicalAddress = physicalAddress;
13 public override void Process()
15 SendEvent(UpdateEventType.BaseDevicePhysicalAddress, 0);
16 SendEvent(UpdateEventType.StatusText, "Setting new configuration...");
17 SendEvent(UpdateEventType.ProgressBar, 25);
19 if (!Lib.SetPhysicalAddress(PhysicalAddress))
21 SendEvent(UpdateEventType.StatusText, "Could not activate the new source");
25 LibCECConfiguration config = new LibCECConfiguration();
26 Lib.GetCurrentConfiguration(config);
28 SendEvent(UpdateEventType.StatusText, "Activating source...");
29 SendEvent(UpdateEventType.ProgressBar, 50);
30 Lib.SetActiveSource(config.DeviceTypes.Types[0]);
32 SendEvent(UpdateEventType.StatusText, "Reading configuration...");
33 SendEvent(UpdateEventType.ProgressBar, 75);
34 Lib.GetCurrentConfiguration(config);
37 SendEvent(UpdateEventType.StatusText, "Ready.");
39 SendEvent(UpdateEventType.ProgressBar, 100);
42 protected LibCecSharp Lib;
43 protected ushort PhysicalAddress;