X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2FLibCecTray%2Fcontroller%2FActions.cs;h=355f94ee4c5b6fa2bf8d5604482636d252028c10;hb=103eb041ef46f322b3c374da47feabab6c378004;hp=13dc92035be67a078ffb42660552a6d98c78baf8;hpb=16f47961800432dbdd5b3ead717908f383d26d6b;p=deb_libcec.git diff --git a/src/LibCecTray/controller/Actions.cs b/src/LibCecTray/controller/Actions.cs index 13dc920..355f94e 100644 --- a/src/LibCecTray/controller/Actions.cs +++ b/src/LibCecTray/controller/Actions.cs @@ -94,7 +94,7 @@ namespace LibCECTray.controller _controller.CheckActiveDevices(); break; case UpdateEventType.ProcessCompleted: - if (!(_activeProcess is GetCurrentPhysicalAddress)) + if (!(_activeProcess is GetCurrentPhysicalAddress) && !SuppressUpdates) { _activeProcess = new GetCurrentPhysicalAddress(_controller.Lib); _activeProcess.EventHandler += ProcessEventHandler; @@ -123,6 +123,7 @@ namespace LibCECTray.controller break; case UpdateEventType.ExitApplication: + SuppressUpdates = true; _activeProcess = null; Application.Exit(); break; @@ -207,7 +208,7 @@ namespace LibCECTray.controller /// Activate the source at the given logical address. /// /// The logical address of the device to activate - public void ActivateSource(CecLogicalAddress address) + public void SetStreamPath(CecLogicalAddress address) { if (SuppressUpdates || _activeProcess != null) return; @@ -217,6 +218,16 @@ namespace LibCECTray.controller (new Thread(_activeProcess.Run)).Start(); } + public void ActivateSource() + { + if (SuppressUpdates || _activeProcess != null) return; + + _controller.SetControlsEnabled(false); + _activeProcess = new ActivateSource(_controller.Lib); + _activeProcess.EventHandler += ProcessEventHandler; + (new Thread(_activeProcess.Run)).Start(); + } + /// /// Send a standby command to the device at the given logical address ///