StephaneLenclud@222: using CecSharp;
StephaneLenclud@222: using SharpLib.Ear;
StephaneLenclud@222: using System;
StephaneLenclud@222: using System.Collections.Generic;
StephaneLenclud@222: using System.Linq;
StephaneLenclud@222: using System.Runtime.InteropServices;
StephaneLenclud@222: using System.Runtime.Serialization;
StephaneLenclud@222: using System.Text;
StephaneLenclud@222: using System.Threading.Tasks;
StephaneLenclud@222:
StephaneLenclud@222: namespace SharpDisplayManager
StephaneLenclud@222: {
StephaneLenclud@222: ///
StephaneLenclud@222: /// Send a user key press event to the given CEC device.
StephaneLenclud@222: ///
StephaneLenclud@222: [DataContract]
StephaneLenclud@231: [AttributeObject(Id = "Cec.UserControlReleased", Name = "CEC User Control Released", Description = "Send user control release opcode to a given CEC device.")]
StephaneLenclud@222: public class ActionCecUserControlReleased : ActionCecDevice
StephaneLenclud@222: {
StephaneLenclud@222:
StephaneLenclud@222: public ActionCecUserControlReleased()
StephaneLenclud@222: {
StephaneLenclud@222: Wait = true;
StephaneLenclud@222: }
StephaneLenclud@222:
StephaneLenclud@222: [DataMember]
StephaneLenclud@231: [AttributeObjectProperty(
StephaneLenclud@222: Id = "Cec.UserControlPressed.Wait",
StephaneLenclud@222: Name = "Wait",
StephaneLenclud@222: Description = "Wait for that command."
StephaneLenclud@222: )]
StephaneLenclud@222: public bool Wait { get; set; }
StephaneLenclud@222:
StephaneLenclud@222: ///
StephaneLenclud@222: ///
StephaneLenclud@222: ///
StephaneLenclud@222: ///
StephaneLenclud@222: public override string Brief()
StephaneLenclud@222: {
StephaneLenclud@222: string brief = Name + " to " + DeviceName;
StephaneLenclud@222: if (Wait)
StephaneLenclud@222: {
StephaneLenclud@222: brief += " (wait)";
StephaneLenclud@222: }
StephaneLenclud@222: return brief;
StephaneLenclud@222: }
StephaneLenclud@222:
StephaneLenclud@222: ///
StephaneLenclud@222: ///
StephaneLenclud@222: ///
StephaneLenclud@228: protected override void DoExecute()
StephaneLenclud@222: {
StephaneLenclud@222: if (Cec.Client.Static == null)
StephaneLenclud@222: {
StephaneLenclud@222: Console.WriteLine("WARNING: No CEC client installed.");
StephaneLenclud@222: return;
StephaneLenclud@222: }
StephaneLenclud@222:
StephaneLenclud@222: Cec.Client.Static.Lib.SendKeyRelease(Device, Wait);
StephaneLenclud@222: }
StephaneLenclud@222: }
StephaneLenclud@222: }