mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-15 12:44:58 +00:00
feature: started to add ability to override IRSettopbox button layout
This commit is contained in:
@@ -28,6 +28,7 @@ namespace PepperDash.Essentials.Devices.Common
|
|||||||
public bool HasDvr { get; set; }
|
public bool HasDvr { get; set; }
|
||||||
public bool HasDpad { get; set; }
|
public bool HasDpad { get; set; }
|
||||||
public bool HasNumeric { get; set; }
|
public bool HasNumeric { get; set; }
|
||||||
|
private bool _OverrideKeypadEnter;
|
||||||
|
|
||||||
public DevicePresetsModel TvPresets { get; private set; }
|
public DevicePresetsModel TvPresets { get; private set; }
|
||||||
|
|
||||||
@@ -56,7 +57,31 @@ namespace PepperDash.Essentials.Devices.Common
|
|||||||
|
|
||||||
HasKeypadAccessoryButton2 = true;
|
HasKeypadAccessoryButton2 = true;
|
||||||
KeypadAccessoryButton2Command = "KEYPAD_ENTER";
|
KeypadAccessoryButton2Command = "KEYPAD_ENTER";
|
||||||
KeypadAccessoryButton2Label = "Enter";
|
KeypadAccessoryButton2Label = "Enter";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (props.AccessoryButton1Override != null)
|
||||||
|
{
|
||||||
|
KeypadAccessoryButton1Command = !String.IsNullOrEmpty(props.AccessoryButton1Override.Command)
|
||||||
|
? props.AccessoryButton1Override.Command
|
||||||
|
: KeypadAccessoryButton1Command;
|
||||||
|
KeypadAccessoryButton1Label = !String.IsNullOrEmpty(props.AccessoryButton1Override.Label)
|
||||||
|
? props.AccessoryButton1Override.Label
|
||||||
|
: KeypadAccessoryButton1Label;
|
||||||
|
}
|
||||||
|
if (props.AccessoryButton2Override != null)
|
||||||
|
{
|
||||||
|
KeypadAccessoryButton2Command = !String.IsNullOrEmpty(props.AccessoryButton2Override.Command)
|
||||||
|
? props.AccessoryButton2Override.Command
|
||||||
|
: KeypadAccessoryButton2Command;
|
||||||
|
KeypadAccessoryButton2Label = !String.IsNullOrEmpty(props.AccessoryButton2Override.Label)
|
||||||
|
? props.AccessoryButton2Override.Label
|
||||||
|
: KeypadAccessoryButton2Label;
|
||||||
|
}
|
||||||
|
_OverrideKeypadEnter = props.UseStandardEnterForKeypad;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
AnyVideoOut = new RoutingOutputPort(RoutingPortNames.AnyVideoOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
AnyVideoOut = new RoutingOutputPort(RoutingPortNames.AnyVideoOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
||||||
eRoutingPortConnectionType.Hdmi, null, this);
|
eRoutingPortConnectionType.Hdmi, null, this);
|
||||||
@@ -187,7 +212,7 @@ namespace PepperDash.Essentials.Devices.Common
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string KeypadAccessoryButton1Label { get; set; }
|
public string KeypadAccessoryButton1Label { get; set; }
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Defaults to "Dash"
|
/// Defaults to "Dash"
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -236,7 +261,12 @@ namespace PepperDash.Essentials.Devices.Common
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public void KeypadEnter(bool pressRelease)
|
public void KeypadEnter(bool pressRelease)
|
||||||
{
|
{
|
||||||
IrPort.PressRelease("numericEnter", pressRelease);
|
if (!_OverrideKeypadEnter)
|
||||||
|
{
|
||||||
|
IrPort.PressRelease("numericEnter", pressRelease);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
IrPort.PressRelease(IROutputStandardCommands.IROut_ENTER, pressRelease);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
@@ -5,10 +5,11 @@ using System.Text;
|
|||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
|
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
|
using PepperDash.Essentials.Core.Config;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Devices.Common
|
namespace PepperDash.Essentials.Devices.Common
|
||||||
{
|
{
|
||||||
public class SetTopBoxPropertiesConfig : PepperDash.Essentials.Core.Config.SourceDevicePropertiesConfigBase
|
public class SetTopBoxPropertiesConfig : SourceDevicePropertiesConfigBase
|
||||||
{
|
{
|
||||||
public bool HasPresets { get; set; }
|
public bool HasPresets { get; set; }
|
||||||
public bool HasDvr { get; set; }
|
public bool HasDvr { get; set; }
|
||||||
@@ -16,6 +17,31 @@ namespace PepperDash.Essentials.Devices.Common
|
|||||||
public bool HasNumeric { get; set; }
|
public bool HasNumeric { get; set; }
|
||||||
public int IrPulseTime { get; set; }
|
public int IrPulseTime { get; set; }
|
||||||
|
|
||||||
|
public bool UseStandardEnterForKeypad { get; set; }
|
||||||
|
|
||||||
|
public CommandOverride AccessoryButton1Override { get; set; }
|
||||||
|
public CommandOverride AccessoryButton2Override { get; set; }
|
||||||
|
//public List<CommandOverride> CommandOverrides { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public ControlPropertiesConfig Control { get; set; }
|
public ControlPropertiesConfig Control { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Object for overriding standard IR commands
|
||||||
|
/// </summary>
|
||||||
|
public class CommandOverride
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The command in essentials to replace
|
||||||
|
/// </summary>
|
||||||
|
public string Command { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// the value to replace the essentials command with
|
||||||
|
/// </summary>
|
||||||
|
public string Label { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user