From 7f5e9919210e2554d893a2d1ac950436e6ce2a17 Mon Sep 17 00:00:00 2001 From: Nick Genovese Date: Thu, 26 Oct 2023 22:19:47 -0400 Subject: [PATCH] feat: updated namespaces on a few things --- .../{Interfaces => }/IAudioCodecInfo.cs | 0 .../{Interfaces => }/IHasAudioCodec.cs | 0 .../Cameras/CameraBase.cs | 6 - .../Cameras/CameraControl.cs | 4 - .../Cameras/CameraVisca.cs | 5 - .../Cameras/IHasCameraPresets.cs | 3 - .../Codec/IHasCallHold.cs | 8 +- .../Codec/iHasCallHistory.cs | 6 - .../Codec/iHasContentSharing.cs | 9 +- .../Codec/iHasDialer.cs | 6 - .../Codec/iHasDirectory.cs | 6 - .../Codec/iHasScheduleAwareness.cs | 2 - .../Display/IInputDisplayPort1.cs | 4 + .../Display/IInputDisplayPort2.cs | 4 + .../Display/IInputHdmi1.cs | 10 + .../Display/IInputHdmi2.cs | 4 + .../Display/IInputHdmi3.cs | 4 + .../Display/IInputHdmi4.cs | 4 + .../Display/IInputVga1.cs | 4 + .../{Audio => }/GenericAudioOut.cs | 8 +- .../IRDiscPlayerBase.cs | 448 ++++++++++++++++++ 21 files changed, 485 insertions(+), 60 deletions(-) rename src/PepperDash.Essentials.Devices.Common/AudioCodec/{Interfaces => }/IAudioCodecInfo.cs (100%) rename src/PepperDash.Essentials.Devices.Common/AudioCodec/{Interfaces => }/IHasAudioCodec.cs (100%) create mode 100644 src/PepperDash.Essentials.Devices.Common/Display/IInputDisplayPort1.cs create mode 100644 src/PepperDash.Essentials.Devices.Common/Display/IInputDisplayPort2.cs create mode 100644 src/PepperDash.Essentials.Devices.Common/Display/IInputHdmi1.cs create mode 100644 src/PepperDash.Essentials.Devices.Common/Display/IInputHdmi2.cs create mode 100644 src/PepperDash.Essentials.Devices.Common/Display/IInputHdmi3.cs create mode 100644 src/PepperDash.Essentials.Devices.Common/Display/IInputHdmi4.cs create mode 100644 src/PepperDash.Essentials.Devices.Common/Display/IInputVga1.cs rename src/PepperDash.Essentials.Devices.Common/{Audio => }/GenericAudioOut.cs (96%) create mode 100644 src/PepperDash.Essentials.Devices.Common/IRDiscPlayerBase.cs diff --git a/src/PepperDash.Essentials.Devices.Common/AudioCodec/Interfaces/IAudioCodecInfo.cs b/src/PepperDash.Essentials.Devices.Common/AudioCodec/IAudioCodecInfo.cs similarity index 100% rename from src/PepperDash.Essentials.Devices.Common/AudioCodec/Interfaces/IAudioCodecInfo.cs rename to src/PepperDash.Essentials.Devices.Common/AudioCodec/IAudioCodecInfo.cs diff --git a/src/PepperDash.Essentials.Devices.Common/AudioCodec/Interfaces/IHasAudioCodec.cs b/src/PepperDash.Essentials.Devices.Common/AudioCodec/IHasAudioCodec.cs similarity index 100% rename from src/PepperDash.Essentials.Devices.Common/AudioCodec/Interfaces/IHasAudioCodec.cs rename to src/PepperDash.Essentials.Devices.Common/AudioCodec/IHasAudioCodec.cs diff --git a/src/PepperDash.Essentials.Devices.Common/Cameras/CameraBase.cs b/src/PepperDash.Essentials.Devices.Common/Cameras/CameraBase.cs index 294e9066..612fc194 100644 --- a/src/PepperDash.Essentials.Devices.Common/Cameras/CameraBase.cs +++ b/src/PepperDash.Essentials.Devices.Common/Cameras/CameraBase.cs @@ -3,10 +3,6 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Text.RegularExpressions; -using Crestron.SimplSharp; -using Crestron.SimplSharp.Reflection; using Crestron.SimplSharpPro.DeviceSupport; using PepperDash.Core; using PepperDash.Essentials.Core; @@ -14,8 +10,6 @@ using PepperDash.Essentials.Core.Devices; using PepperDash.Essentials.Core.Config; using PepperDash.Essentials.Core.Bridges; using PepperDash.Essentials.Core.Presets; -using PepperDash.Essentials.Devices.Common.Codec; - using Full.Newtonsoft.Json; namespace PepperDash.Essentials.Devices.Common.Cameras diff --git a/src/PepperDash.Essentials.Devices.Common/Cameras/CameraControl.cs b/src/PepperDash.Essentials.Devices.Common/Cameras/CameraControl.cs index cbf53476..4daea79f 100644 --- a/src/PepperDash.Essentials.Devices.Common/Cameras/CameraControl.cs +++ b/src/PepperDash.Essentials.Devices.Common/Cameras/CameraControl.cs @@ -1,9 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using Crestron.SimplSharp; - using PepperDash.Essentials.Core; namespace PepperDash.Essentials.Devices.Common.Cameras diff --git a/src/PepperDash.Essentials.Devices.Common/Cameras/CameraVisca.cs b/src/PepperDash.Essentials.Devices.Common/Cameras/CameraVisca.cs index 5f609c46..861269fc 100644 --- a/src/PepperDash.Essentials.Devices.Common/Cameras/CameraVisca.cs +++ b/src/PepperDash.Essentials.Devices.Common/Cameras/CameraVisca.cs @@ -3,17 +3,12 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Text; using Crestron.SimplSharp; using Crestron.SimplSharpPro.DeviceSupport; using PepperDash.Core; using PepperDash.Essentials.Core; using PepperDash.Essentials.Core.Bridges; using PepperDash.Essentials.Core.Config; -using PepperDash.Essentials.Devices.Common.Codec; -using System.Text.RegularExpressions; -using Crestron.SimplSharp.Reflection; - using Full.Newtonsoft.Json; namespace PepperDash.Essentials.Devices.Common.Cameras diff --git a/src/PepperDash.Essentials.Devices.Common/Cameras/IHasCameraPresets.cs b/src/PepperDash.Essentials.Devices.Common/Cameras/IHasCameraPresets.cs index a8e8983d..f4b13171 100644 --- a/src/PepperDash.Essentials.Devices.Common/Cameras/IHasCameraPresets.cs +++ b/src/PepperDash.Essentials.Devices.Common/Cameras/IHasCameraPresets.cs @@ -1,8 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using Crestron.SimplSharp; namespace PepperDash.Essentials.Devices.Common.Cameras { diff --git a/src/PepperDash.Essentials.Devices.Common/Codec/IHasCallHold.cs b/src/PepperDash.Essentials.Devices.Common/Codec/IHasCallHold.cs index 78211841..19027fb6 100644 --- a/src/PepperDash.Essentials.Devices.Common/Codec/IHasCallHold.cs +++ b/src/PepperDash.Essentials.Devices.Common/Codec/IHasCallHold.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Crestron.SimplSharp; - -namespace PepperDash.Essentials.Devices.Common.Codec +namespace PepperDash.Essentials.Devices.Common.Codec { public interface IHasCallHold { diff --git a/src/PepperDash.Essentials.Devices.Common/Codec/iHasCallHistory.cs b/src/PepperDash.Essentials.Devices.Common/Codec/iHasCallHistory.cs index b0451d7b..07e53b3d 100644 --- a/src/PepperDash.Essentials.Devices.Common/Codec/iHasCallHistory.cs +++ b/src/PepperDash.Essentials.Devices.Common/Codec/iHasCallHistory.cs @@ -2,12 +2,6 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using Crestron.SimplSharp; - -using PepperDash.Core; -using PepperDash.Essentials.Devices.Common.Codec; using PepperDash.Essentials.Devices.Common.VideoCodec; using Full.Newtonsoft.Json; diff --git a/src/PepperDash.Essentials.Devices.Common/Codec/iHasContentSharing.cs b/src/PepperDash.Essentials.Devices.Common/Codec/iHasContentSharing.cs index f3c28243..5447e4c0 100644 --- a/src/PepperDash.Essentials.Devices.Common/Codec/iHasContentSharing.cs +++ b/src/PepperDash.Essentials.Devices.Common/Codec/iHasContentSharing.cs @@ -1,11 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Crestron.SimplSharp; - -using PepperDash.Core; -using PepperDash.Essentials.Core; +using PepperDash.Essentials.Core; namespace PepperDash.Essentials.Devices.Common.Codec diff --git a/src/PepperDash.Essentials.Devices.Common/Codec/iHasDialer.cs b/src/PepperDash.Essentials.Devices.Common/Codec/iHasDialer.cs index bce2dee3..9e1b0b2a 100644 --- a/src/PepperDash.Essentials.Devices.Common/Codec/iHasDialer.cs +++ b/src/PepperDash.Essentials.Devices.Common/Codec/iHasDialer.cs @@ -1,10 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Crestron.SimplSharp; - -using PepperDash.Essentials.Core; namespace PepperDash.Essentials.Devices.Common.Codec { diff --git a/src/PepperDash.Essentials.Devices.Common/Codec/iHasDirectory.cs b/src/PepperDash.Essentials.Devices.Common/Codec/iHasDirectory.cs index 360d111e..2c17fb63 100644 --- a/src/PepperDash.Essentials.Devices.Common/Codec/iHasDirectory.cs +++ b/src/PepperDash.Essentials.Devices.Common/Codec/iHasDirectory.cs @@ -3,14 +3,8 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using Crestron.SimplSharp; - using Full.Newtonsoft.Json; using Full.Newtonsoft.Json.Converters; - - -using PepperDash.Core; using PepperDash.Essentials.Core; using PepperDash.Essentials.Devices.Common.VideoCodec; diff --git a/src/PepperDash.Essentials.Devices.Common/Codec/iHasScheduleAwareness.cs b/src/PepperDash.Essentials.Devices.Common/Codec/iHasScheduleAwareness.cs index 41140c34..278da8b5 100644 --- a/src/PepperDash.Essentials.Devices.Common/Codec/iHasScheduleAwareness.cs +++ b/src/PepperDash.Essentials.Devices.Common/Codec/iHasScheduleAwareness.cs @@ -2,8 +2,6 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Text; using Crestron.SimplSharp; using PepperDash.Core; diff --git a/src/PepperDash.Essentials.Devices.Common/Display/IInputDisplayPort1.cs b/src/PepperDash.Essentials.Devices.Common/Display/IInputDisplayPort1.cs new file mode 100644 index 00000000..e8effffc --- /dev/null +++ b/src/PepperDash.Essentials.Devices.Common/Display/IInputDisplayPort1.cs @@ -0,0 +1,4 @@ +namespace PepperDash.Essentials.Devices.Displays +{ + public interface IInputDisplayPort1 { void InputDisplayPort1(); } +} \ No newline at end of file diff --git a/src/PepperDash.Essentials.Devices.Common/Display/IInputDisplayPort2.cs b/src/PepperDash.Essentials.Devices.Common/Display/IInputDisplayPort2.cs new file mode 100644 index 00000000..d361ef1e --- /dev/null +++ b/src/PepperDash.Essentials.Devices.Common/Display/IInputDisplayPort2.cs @@ -0,0 +1,4 @@ +namespace PepperDash.Essentials.Devices.Displays +{ + public interface IInputDisplayPort2 { void InputDisplayPort2(); } +} \ No newline at end of file diff --git a/src/PepperDash.Essentials.Devices.Common/Display/IInputHdmi1.cs b/src/PepperDash.Essentials.Devices.Common/Display/IInputHdmi1.cs new file mode 100644 index 00000000..03be5004 --- /dev/null +++ b/src/PepperDash.Essentials.Devices.Common/Display/IInputHdmi1.cs @@ -0,0 +1,10 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Crestron.SimplSharp; + +namespace PepperDash.Essentials.Devices.Displays +{ + public interface IInputHdmi1 { void InputHdmi1(); } +} \ No newline at end of file diff --git a/src/PepperDash.Essentials.Devices.Common/Display/IInputHdmi2.cs b/src/PepperDash.Essentials.Devices.Common/Display/IInputHdmi2.cs new file mode 100644 index 00000000..ff0b26e2 --- /dev/null +++ b/src/PepperDash.Essentials.Devices.Common/Display/IInputHdmi2.cs @@ -0,0 +1,4 @@ +namespace PepperDash.Essentials.Devices.Displays +{ + public interface IInputHdmi2 { void InputHdmi2(); } +} \ No newline at end of file diff --git a/src/PepperDash.Essentials.Devices.Common/Display/IInputHdmi3.cs b/src/PepperDash.Essentials.Devices.Common/Display/IInputHdmi3.cs new file mode 100644 index 00000000..26220b3f --- /dev/null +++ b/src/PepperDash.Essentials.Devices.Common/Display/IInputHdmi3.cs @@ -0,0 +1,4 @@ +namespace PepperDash.Essentials.Devices.Displays +{ + public interface IInputHdmi3 { void InputHdmi3(); } +} \ No newline at end of file diff --git a/src/PepperDash.Essentials.Devices.Common/Display/IInputHdmi4.cs b/src/PepperDash.Essentials.Devices.Common/Display/IInputHdmi4.cs new file mode 100644 index 00000000..711a6f8f --- /dev/null +++ b/src/PepperDash.Essentials.Devices.Common/Display/IInputHdmi4.cs @@ -0,0 +1,4 @@ +namespace PepperDash.Essentials.Devices.Displays +{ + public interface IInputHdmi4 { void InputHdmi4(); } +} \ No newline at end of file diff --git a/src/PepperDash.Essentials.Devices.Common/Display/IInputVga1.cs b/src/PepperDash.Essentials.Devices.Common/Display/IInputVga1.cs new file mode 100644 index 00000000..5013b8d5 --- /dev/null +++ b/src/PepperDash.Essentials.Devices.Common/Display/IInputVga1.cs @@ -0,0 +1,4 @@ +namespace PepperDash.Essentials.Devices.Displays +{ + public interface IInputVga1 { void InputVga1(); } +} \ No newline at end of file diff --git a/src/PepperDash.Essentials.Devices.Common/Audio/GenericAudioOut.cs b/src/PepperDash.Essentials.Devices.Common/GenericAudioOut.cs similarity index 96% rename from src/PepperDash.Essentials.Devices.Common/Audio/GenericAudioOut.cs rename to src/PepperDash.Essentials.Devices.Common/GenericAudioOut.cs index 250b29d5..d541456d 100644 --- a/src/PepperDash.Essentials.Devices.Common/Audio/GenericAudioOut.cs +++ b/src/PepperDash.Essentials.Devices.Common/GenericAudioOut.cs @@ -1,13 +1,7 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Crestron.SimplSharp; - +using System.Collections.Generic; using PepperDash.Core; using PepperDash.Essentials.Core; using PepperDash.Essentials.Core.Config; - using PepperDash.Essentials.Core.Routing; namespace PepperDash.Essentials.Devices.Common diff --git a/src/PepperDash.Essentials.Devices.Common/IRDiscPlayerBase.cs b/src/PepperDash.Essentials.Devices.Common/IRDiscPlayerBase.cs new file mode 100644 index 00000000..83ba3399 --- /dev/null +++ b/src/PepperDash.Essentials.Devices.Common/IRDiscPlayerBase.cs @@ -0,0 +1,448 @@ +extern alias Full; +using System.Collections.Generic; +using Crestron.SimplSharpPro; +using Crestron.SimplSharpPro.DeviceSupport; +using Full::Newtonsoft.Json; +using Full::Newtonsoft.Json.Linq; +using PepperDash.Core; +using PepperDash.Essentials.Core; +using PepperDash.Essentials.Core.Bridges; +using PepperDash.Essentials.Core.Config; +using PepperDash.Essentials.Core.Routing; + +namespace PepperDash.Essentials.Devices.Common +{ + public class IRBlurayBase : EssentialsBridgeableDevice, IDiscPlayerControls, IUiDisplayInfo, IRoutingOutputs, IUsageTracking + { + public IrOutputPortController IrPort { get; private set; } + + public uint DisplayUiType { get { return DisplayUiConstants.TypeBluray; } } + + public IRBlurayBase(string key, string name, IrOutputPortController portCont) + : base(key, name) + { + IrPort = portCont; + DeviceManager.AddDevice(portCont); + + HasKeypadAccessoryButton1 = true; + KeypadAccessoryButton1Command = "Clear"; + KeypadAccessoryButton1Label = "Clear"; + + HasKeypadAccessoryButton2 = true; + KeypadAccessoryButton2Command = "NumericEnter"; + KeypadAccessoryButton2Label = "Enter"; + + PowerIsOnFeedback = new BoolFeedback(() => _PowerIsOn); + + HdmiOut = new RoutingOutputPort(RoutingPortNames.HdmiOut, eRoutingSignalType.Audio | eRoutingSignalType.Video, + eRoutingPortConnectionType.Hdmi, null, this); + AnyAudioOut = new RoutingOutputPort(RoutingPortNames.AnyAudioOut, eRoutingSignalType.Audio, + eRoutingPortConnectionType.DigitalAudio, null, this); + OutputPorts = new RoutingPortCollection { HdmiOut, AnyAudioOut }; + } + + public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge) + { + var joinMap = new IRBlurayBaseJoinMap(joinStart); + var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey); + + if (!string.IsNullOrEmpty(joinMapSerialized)) + joinMap = JsonConvert.DeserializeObject(joinMapSerialized); + + if (bridge != null) + { + bridge.AddJoinMap(Key, joinMap); + } + else + { + Debug.Console(0, this, "Please update config to use 'eiscapiadvanced' to get all join map features for this device."); + } + + Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X")); + Debug.Console(0, "Linking to SetTopBox: {0}", Name); + + + trilist.OnlineStatusChange += new OnlineStatusChangeEventHandler((o, a) => + { + if (a.DeviceOnLine) + { + trilist.StringInput[joinMap.Name.JoinNumber].StringValue = Name; + } + }); + + var powerDev = this as IHasPowerControl; + if (powerDev != null) + { + trilist.SetSigTrueAction(joinMap.PowerOn.JoinNumber, powerDev.PowerOn); + trilist.SetSigTrueAction(joinMap.PowerOff.JoinNumber, powerDev.PowerOff); + trilist.SetSigTrueAction(joinMap.PowerToggle.JoinNumber, powerDev.PowerToggle); + } + + var dpadDev = this as IDPad; + if (dpadDev != null) + { + trilist.SetBoolSigAction(joinMap.Up.JoinNumber, dpadDev.Up); + trilist.SetBoolSigAction(joinMap.Down.JoinNumber, dpadDev.Down); + trilist.SetBoolSigAction(joinMap.Left.JoinNumber, dpadDev.Left); + trilist.SetBoolSigAction(joinMap.Right.JoinNumber, dpadDev.Right); + trilist.SetBoolSigAction(joinMap.Select.JoinNumber, dpadDev.Select); + trilist.SetBoolSigAction(joinMap.Menu.JoinNumber, dpadDev.Menu); + trilist.SetBoolSigAction(joinMap.Exit.JoinNumber, dpadDev.Exit); + } + + var channelDev = this as IChannel; + if (channelDev != null) + { + trilist.SetBoolSigAction(joinMap.ChannelUp.JoinNumber, channelDev.ChannelUp); + trilist.SetBoolSigAction(joinMap.ChannelDown.JoinNumber, channelDev.ChannelDown); + trilist.SetBoolSigAction(joinMap.LastChannel.JoinNumber, channelDev.LastChannel); + trilist.SetBoolSigAction(joinMap.Guide.JoinNumber, channelDev.Guide); + trilist.SetBoolSigAction(joinMap.Info.JoinNumber, channelDev.Info); + trilist.SetBoolSigAction(joinMap.Exit.JoinNumber, channelDev.Exit); + } + + var colorDev = this as IColor; + if (colorDev != null) + { + trilist.SetBoolSigAction(joinMap.Red.JoinNumber, colorDev.Red); + trilist.SetBoolSigAction(joinMap.Green.JoinNumber, colorDev.Green); + trilist.SetBoolSigAction(joinMap.Yellow.JoinNumber, colorDev.Yellow); + trilist.SetBoolSigAction(joinMap.Blue.JoinNumber, colorDev.Blue); + } + + var keypadDev = this as ISetTopBoxNumericKeypad; + if (keypadDev != null) + { + trilist.StringInput[joinMap.KeypadAccessoryButton1Label.JoinNumber].StringValue = keypadDev.KeypadAccessoryButton1Label; + trilist.StringInput[joinMap.KeypadAccessoryButton2Label.JoinNumber].StringValue = keypadDev.KeypadAccessoryButton2Label; + + trilist.BooleanInput[joinMap.HasKeypadAccessoryButton1.JoinNumber].BoolValue = keypadDev.HasKeypadAccessoryButton1; + trilist.BooleanInput[joinMap.HasKeypadAccessoryButton2.JoinNumber].BoolValue = keypadDev.HasKeypadAccessoryButton2; + + trilist.SetBoolSigAction(joinMap.Digit0.JoinNumber, keypadDev.Digit0); + trilist.SetBoolSigAction(joinMap.Digit1.JoinNumber, keypadDev.Digit1); + trilist.SetBoolSigAction(joinMap.Digit2.JoinNumber, keypadDev.Digit2); + trilist.SetBoolSigAction(joinMap.Digit3.JoinNumber, keypadDev.Digit3); + trilist.SetBoolSigAction(joinMap.Digit4.JoinNumber, keypadDev.Digit4); + trilist.SetBoolSigAction(joinMap.Digit5.JoinNumber, keypadDev.Digit5); + trilist.SetBoolSigAction(joinMap.Digit6.JoinNumber, keypadDev.Digit6); + trilist.SetBoolSigAction(joinMap.Digit7.JoinNumber, keypadDev.Digit7); + trilist.SetBoolSigAction(joinMap.Digit8.JoinNumber, keypadDev.Digit8); + trilist.SetBoolSigAction(joinMap.Digit9.JoinNumber, keypadDev.Digit9); + trilist.SetBoolSigAction(joinMap.KeypadAccessoryButton1Press.JoinNumber, keypadDev.KeypadAccessoryButton1); + trilist.SetBoolSigAction(joinMap.KeypadAccessoryButton2Press.JoinNumber, keypadDev.KeypadAccessoryButton1); + trilist.SetBoolSigAction(joinMap.KeypadEnter.JoinNumber, keypadDev.KeypadEnter); + } + + var transportDev = this as ITransport; + if (transportDev != null) + { + trilist.SetBoolSigAction(joinMap.Play.JoinNumber, transportDev.Play); + trilist.SetBoolSigAction(joinMap.Pause.JoinNumber, transportDev.Pause); + trilist.SetBoolSigAction(joinMap.Rewind.JoinNumber, transportDev.Rewind); + trilist.SetBoolSigAction(joinMap.FFwd.JoinNumber, transportDev.FFwd); + trilist.SetBoolSigAction(joinMap.ChapMinus.JoinNumber, transportDev.ChapMinus); + trilist.SetBoolSigAction(joinMap.ChapPlus.JoinNumber, transportDev.ChapPlus); + trilist.SetBoolSigAction(joinMap.Stop.JoinNumber, transportDev.Stop); + trilist.SetBoolSigAction(joinMap.Record.JoinNumber, transportDev.Record); + } + } + + + #region IDPad Members + + public void Up(bool pressRelease) + { + IrPort.PressRelease(IROutputStandardCommands.IROut_UP_ARROW, pressRelease); + } + + public void Down(bool pressRelease) + { + IrPort.PressRelease(IROutputStandardCommands.IROut_DN_ARROW, pressRelease); + } + + public void Left(bool pressRelease) + { + IrPort.PressRelease(IROutputStandardCommands.IROut_LEFT_ARROW, pressRelease); + } + + public void Right(bool pressRelease) + { + IrPort.PressRelease(IROutputStandardCommands.IROut_RIGHT_ARROW, pressRelease); + } + + public void Select(bool pressRelease) + { + IrPort.PressRelease(IROutputStandardCommands.IROut_ENTER, pressRelease); + } + + public void Menu(bool pressRelease) + { + IrPort.PressRelease(IROutputStandardCommands.IROut_MENU, pressRelease); + } + + public void Exit(bool pressRelease) + { + IrPort.PressRelease(IROutputStandardCommands.IROut_EXIT, pressRelease); + } + + #endregion + + #region INumericKeypad Members + + public void Digit0(bool pressRelease) + { + IrPort.PressRelease(IROutputStandardCommands.IROut_0, pressRelease); + } + + public void Digit1(bool pressRelease) + { + IrPort.PressRelease(IROutputStandardCommands.IROut_1, pressRelease); + } + + public void Digit2(bool pressRelease) + { + IrPort.PressRelease(IROutputStandardCommands.IROut_2, pressRelease); + } + + public void Digit3(bool pressRelease) + { + IrPort.PressRelease(IROutputStandardCommands.IROut_3, pressRelease); + } + + public void Digit4(bool pressRelease) + { + IrPort.PressRelease(IROutputStandardCommands.IROut_4, pressRelease); + } + + public void Digit5(bool pressRelease) + { + IrPort.PressRelease(IROutputStandardCommands.IROut_5, pressRelease); + } + + public void Digit6(bool pressRelease) + { + IrPort.PressRelease(IROutputStandardCommands.IROut_6, pressRelease); + } + + public void Digit7(bool pressRelease) + { + IrPort.PressRelease(IROutputStandardCommands.IROut_7, pressRelease); + } + + public void Digit8(bool pressRelease) + { + IrPort.PressRelease(IROutputStandardCommands.IROut_8, pressRelease); + } + + public void Digit9(bool pressRelease) + { + IrPort.PressRelease(IROutputStandardCommands.IROut_9, pressRelease); + } + + /// + /// Defaults to true + /// + public bool HasKeypadAccessoryButton1 { get; set; } + + /// + /// Defaults to "-" + /// + public string KeypadAccessoryButton1Label { get; set; } + + + /// + /// Defaults to "Dash" + /// + public string KeypadAccessoryButton1Command { get; set; } + + public void KeypadAccessoryButton1(bool pressRelease) + { + IrPort.PressRelease(KeypadAccessoryButton1Command, pressRelease); + } + + /// + /// Defaults to true + /// + public bool HasKeypadAccessoryButton2 { get; set; } + + /// + /// Defaults to "Enter" + /// + public string KeypadAccessoryButton2Label { get; set; } + + + /// + /// Defaults to "Enter" + /// + public string KeypadAccessoryButton2Command { get; set; } + + public void KeypadAccessoryButton2(bool pressRelease) + { + IrPort.PressRelease(KeypadAccessoryButton2Command, pressRelease); + } + + #endregion + + #region IChannelFunctions Members + + public void ChannelUp(bool pressRelease) + { + IrPort.PressRelease(IROutputStandardCommands.IROut_CH_PLUS, pressRelease); + } + + public void ChannelDown(bool pressRelease) + { + IrPort.PressRelease(IROutputStandardCommands.IROut_CH_MINUS, pressRelease); + } + + public void LastChannel(bool pressRelease) + { + IrPort.PressRelease(IROutputStandardCommands.IROut_LAST, pressRelease); + } + + public void Guide(bool pressRelease) + { + IrPort.PressRelease(IROutputStandardCommands.IROut_GUIDE, pressRelease); + } + + public void Info(bool pressRelease) + { + IrPort.PressRelease(IROutputStandardCommands.IROut_INFO, pressRelease); + } + + #endregion + + #region IColorFunctions Members + + public void Red(bool pressRelease) + { + IrPort.PressRelease(IROutputStandardCommands.IROut_RED, pressRelease); + } + + public void Green(bool pressRelease) + { + IrPort.PressRelease(IROutputStandardCommands.IROut_GREEN, pressRelease); + } + + public void Yellow(bool pressRelease) + { + IrPort.PressRelease(IROutputStandardCommands.IROut_YELLOW, pressRelease); + } + + public void Blue(bool pressRelease) + { + IrPort.PressRelease(IROutputStandardCommands.IROut_BLUE, pressRelease); + } + + #endregion + + #region IRoutingOutputs Members + + public RoutingOutputPort HdmiOut { get; private set; } + public RoutingOutputPort AnyAudioOut { get; private set; } + public RoutingPortCollection OutputPorts { get; private set; } + + #endregion + + #region IPower Members + + public void PowerOn() + { + IrPort.Pulse(IROutputStandardCommands.IROut_POWER_ON, 200); + _PowerIsOn = true; + } + + public void PowerOff() + { + IrPort.Pulse(IROutputStandardCommands.IROut_POWER_OFF, 200); + _PowerIsOn = false; + } + + public void PowerToggle() + { + IrPort.Pulse(IROutputStandardCommands.IROut_POWER, 200); + _PowerIsOn = false; + } + + public BoolFeedback PowerIsOnFeedback { get; set; } + bool _PowerIsOn; + + #endregion + + #region ITransport Members + + public void Play(bool pressRelease) + { + IrPort.PressRelease(IROutputStandardCommands.IROut_PLAY, pressRelease); + } + + public void Pause(bool pressRelease) + { + IrPort.PressRelease(IROutputStandardCommands.IROut_PAUSE, pressRelease); + } + + public void Rewind(bool pressRelease) + { + IrPort.PressRelease(IROutputStandardCommands.IROut_RSCAN, pressRelease); + } + + public void FFwd(bool pressRelease) + { + IrPort.PressRelease(IROutputStandardCommands.IROut_FSCAN, pressRelease); + } + + public void ChapMinus(bool pressRelease) + { + IrPort.PressRelease(IROutputStandardCommands.IROut_TRACK_MINUS, pressRelease); + } + + public void ChapPlus(bool pressRelease) + { + IrPort.PressRelease(IROutputStandardCommands.IROut_TRACK_PLUS, pressRelease); + } + + public void Stop(bool pressRelease) + { + IrPort.PressRelease(IROutputStandardCommands.IROut_STOP, pressRelease); + } + + public void Record(bool pressRelease) + { + } + + #endregion + + #region IUsageTracking Members + + public UsageTracking UsageTracker { get; set; } + + #endregion + } + + public class IRBlurayBaseFactory : EssentialsDeviceFactory + { + public IRBlurayBaseFactory() + { + TypeNames = new List() { "discplayer", "bluray" }; + } + + public override EssentialsDevice BuildDevice(DeviceConfig dc) + { + Debug.Console(1, "Factory Attempting to create new IRBlurayPlayer Device"); + + if (dc.Properties["control"]["method"].Value() == "ir") + { + var irCont = IRPortHelper.GetIrOutputPortController(dc); + return new IRBlurayBase(dc.Key, dc.Name, irCont); + } + else if (dc.Properties["control"]["method"].Value() == "com") + { + Debug.Console(0, "[{0}] COM Device type not implemented YET!", dc.Key); + } + + return null; + } + } + +} \ No newline at end of file