StephaneLenclud@220: using CecSharp; StephaneLenclud@220: using SharpLib.Ear; StephaneLenclud@220: using System; StephaneLenclud@220: using System.Collections.Generic; StephaneLenclud@220: using System.Linq; StephaneLenclud@220: using System.Runtime.InteropServices; StephaneLenclud@220: using System.Runtime.Serialization; StephaneLenclud@220: using System.Text; StephaneLenclud@220: using System.Threading.Tasks; StephaneLenclud@220: StephaneLenclud@220: namespace SharpDisplayManager StephaneLenclud@220: { StephaneLenclud@220: [DataContract] StephaneLenclud@220: [AttributeAction(Id = "Cec.Device.PowerOn", Name = "CEC Device Power On", Description = "Turns on the specified CEC device on your HDMI bus.")] StephaneLenclud@220: public class ActionCecDevicePowerOn : ActionCecDevice StephaneLenclud@220: { StephaneLenclud@220: /// StephaneLenclud@220: /// StephaneLenclud@220: /// StephaneLenclud@220: /// StephaneLenclud@220: public override string Brief() StephaneLenclud@220: { StephaneLenclud@221: if (Device == CecLogicalAddress.Broadcast) StephaneLenclud@221: { StephaneLenclud@221: //Because of duplicated values it would display Unregistered StephaneLenclud@221: return "CEC Power On Broadcast"; StephaneLenclud@221: } StephaneLenclud@221: StephaneLenclud@220: return "CEC Power On " + Device.ToString(); StephaneLenclud@220: } StephaneLenclud@220: StephaneLenclud@220: /// StephaneLenclud@220: /// StephaneLenclud@220: /// StephaneLenclud@220: public override void Execute() StephaneLenclud@220: { StephaneLenclud@220: if (Cec.Client.Static == null) StephaneLenclud@220: { StephaneLenclud@220: Console.WriteLine("WARNING: No CEC client installed."); StephaneLenclud@220: return; StephaneLenclud@220: } StephaneLenclud@220: StephaneLenclud@220: Cec.Client.Static.Lib.PowerOnDevices(Device); StephaneLenclud@220: } StephaneLenclud@220: } StephaneLenclud@220: }