/// <summary> /// Starts and stops IR command on driver. Safe for missing commands /// </summary> public virtual void PressRelease(string command, bool state) { Debug.Console(2, this, "IR:'{0}'={1}", command, state); if (IrPort == null) { Debug.Console(2, this, "WARNING No IR Port assigned to controller"); return; } if (!DriverIsLoaded) { Debug.Console(2, this, "WARNING IR driver is not loaded"); return; } if (state) { if (IrPort.IsIRCommandAvailable(IrPortUid, command)) { IrPort.Press(IrPortUid, command); } else { NoIrCommandError(command); } } else { IrPort.Release(); } }