Server/Actions/ActionCecDeviceStandby.cs
author StephaneLenclud
Wed, 04 Jan 2017 18:43:28 +0100
changeset 274 920fea7a6427
parent 258 e237c2e33545
permissions -rw-r--r--
Proper basic support for Audio Visualizer.
     1 using CecSharp;
     2 using SharpLib.Ear;
     3 using System;
     4 using System.Collections.Generic;
     5 using System.Diagnostics;
     6 using System.Linq;
     7 using System.Runtime.InteropServices;
     8 using System.Runtime.Serialization;
     9 using System.Text;
    10 using System.Threading.Tasks;
    11 
    12 namespace SharpDisplayManager
    13 {
    14     [DataContract]
    15     [AttributeObject(Id = "Cec.Device.Standby", Name = "CEC Device Standby", Description = "Puts on standby the specified CEC device on your HDMI bus.")]
    16     public class ActionCecDeviceStandby : ActionCecDevice
    17     {
    18         /// <summary>
    19         /// Build a user readable string to describe this action.
    20         /// </summary>
    21         /// <returns></returns>
    22         public override string BriefBase()
    23         {
    24             return "CEC Standby " + DeviceName;
    25         }
    26 
    27         /// <summary>
    28         /// 
    29         /// </summary>
    30         protected override async Task DoExecute()
    31         {
    32             if (Cec.Client.Static == null)
    33             {
    34                 Trace.WriteLine("WARNING: No CEC client installed.");
    35                 return;
    36             }
    37 
    38             Cec.Client.Static.Lib.StandbyDevices(Device);
    39         }
    40 
    41     }
    42 }