From a30062db7123f116d3a487402f6740213f0ea3c3 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Tue, 18 Aug 2020 14:46:13 -0600 Subject: [PATCH] add static class for IR Command values and use them --- .../Streaming/AppleTV.cs | 28 +++++++++++++------ 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/Streaming/AppleTV.cs b/essentials-framework/Essentials Devices Common/Essentials Devices Common/Streaming/AppleTV.cs index 1db187f8..26fb1223 100644 --- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/Streaming/AppleTV.cs +++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/Streaming/AppleTV.cs @@ -39,32 +39,32 @@ namespace PepperDash.Essentials.Devices.Common public void Up(bool pressRelease) { - IrPort.PressRelease("+", pressRelease); + IrPort.PressRelease(AppleTvIrCommands.Up, pressRelease); } public void Down(bool pressRelease) { - IrPort.PressRelease("-", pressRelease); + IrPort.PressRelease(AppleTvIrCommands.Down, pressRelease); } public void Left(bool pressRelease) { - IrPort.PressRelease(IROutputStandardCommands.IROut_TRACK_MINUS, pressRelease); + IrPort.PressRelease(AppleTvIrCommands.Left, pressRelease); } public void Right(bool pressRelease) { - IrPort.PressRelease(IROutputStandardCommands.IROut_TRACK_PLUS, pressRelease); + IrPort.PressRelease(AppleTvIrCommands.Right, pressRelease); } public void Select(bool pressRelease) { - IrPort.PressRelease(IROutputStandardCommands.IROut_ENTER, pressRelease); + IrPort.PressRelease(AppleTvIrCommands.Enter, pressRelease); } public void Menu(bool pressRelease) { - IrPort.PressRelease("Menu", pressRelease); + IrPort.PressRelease(AppleTvIrCommands.Menu, pressRelease); } public void Exit(bool pressRelease) @@ -78,12 +78,12 @@ namespace PepperDash.Essentials.Devices.Common public void Play(bool pressRelease) { - IrPort.PressRelease("PLAY/PAUSE", pressRelease); + IrPort.PressRelease(AppleTvIrCommands.PlayPause, pressRelease); } public void Pause(bool pressRelease) { - IrPort.PressRelease("PLAY/PAUSE", pressRelease); + IrPort.PressRelease(AppleTvIrCommands.PlayPause, pressRelease); } /// @@ -190,4 +190,16 @@ namespace PepperDash.Essentials.Devices.Common } } + public static class AppleTvIrCommands + { + public const string Up = "UP_ARROW"; + public const string Down = "DOWN_ARROW"; + public const string Left = "LEFT_ARROW"; + public const string Right = "RIGHT_ARROW"; + public const string Enter = "SELECT"; + public const string PlayPause = "PLAY_PAUSE"; + public const string Rewind = "REWIND"; + public const string Menu = "MENU"; + public const string FastForward = "FASTFORWARD"; + } } \ No newline at end of file