Server/Actions/ActionCecInactiveSource.cs
author StephaneLenclud
Thu, 05 Jan 2017 14:54:43 +0100
changeset 275 a4a341accc89
parent 253 2dae7a163fff
permissions -rw-r--r--
Published v1.4.2
Fixing issues with Audio Visualizer bitmaps created when form is not visible.
Now reusing Audio Visualizer bitmap for better performance and memory usage.
     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.Serialization;
     8 using System.Text;
     9 using System.Threading.Tasks;
    10 
    11 namespace SharpDisplayManager
    12 {
    13     [DataContract]
    14     [AttributeObject(Id = "Cec.InactiveSource", Name = "CEC Inactive Source", Description = "Set this CEC device as inactive source.")]
    15     class ActionCecInactiveSource : SharpLib.Ear.Action
    16     {
    17         protected override async Task DoExecute()
    18         {
    19             if (Cec.Client.Static == null)
    20             {
    21                 Trace.WriteLine("WARNING: No CEC client installed.");
    22                 return;
    23             }
    24 
    25             Cec.Client.Static.Lib.SetInactiveView();
    26         }
    27     }
    28 }