StephaneLenclud@214: using CecSharp; StephaneLenclud@214: using SharpLib.Ear; StephaneLenclud@214: using System; StephaneLenclud@214: using System.Collections.Generic; StephaneLenclud@253: using System.Diagnostics; StephaneLenclud@214: using System.Linq; StephaneLenclud@214: using System.Runtime.Serialization; StephaneLenclud@214: using System.Text; StephaneLenclud@214: using System.Threading.Tasks; StephaneLenclud@214: StephaneLenclud@214: namespace SharpDisplayManager StephaneLenclud@214: { StephaneLenclud@214: [DataContract] StephaneLenclud@231: [AttributeObject(Id = "Cec.ActiveSource", Name = "CEC Active Source", Description = "Set this CEC device as active source.")] StephaneLenclud@222: class ActionCecActiveSource : ActionCecDeviceType StephaneLenclud@214: { StephaneLenclud@222: /// StephaneLenclud@222: /// Build a user readable string to describe this action. StephaneLenclud@222: /// StephaneLenclud@222: /// StephaneLenclud@222: public override string Brief() StephaneLenclud@222: { StephaneLenclud@222: return "CEC Active Source to " + DeviceType.ToString(); StephaneLenclud@222: } StephaneLenclud@222: StephaneLenclud@222: /// StephaneLenclud@222: /// Set the defined device type as active source. StephaneLenclud@222: /// StephaneLenclud@228: protected override void DoExecute() StephaneLenclud@214: { StephaneLenclud@214: if (Cec.Client.Static == null) StephaneLenclud@214: { StephaneLenclud@253: Trace.WriteLine("WARNING: No CEC client installed."); StephaneLenclud@222: return; StephaneLenclud@214: } StephaneLenclud@214: StephaneLenclud@222: Cec.Client.Static.Lib.SetActiveSource(DeviceType); StephaneLenclud@214: } StephaneLenclud@214: } StephaneLenclud@214: }