2 using System.Collections.Generic;
6 namespace CecConfigGui.actions
8 class UpdatePhysicalAddress : UpdateProcess
10 public UpdatePhysicalAddress(ref LibCecSharp lib, ushort physicalAddress)
13 PhysicalAddress = physicalAddress;
16 public override void Process()
18 SendEvent(UpdateEventType.BaseDevicePhysicalAddress, 0);
19 SendEvent(UpdateEventType.StatusText, "Setting new configuration...");
20 SendEvent(UpdateEventType.ProgressBar, 25);
22 if (!Lib.SetPhysicalAddress(PhysicalAddress))
24 SendEvent(UpdateEventType.StatusText, "Could not activate the new source");
28 LibCECConfiguration config = new LibCECConfiguration();
29 Lib.GetCurrentConfiguration(config);
31 SendEvent(UpdateEventType.StatusText, "Activating source...");
32 SendEvent(UpdateEventType.ProgressBar, 50);
33 Lib.SetActiveSource(config.DeviceTypes.Types[0]);
35 SendEvent(UpdateEventType.StatusText, "Reading configuration...");
36 SendEvent(UpdateEventType.ProgressBar, 75);
37 Lib.GetCurrentConfiguration(config);
40 SendEvent(UpdateEventType.StatusText, "Ready.");
42 SendEvent(UpdateEventType.ProgressBar, 100);
45 protected LibCecSharp Lib;
46 protected ushort PhysicalAddress;