Server/Actions/ActionCecInactiveSource.cs
author StephaneLenclud
Wed, 04 Jan 2017 18:43:28 +0100
changeset 274 920fea7a6427
parent 253 2dae7a163fff
permissions -rw-r--r--
Proper basic support for Audio Visualizer.
StephaneLenclud@214
     1
using CecSharp;
StephaneLenclud@214
     2
using SharpLib.Ear;
StephaneLenclud@214
     3
using System;
StephaneLenclud@214
     4
using System.Collections.Generic;
StephaneLenclud@253
     5
using System.Diagnostics;
StephaneLenclud@214
     6
using System.Linq;
StephaneLenclud@214
     7
using System.Runtime.Serialization;
StephaneLenclud@214
     8
using System.Text;
StephaneLenclud@214
     9
using System.Threading.Tasks;
StephaneLenclud@214
    10
StephaneLenclud@214
    11
namespace SharpDisplayManager
StephaneLenclud@214
    12
{
StephaneLenclud@214
    13
    [DataContract]
StephaneLenclud@231
    14
    [AttributeObject(Id = "Cec.InactiveSource", Name = "CEC Inactive Source", Description = "Set this CEC device as inactive source.")]
StephaneLenclud@214
    15
    class ActionCecInactiveSource : SharpLib.Ear.Action
StephaneLenclud@214
    16
    {
StephaneLenclud@258
    17
        protected override async Task DoExecute()
StephaneLenclud@214
    18
        {
StephaneLenclud@214
    19
            if (Cec.Client.Static == null)
StephaneLenclud@214
    20
            {
StephaneLenclud@253
    21
                Trace.WriteLine("WARNING: No CEC client installed.");
StephaneLenclud@222
    22
                return;
StephaneLenclud@214
    23
            }
StephaneLenclud@214
    24
StephaneLenclud@214
    25
            Cec.Client.Static.Lib.SetInactiveView();
StephaneLenclud@214
    26
        }
StephaneLenclud@214
    27
    }
StephaneLenclud@214
    28
}