Add methods to print IR functions

This commit is contained in:
Andrew Welker
2020-08-31 14:48:06 -06:00
parent 277886b092
commit 6fe13b6a92
2 changed files with 30 additions and 15 deletions

View File

@@ -63,16 +63,20 @@ namespace PepperDash.Essentials.Core
LoadDriver(filePath); LoadDriver(filePath);
Debug.Console(2, this, "Available IR Commands in IR File {0}",IrPortUid); PrintAvailableCommands();
});
}
public void PrintAvailableCommands()
{
Debug.Console(2, this, "Available IR Commands in IR File {0}", IrPortUid);
foreach (var cmd in IrPort.AvailableIRCmds()) foreach (var cmd in IrPort.AvailableIRCmds())
{ {
Debug.Console(2, this, "{0}", cmd); Debug.Console(2, this, "{0}", cmd);
} }
});
} }
/// <summary> /// <summary>
/// Loads the IR driver at path /// Loads the IR driver at path
/// </summary> /// </summary>

View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using Crestron.SimplSharp; using Crestron.SimplSharp;
using Crestron.SimplSharp.Reflection;
using Crestron.SimplSharpPro; using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DeviceSupport; using Crestron.SimplSharpPro.DeviceSupport;
using Newtonsoft.Json; using Newtonsoft.Json;
@@ -34,6 +35,15 @@ namespace PepperDash.Essentials.Devices.Common
OutputPorts = new RoutingPortCollection<RoutingOutputPort> { HdmiOut, AnyAudioOut }; OutputPorts = new RoutingPortCollection<RoutingOutputPort> { HdmiOut, AnyAudioOut };
} }
public void PrintExpectedIrCommands()
{
var cmds = typeof (AppleTvIrCommands).GetCType().GetFields(BindingFlags.Public | BindingFlags.Static);
foreach (var value in cmds.Select(cmd => cmd.GetValue(null)).OfType<string>())
{
Debug.Console(2, this, "Expected IR Function Name: {0}", value);
}
}
#region IDPad Members #region IDPad Members
@@ -192,14 +202,15 @@ namespace PepperDash.Essentials.Devices.Common
public static class AppleTvIrCommands public static class AppleTvIrCommands
{ {
public const string Up = "UP_ARROW";
public const string Down = "DOWN_ARROW"; public static string Up = "+";
public const string Left = "LEFT_ARROW"; public static string Down = "-";
public const string Right = "RIGHT_ARROW"; public static string Left = IROutputStandardCommands.IROut_TRACK_MINUS;
public const string Enter = "SELECT"; public static string Right = IROutputStandardCommands.IROut_TRACK_PLUS;
public const string PlayPause = "PLAY_PAUSE"; public static string Enter = IROutputStandardCommands.IROut_ENTER;
public const string Rewind = "REWIND"; public static string PlayPause = "PLAY/PAUSE";
public const string Menu = "MENU"; public static string Rewind = "REWIND";
public const string FastForward = "FASTFORWARD"; public static string Menu = "Menu";
public static string FastForward = "FASTFORWARD";
} }
} }