mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-01-12 03:54:51 +00:00
Compare commits
64 Commits
1.12.9-bet
...
feature/Ge
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fbba6e089a | ||
|
|
cef78c881e | ||
|
|
e1ce35863f | ||
|
|
acd3bad1f2 | ||
|
|
08514915b2 | ||
|
|
ea464038b9 | ||
|
|
c4c44d02f5 | ||
|
|
3fe5d89904 | ||
|
|
c0d78e8978 | ||
|
|
3716dd0824 | ||
|
|
ebe8ee5653 | ||
|
|
432934ad00 | ||
|
|
372cf86613 | ||
|
|
67c99a9ad4 | ||
|
|
31085d42a9 | ||
|
|
0df315426b | ||
|
|
6ddbdd90c7 | ||
|
|
39e1e5167b | ||
|
|
7f916d1d2f | ||
|
|
7c7f087898 | ||
|
|
898dab1d9a | ||
|
|
b221d2f0cb | ||
|
|
9656269826 | ||
|
|
ba182c1d98 | ||
|
|
2460290dc1 | ||
|
|
0b01661196 | ||
|
|
dfa55ab9f8 | ||
|
|
55ad92e2f6 | ||
|
|
c53cad8119 | ||
|
|
82e8b4b203 | ||
|
|
8965752025 | ||
|
|
8c3b891255 | ||
|
|
51bd95937a | ||
|
|
10fc8ee30b | ||
|
|
8da8b8c584 | ||
|
|
c7e0326b8c | ||
|
|
845978c741 | ||
|
|
ba511067d3 | ||
|
|
a9fe8bbb10 | ||
|
|
bc64ee37cb | ||
|
|
b2646f50cb | ||
|
|
465aa947cf | ||
|
|
16b78d27b9 | ||
|
|
4e56213dad | ||
|
|
668fc89eb2 | ||
|
|
e623c482a9 | ||
|
|
243c7cc3ee | ||
|
|
615598c8a6 | ||
|
|
3b25108a26 | ||
|
|
f253abd0ae | ||
|
|
e04f6d0396 | ||
|
|
eb4c7ff605 | ||
|
|
d0688cbc16 | ||
|
|
961af69aae | ||
|
|
df402ce498 | ||
|
|
701513d30e | ||
|
|
058b3820be | ||
|
|
772369bcd6 | ||
|
|
cef29af1ba | ||
|
|
8cc6cfafe9 | ||
|
|
5de4382cd0 | ||
|
|
3b2fa8aec5 | ||
|
|
ffa864c71b | ||
|
|
112a2b7382 |
37
.github/workflows/add-issues-to-project.yml
vendored
37
.github/workflows/add-issues-to-project.yml
vendored
@@ -1,37 +0,0 @@
|
||||
name: Add bugs to bugs project
|
||||
|
||||
on:
|
||||
issues:
|
||||
types:
|
||||
- opened
|
||||
- labeled
|
||||
|
||||
jobs:
|
||||
check-secret:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
my-key: ${{ steps.my-key.outputs.defined }}
|
||||
steps:
|
||||
- id: my-key
|
||||
if: "${{ env.MY_KEY != '' }}"
|
||||
run: echo "::set-output name=defined::true"
|
||||
env:
|
||||
MY_KEY: ${{ secrets.PROJECT_URL }}
|
||||
throw-error:
|
||||
name: Check
|
||||
runs-on: ubuntu-latest
|
||||
needs: [check-secret]
|
||||
if: needs.check-secret.outputs.my-key != 'true'
|
||||
steps:
|
||||
- run: echo "The Project URL Repo Secret is empty"
|
||||
add-to-project:
|
||||
name: Add issue to project
|
||||
runs-on: ubuntu-latest
|
||||
needs: [check-secret]
|
||||
if: needs.check-secret.outputs.my-key == 'true'
|
||||
steps:
|
||||
- uses: actions/add-to-project@main
|
||||
with:
|
||||
project-url: ${{ secrets.PROJECT_URL }}
|
||||
github-token: ${{ secrets.GH_PROJECTS_PASSWORD }}
|
||||
|
||||
@@ -55,7 +55,7 @@ namespace PepperDash.Essentials
|
||||
return null;
|
||||
}
|
||||
|
||||
// DSP format: deviceKey--levelName, biampTesira-1--master
|
||||
// DSP/DMPS format: deviceKey--levelName, biampTesira-1--master
|
||||
match = Regex.Match(DeviceKey, @"([-_\w]+)--(.+)");
|
||||
if (match.Success)
|
||||
{
|
||||
@@ -67,6 +67,27 @@ namespace PepperDash.Essentials
|
||||
if (dsp.LevelControlPoints.ContainsKey(levelTag)) // should always...
|
||||
return dsp.LevelControlPoints[levelTag];
|
||||
}
|
||||
|
||||
var dmps = DeviceManager.GetDeviceForKey(devKey) as DmpsAudioOutputController;
|
||||
if (dmps != null)
|
||||
{
|
||||
var levelTag = match.Groups[2].Value;
|
||||
switch (levelTag)
|
||||
{
|
||||
case "master":
|
||||
return dmps.MasterVolumeLevel;
|
||||
case "source":
|
||||
return dmps.SourceVolumeLevel;
|
||||
case "micsmaster":
|
||||
return dmps.MicsMasterVolumeLevel;
|
||||
case "codec1":
|
||||
return dmps.Codec1VolumeLevel;
|
||||
case "codec2":
|
||||
return dmps.Codec2VolumeLevel;
|
||||
default:
|
||||
return dmps.MasterVolumeLevel;
|
||||
}
|
||||
}
|
||||
// No volume for some reason. We have failed as developers
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -47,28 +47,29 @@ namespace PepperDash.Essentials
|
||||
/// </summary>
|
||||
public override void InitializeSystem()
|
||||
{
|
||||
_startTimer = new CTimer(StartSystem,StartupTime);
|
||||
|
||||
|
||||
// If the control system is a DMPS type, we need to wait to exit this method until all devices have had time to activate
|
||||
// to allow any HD-BaseT DM endpoints to register first.
|
||||
if (Global.ControlSystemIsDmpsType)
|
||||
bool preventInitializationComplete = Global.ControlSystemIsDmpsType;
|
||||
if (preventInitializationComplete)
|
||||
{
|
||||
Debug.Console(1, "******************* InitializeSystem() Entering **********************");
|
||||
|
||||
_initializeEvent = new CEvent();
|
||||
|
||||
_startTimer = new CTimer(StartSystem, preventInitializationComplete, StartupTime);
|
||||
_initializeEvent = new CEvent(true, false);
|
||||
DeviceManager.AllDevicesRegistered += (o, a) =>
|
||||
{
|
||||
_initializeEvent.Set();
|
||||
Debug.Console(1, "******************* InitializeSystem() Exiting **********************");
|
||||
};
|
||||
|
||||
_initializeEvent.Wait(30000);
|
||||
Debug.Console(1, "******************* InitializeSystem() Exiting **********************");
|
||||
SystemMonitor.ProgramInitialization.ProgramInitializationComplete = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
_startTimer = new CTimer(StartSystem, preventInitializationComplete, StartupTime);
|
||||
}
|
||||
}
|
||||
|
||||
private void StartSystem(object obj)
|
||||
private void StartSystem(object preventInitialization)
|
||||
{
|
||||
DeterminePlatform();
|
||||
|
||||
@@ -92,27 +93,28 @@ namespace PepperDash.Essentials
|
||||
CrestronConsole.AddNewConsoleCommand(s =>
|
||||
{
|
||||
foreach (var tl in TieLineCollection.Default)
|
||||
CrestronConsole.ConsoleCommandResponse(" {0}\r\n", tl);
|
||||
CrestronConsole.ConsoleCommandResponse(" {0}{1}", tl, CrestronEnvironment.NewLine);
|
||||
},
|
||||
"listtielines", "Prints out all tie lines", ConsoleAccessLevelEnum.AccessOperator);
|
||||
|
||||
CrestronConsole.AddNewConsoleCommand(s =>
|
||||
{
|
||||
CrestronConsole.ConsoleCommandResponse
|
||||
("Current running configuration. This is the merged system and template configuration");
|
||||
("Current running configuration. This is the merged system and template configuration" + CrestronEnvironment.NewLine);
|
||||
CrestronConsole.ConsoleCommandResponse(Newtonsoft.Json.JsonConvert.SerializeObject
|
||||
(ConfigReader.ConfigObject, Newtonsoft.Json.Formatting.Indented));
|
||||
}, "showconfig", "Shows the current running merged config", ConsoleAccessLevelEnum.AccessOperator);
|
||||
|
||||
CrestronConsole.AddNewConsoleCommand(s =>
|
||||
CrestronConsole.AddNewConsoleCommand(s =>
|
||||
CrestronConsole.ConsoleCommandResponse(
|
||||
"This system can be found at the following URLs:\r\n" +
|
||||
"System URL: {0}\r\n" +
|
||||
"Template URL: {1}",
|
||||
ConfigReader.ConfigObject.SystemUrl,
|
||||
ConfigReader.ConfigObject.TemplateUrl),
|
||||
"portalinfo",
|
||||
"Shows portal URLS from configuration",
|
||||
"This system can be found at the following URLs:{2}" +
|
||||
"System URL: {0}{2}" +
|
||||
"Template URL: {1}{2}",
|
||||
ConfigReader.ConfigObject.SystemUrl,
|
||||
ConfigReader.ConfigObject.TemplateUrl,
|
||||
CrestronEnvironment.NewLine),
|
||||
"portalinfo",
|
||||
"Shows portal URLS from configuration",
|
||||
ConsoleAccessLevelEnum.AccessOperator);
|
||||
|
||||
|
||||
@@ -125,7 +127,10 @@ namespace PepperDash.Essentials
|
||||
return;
|
||||
}
|
||||
|
||||
SystemMonitor.ProgramInitialization.ProgramInitializationComplete = true;
|
||||
if (!(bool)preventInitialization)
|
||||
{
|
||||
SystemMonitor.ProgramInitialization.ProgramInitializationComplete = true;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
||||
using PepperDash.Essentials.Room.Config;
|
||||
using PepperDash.Essentials.Core.Devices;
|
||||
using PepperDash.Essentials.Devices.Common.Codec;
|
||||
using PepperDash.Essentials.Devices.Common.VideoCodec;
|
||||
using PepperDash.Essentials.Devices.Common.AudioCodec;
|
||||
|
||||
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials
|
||||
{
|
||||
public interface IEssentialsHuddleSpaceRoom : IEssentialsRoom, IHasCurrentSourceInfoChange, IRunRouteAction, IHasDefaultDisplay
|
||||
{
|
||||
bool ExcludeFromGlobalFunctions { get; }
|
||||
|
||||
void RunRouteAction(string routeKey);
|
||||
|
||||
EssentialsHuddleRoomPropertiesConfig PropertiesConfig { get; }
|
||||
|
||||
IBasicVolumeControls CurrentVolumeControls { get; }
|
||||
|
||||
event EventHandler<VolumeDeviceChangeEventArgs> CurrentVolumeDeviceChange;
|
||||
}
|
||||
|
||||
public interface IEssentialsHuddleVtc1Room : IEssentialsRoom, IHasCurrentSourceInfoChange,
|
||||
IHasCurrentVolumeControls, IRunRouteAction, IRunDefaultCallRoute, IHasVideoCodec, IHasAudioCodec, IHasDefaultDisplay
|
||||
{
|
||||
EssentialsHuddleVtc1PropertiesConfig PropertiesConfig { get; }
|
||||
|
||||
void RunRouteAction(string routeKey);
|
||||
|
||||
IHasScheduleAwareness ScheduleSource { get; }
|
||||
|
||||
string DefaultCodecRouteString { get; }
|
||||
}
|
||||
}
|
||||
@@ -165,7 +165,7 @@ namespace PepperDash.Essentials.Core.Bridges
|
||||
|
||||
Debug.Console(1, this, "Linking Device: '{0}'", device.Key);
|
||||
|
||||
if (!typeof (IBridgeAdvanced).IsAssignableFrom(device.GetType().GetCType()))
|
||||
if (!typeof(IBridgeAdvanced).IsAssignableFrom(device.GetType().GetCType()))
|
||||
{
|
||||
Debug.Console(0, this, Debug.ErrorLogLevel.Notice,
|
||||
"{0} is not compatible with this bridge type. Please use 'eiscapi' instead, or updae the device.",
|
||||
@@ -409,7 +409,7 @@ namespace PepperDash.Essentials.Core.Bridges
|
||||
public List<ApiDevicePropertiesConfig> Devices { get; set; }
|
||||
|
||||
[JsonProperty("rooms")]
|
||||
public List<ApiRoomPropertiesConfig> Rooms { get; set; }
|
||||
public List<ApiRoomPropertiesConfig> Rooms { get; set; }
|
||||
|
||||
|
||||
public class ApiDevicePropertiesConfig
|
||||
@@ -442,7 +442,7 @@ namespace PepperDash.Essentials.Core.Bridges
|
||||
{
|
||||
public EiscApiAdvancedFactory()
|
||||
{
|
||||
TypeNames = new List<string> { "eiscapiadv", "eiscapiadvanced", "eiscapiadvancedserver", "eiscapiadvancedclient", "vceiscapiadv", "vceiscapiadvanced" };
|
||||
TypeNames = new List<string> { "eiscapiadv", "eiscapiadvanced", "eiscapiadvancedserver", "eiscapiadvancedclient", "vceiscapiadv", "vceiscapiadvanced" };
|
||||
}
|
||||
|
||||
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||
@@ -457,34 +457,34 @@ namespace PepperDash.Essentials.Core.Bridges
|
||||
{
|
||||
case "eiscapiadv":
|
||||
case "eiscapiadvanced":
|
||||
{
|
||||
eisc = new ThreeSeriesTcpIpEthernetIntersystemCommunications(controlProperties.IpIdInt,
|
||||
controlProperties.TcpSshProperties.Address, Global.ControlSystem);
|
||||
break;
|
||||
}
|
||||
case "eiscapiadvancedserver":
|
||||
{
|
||||
eisc = new EISCServer(controlProperties.IpIdInt, Global.ControlSystem);
|
||||
break;
|
||||
}
|
||||
case "eiscapiadvancedclient":
|
||||
{
|
||||
eisc = new EISCClient(controlProperties.IpIdInt, controlProperties.TcpSshProperties.Address, Global.ControlSystem);
|
||||
break;
|
||||
}
|
||||
case "vceiscapiadv":
|
||||
case "vceiscapiadvanced":
|
||||
{
|
||||
if (string.IsNullOrEmpty(controlProperties.RoomId))
|
||||
{
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Error, "Unable to build VC-4 EISC Client for device {0}. Room ID is missing or empty", dc.Key);
|
||||
eisc = null;
|
||||
eisc = new ThreeSeriesTcpIpEthernetIntersystemCommunications(controlProperties.IpIdInt,
|
||||
controlProperties.TcpSshProperties.Address, Global.ControlSystem);
|
||||
break;
|
||||
}
|
||||
case "eiscapiadvancedserver":
|
||||
{
|
||||
eisc = new EISCServer(controlProperties.IpIdInt, Global.ControlSystem);
|
||||
break;
|
||||
}
|
||||
case "eiscapiadvancedclient":
|
||||
{
|
||||
eisc = new EISCClient(controlProperties.IpIdInt, controlProperties.TcpSshProperties.Address, Global.ControlSystem);
|
||||
break;
|
||||
}
|
||||
case "vceiscapiadv":
|
||||
case "vceiscapiadvanced":
|
||||
{
|
||||
if (string.IsNullOrEmpty(controlProperties.RoomId))
|
||||
{
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Error, "Unable to build VC-4 EISC Client for device {0}. Room ID is missing or empty", dc.Key);
|
||||
eisc = null;
|
||||
break;
|
||||
}
|
||||
eisc = new VirtualControlEISCClient(controlProperties.IpIdInt, controlProperties.RoomId,
|
||||
Global.ControlSystem);
|
||||
break;
|
||||
}
|
||||
eisc = new VirtualControlEISCClient(controlProperties.IpIdInt, controlProperties.RoomId,
|
||||
Global.ControlSystem);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
eisc = null;
|
||||
break;
|
||||
|
||||
@@ -36,6 +36,28 @@ namespace PepperDash.Essentials.Core.Bridges
|
||||
public JoinDataComplete AudioVideoSource = new JoinDataComplete(new JoinData { JoinNumber = 1, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "DM RMC Audio Video Source Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
|
||||
|
||||
[JoinName("HdcpSupportCapability")]
|
||||
public JoinDataComplete HdcpSupportCapability = new JoinDataComplete(new JoinData { JoinNumber = 2, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "DM RMC HDCP Support Capability", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Analog });
|
||||
|
||||
[JoinName("Port1HdcpState")]
|
||||
public JoinDataComplete Port1HdcpState = new JoinDataComplete(new JoinData { JoinNumber = 3, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "DM RMC Port 1 (DM) HDCP State Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
|
||||
|
||||
[JoinName("Port2HdcpState")]
|
||||
public JoinDataComplete Port2HdcpState = new JoinDataComplete(new JoinData { JoinNumber = 4, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "DM TX Port 2 (HDMI) HDCP State Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
|
||||
|
||||
[JoinName("HdmiInputSync")]
|
||||
public JoinDataComplete HdmiInputSync = new JoinDataComplete(new JoinData { JoinNumber = 2, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "DM RMC HDMI Input Sync", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||
|
||||
[JoinName("HdcpInputPortCount")]
|
||||
public JoinDataComplete HdcpInputPortCount = new JoinDataComplete(new JoinData { JoinNumber = 5, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "Number of Input Ports that support HDCP", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Analog });
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Constructor to use when instantiating this Join Map without inheriting from it
|
||||
/// </summary>
|
||||
@@ -50,7 +72,8 @@ namespace PepperDash.Essentials.Core.Bridges
|
||||
/// </summary>
|
||||
/// <param name="joinStart">Join this join map will start at</param>
|
||||
/// <param name="type">Type of the child join map</param>
|
||||
protected DmRmcControllerJoinMap(uint joinStart, Type type) : base(joinStart, type)
|
||||
protected DmRmcControllerJoinMap(uint joinStart, Type type)
|
||||
: base(joinStart, type)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,6 +64,16 @@ namespace PepperDash.Essentials.Core.Bridges
|
||||
public JoinDataComplete VgaContrast = new JoinDataComplete(new JoinData { JoinNumber = 7, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "DM TX Online", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
|
||||
|
||||
[JoinName("Port3HdcpState")]
|
||||
public JoinDataComplete Port3HdcpState = new JoinDataComplete(new JoinData { JoinNumber = 8, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "DM TX Port 3 HDCP State Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
|
||||
|
||||
[JoinName("HdcpInputPortCount")]
|
||||
public JoinDataComplete HdcpInputPortCount = new JoinDataComplete(new JoinData { JoinNumber = 9, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "Number of Input Ports that support HDCP", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Analog });
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Constructor to use when instantiating this Join Map without inheriting from it
|
||||
/// </summary>
|
||||
@@ -78,7 +88,8 @@ namespace PepperDash.Essentials.Core.Bridges
|
||||
/// </summary>
|
||||
/// <param name="joinStart">Join this join map will start at</param>
|
||||
/// <param name="type">Type of the child join map</param>
|
||||
protected DmTxControllerJoinMap(uint joinStart, Type type) : base(joinStart, type)
|
||||
protected DmTxControllerJoinMap(uint joinStart, Type type)
|
||||
: base(joinStart, type)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using System.ComponentModel;
|
||||
using Crestron.SimplSharp.Net.Http;
|
||||
using Crestron.SimplSharp.Ssh;
|
||||
using Crestron.SimplSharpPro.EthernetCommunication;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Core.DebugThings;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
@@ -17,52 +16,130 @@ namespace PepperDash.Essentials.Core
|
||||
public GenericHttpClient(string key, string name, string hostname)
|
||||
: base(key, name)
|
||||
{
|
||||
Client = new HttpClient();
|
||||
Client.HostName = hostname;
|
||||
|
||||
|
||||
Client = new HttpClient {HostName = hostname};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
public GenericHttpClient(string key, string name, string hostname, GenericHttpClientConnectionOptions options)
|
||||
: base(key, name)
|
||||
{
|
||||
Client = new HttpClient
|
||||
{
|
||||
HostName = hostname,
|
||||
Accept = options.Accept,
|
||||
KeepAlive = options.KeepAlive,
|
||||
Password = options.Password,
|
||||
Timeout = options.Timeout,
|
||||
TimeoutEnabled = options.TimeoutEnabled,
|
||||
UserAgent = options.UserAgent,
|
||||
UserName = options.UserName,
|
||||
Version = options.Version
|
||||
};
|
||||
if (options.Port > 0) Client.Port = options.Port;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Send a HTTP Get Request to a client
|
||||
/// </summary>
|
||||
/// <param name="path"></param>
|
||||
public void SendText(string path)
|
||||
{
|
||||
HttpClientRequest request = new HttpClientRequest();
|
||||
string url = string.Format("http://{0}/{1}", Client.HostName, path);
|
||||
request.Url = new UrlParser(url);
|
||||
HttpClient.DISPATCHASYNC_ERROR error = Client.DispatchAsyncEx(request, Response, request);
|
||||
}
|
||||
public void SendText(string format, params object[] items)
|
||||
{
|
||||
HttpClientRequest request = new HttpClientRequest();
|
||||
string url = string.Format("http://{0}/{1}", Client.HostName, string.Format(format, items));
|
||||
request.Url = new UrlParser(url);
|
||||
HttpClient.DISPATCHASYNC_ERROR error = Client.DispatchAsyncEx(request, Response, request);
|
||||
}
|
||||
/// <param name="path">Path to request node</param>
|
||||
public void SendText(string path)
|
||||
{
|
||||
var url = string.Format("http://{0}/{1}", Client.HostName, path);
|
||||
var request = new HttpClientRequest()
|
||||
{
|
||||
Url = new UrlParser(url)
|
||||
};
|
||||
var error = Client.DispatchAsyncEx(request, Response, request);
|
||||
}
|
||||
|
||||
public void SendTextNoResponse(string format, params object[] items)
|
||||
{
|
||||
HttpClientRequest request = new HttpClientRequest();
|
||||
string url = string.Format("http://{0}/{1}", Client.HostName, string.Format(format, items));
|
||||
request.Url = new UrlParser(url);
|
||||
Client.Dispatch(request);
|
||||
}
|
||||
/// <summary>
|
||||
/// Send a HTTP Get Request to a client using a formatted string
|
||||
/// </summary>
|
||||
/// <param name="format">Path</param>
|
||||
/// <param name="items">Parameters for Path String Formatting</param>
|
||||
public void SendText(string format, params object[] items)
|
||||
{
|
||||
var url = string.Format("http://{0}/{1}", Client.HostName, string.Format(format, items));
|
||||
var request = new HttpClientRequest()
|
||||
{
|
||||
Url = new UrlParser(url)
|
||||
};
|
||||
var error = Client.DispatchAsyncEx(request, Response, request);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Send a unidirectional HTTP Get Request to a client using a formatted string
|
||||
/// </summary>
|
||||
/// <param name="format">Path</param>
|
||||
/// <param name="items">Parameters for Path String Formatting</param>
|
||||
public void SendTextNoResponse(string format, params object[] items)
|
||||
{
|
||||
var url = string.Format("http://{0}/{1}", Client.HostName, string.Format(format, items));
|
||||
var request = new HttpClientRequest()
|
||||
{
|
||||
Url = new UrlParser(url)
|
||||
};
|
||||
Client.Dispatch(request);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Send an HTTP Request of a specific request type
|
||||
/// </summary>
|
||||
/// <param name="requestType">HTTP Request Type</param>
|
||||
/// <param name="path">Path to request node</param>
|
||||
public void SendText(RequestType requestType, string path)
|
||||
{
|
||||
var url = string.Format("http://{0}/{1}", Client.HostName, path);
|
||||
var request = new HttpClientRequest()
|
||||
{
|
||||
Url = new UrlParser(url),
|
||||
RequestType = requestType
|
||||
};
|
||||
var error = Client.DispatchAsyncEx(request, Response, request);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Send an HTTP Request of a specific request type using a formatted string
|
||||
/// </summary>
|
||||
/// <param name="requestType">HTTP Request Type</param>
|
||||
/// <param name="format">Path</param>
|
||||
/// <param name="items">Parameters for Path String Formatting</param>
|
||||
public void SendText(RequestType requestType, string format, params object[] items)
|
||||
{
|
||||
var url = string.Format("http://{0}/{1}", Client.HostName, string.Format(format, items));
|
||||
var request = new HttpClientRequest()
|
||||
{
|
||||
Url = new UrlParser(url),
|
||||
RequestType = requestType
|
||||
};
|
||||
var error = Client.DispatchAsyncEx(request, Response, request);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Send a unidirectional HTTP Request of a specific request type using a formatted string
|
||||
/// </summary>
|
||||
/// <param name="requestType">HTTP Request Type</param>
|
||||
/// <param name="format">Path</param>
|
||||
/// <param name="items">Parameters for Path String Formatting</param>
|
||||
public void SendTextNoResponse(RequestType requestType, string format, params object[] items)
|
||||
{
|
||||
var url = string.Format("http://{0}/{1}", Client.HostName, string.Format(format, items));
|
||||
var request = new HttpClientRequest()
|
||||
{
|
||||
Url = new UrlParser(url)
|
||||
};
|
||||
Client.Dispatch(request);
|
||||
}
|
||||
|
||||
private void Response(HttpClientResponse response, HTTP_CALLBACK_ERROR error, object request)
|
||||
{
|
||||
if (error == HTTP_CALLBACK_ERROR.COMPLETED)
|
||||
{
|
||||
var responseReceived = response;
|
||||
|
||||
if (responseReceived.ContentString.Length > 0)
|
||||
{
|
||||
if (ResponseRecived != null)
|
||||
ResponseRecived(this, new GenericHttpClientEventArgs(responseReceived.ContentString, (request as HttpClientRequest).Url.ToString(), error));
|
||||
}
|
||||
}
|
||||
if (error != HTTP_CALLBACK_ERROR.COMPLETED) return;
|
||||
var responseReceived = response;
|
||||
|
||||
if (responseReceived.ContentString.Length <= 0) return;
|
||||
if (ResponseRecived == null) return;
|
||||
var httpClientRequest = request as HttpClientRequest;
|
||||
if (httpClientRequest != null)
|
||||
ResponseRecived(this, new GenericHttpClientEventArgs(responseReceived.ContentString, httpClientRequest.Url.ToString(), error));
|
||||
}
|
||||
|
||||
|
||||
@@ -100,6 +177,8 @@ namespace PepperDash.Essentials.Core
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
|
||||
public class GenericHttpClientEventArgs : EventArgs
|
||||
{
|
||||
public string ResponseText { get; private set; }
|
||||
@@ -112,4 +191,84 @@ namespace PepperDash.Essentials.Core
|
||||
Error = error;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Objedct to set parameters for HTTP Requests
|
||||
/// </summary>
|
||||
public class GenericHttpClientConnectionOptions
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets content types that are acceptable for the response. The default
|
||||
/// value is "text/html, image/gif, image/jpeg, image/png, */*".
|
||||
/// </summary>
|
||||
[DefaultValue("text/html, image/gif, image/jpeg, image/png")]
|
||||
public string Accept { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Controls whether to use HTTP Keep-Alive to keep the connection alive between
|
||||
/// requests. If enabled (true) , once a request is made and a connection is
|
||||
/// established, this connection is kept open and used for future requests. If
|
||||
/// disabled, the connection is closed, and a new connection is created for future
|
||||
/// requests.
|
||||
/// </summary>
|
||||
[DefaultValue(true)]
|
||||
public bool KeepAlive { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// This property controls whether the request operation will do an automatic
|
||||
/// timeout checking. If timeout handling is turned on (i.e. this property is
|
||||
/// set to true) and a request takes longer than Timeout, it will be terminated.
|
||||
/// </summary>
|
||||
[DefaultValue(true)]
|
||||
public bool TimeoutEnabled { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the maximum amount of time (in seconds) that a client will wait
|
||||
/// for a server response within a single request. The default value is 60 seconds
|
||||
/// (1 minute). The timeout handling can be activated via the TimeoutEnabled
|
||||
/// property.
|
||||
/// </summary>
|
||||
[DefaultValue(60)]
|
||||
public int Timeout { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the version identifier of the UserAgent. Can be used to mimic
|
||||
/// particular browsers like Internet Explorer 6.0
|
||||
/// </summary>
|
||||
[DefaultValue("1.1")]
|
||||
public string Version { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the identifier of the software being used to retrieve data via
|
||||
/// the URL. Some custom HTTP servers check this HTTP header to provide content
|
||||
/// optimized for particular HTTP browsers.
|
||||
/// </summary>
|
||||
[DefaultValue("Crestron SimplSharp HTTP Client")]
|
||||
public string UserAgent { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Name that will be inserted into the Authorization HTTP header in the request
|
||||
/// to the server.
|
||||
/// </summary>
|
||||
public string UserName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Password that will be inserted into the Authorization HTTP header in the
|
||||
/// request to the server.
|
||||
/// </summary>
|
||||
public string Password { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The server Port that you intend the client to connect to. If you do not
|
||||
/// assign a port number on this property, the port number in the parsed URL
|
||||
/// will be used. If a port number is assigned in the parsed URL, it will take
|
||||
/// precedence over this property.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// If you do not assign a port number on this property, the port number in the
|
||||
/// parsed URL will be used.
|
||||
/// </remarks>
|
||||
///
|
||||
public int Port { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -379,28 +379,28 @@ namespace PepperDash.Essentials.Core
|
||||
/// Prints a list of routing inputs and outputs by device key.
|
||||
/// </summary>
|
||||
/// <param name="s">Device key from which to report data</param>
|
||||
public static void GetRoutingPorts(string s)
|
||||
{
|
||||
var device = GetDeviceForKey(s);
|
||||
public static void GetRoutingPorts(string s)
|
||||
{
|
||||
var device = GetDeviceForKey(s);
|
||||
|
||||
if (device == null) return;
|
||||
var inputPorts = ((device as IRoutingInputs) != null) ? (device as IRoutingInputs).InputPorts : null;
|
||||
var outputPorts = ((device as IRoutingOutputs) != null) ? (device as IRoutingOutputs).OutputPorts : null;
|
||||
if (inputPorts != null)
|
||||
{
|
||||
CrestronConsole.ConsoleCommandResponse("Device {0} has {1} Input Ports:", s, inputPorts.Count);
|
||||
foreach (var routingInputPort in inputPorts)
|
||||
{
|
||||
CrestronConsole.ConsoleCommandResponse("{0}", routingInputPort.Key);
|
||||
}
|
||||
}
|
||||
if (inputPorts != null)
|
||||
{
|
||||
CrestronConsole.ConsoleCommandResponse("Device {0} has {1} Input Ports:{2}", s, inputPorts.Count, CrestronEnvironment.NewLine);
|
||||
foreach (var routingInputPort in inputPorts)
|
||||
{
|
||||
CrestronConsole.ConsoleCommandResponse("{0}{1}", routingInputPort.Key, CrestronEnvironment.NewLine);
|
||||
}
|
||||
}
|
||||
if (outputPorts == null) return;
|
||||
CrestronConsole.ConsoleCommandResponse("Device {0} has {1} Output Ports:", s, outputPorts.Count);
|
||||
CrestronConsole.ConsoleCommandResponse("Device {0} has {1} Output Ports:{2}", s, outputPorts.Count, CrestronEnvironment.NewLine);
|
||||
foreach (var routingOutputPort in outputPorts)
|
||||
{
|
||||
CrestronConsole.ConsoleCommandResponse("{0}", routingOutputPort.Key);
|
||||
CrestronConsole.ConsoleCommandResponse("{0}{1}", routingOutputPort.Key, CrestronEnvironment.NewLine);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Attempts to set the debug level of a device
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Crestron.SimplSharp;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
@@ -8,6 +9,7 @@ namespace PepperDash_Essentials_Core.Devices
|
||||
/// <summary>
|
||||
/// Interface for any device that is able to control it'spower and has a configurable reboot time
|
||||
/// </summary>
|
||||
[Obsolete("PepperDash_Essentials_Core.Devices is Deprecated - use PepperDash.Essentials.Core")]
|
||||
public interface IHasPowerCycle : IKeyName, IHasPowerControlWithFeedback
|
||||
{
|
||||
/// <summary>
|
||||
@@ -24,6 +26,7 @@ namespace PepperDash_Essentials_Core.Devices
|
||||
/// <summary>
|
||||
/// Interface for any device that contains a collection of IHasPowerReboot Devices
|
||||
/// </summary>
|
||||
[Obsolete("PepperDash_Essentials_Core.Devices is Deprecated - use PepperDash.Essentials.Core")]
|
||||
public interface IHasControlledPowerOutlets : IKeyName
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
using Crestron.SimplSharp;
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Interface for any device that has a battery that can be monitored
|
||||
/// </summary>
|
||||
public interface IHasBatteryStats : IKeyName
|
||||
{
|
||||
int BatteryPercentage { get; }
|
||||
int BatteryCautionThresholdPercentage { get; }
|
||||
int BatteryWarningThresholdPercentage { get; }
|
||||
BoolFeedback BatteryIsWarningFeedback { get; }
|
||||
BoolFeedback BatteryIsCautionFeedback { get; }
|
||||
BoolFeedback BatteryIsOkFeedback { get; }
|
||||
IntFeedback BatteryPercentageFeedback { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Interface for any device that has a battery that can be monitored and the ability to charge and discharge
|
||||
/// </summary>
|
||||
public interface IHasBatteryCharging : IHasBatteryStats
|
||||
{
|
||||
BoolFeedback BatteryIsCharging { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Interface for any device that has multiple batteries that can be monitored
|
||||
/// </summary>
|
||||
public interface IHasBatteries : IKeyName
|
||||
{
|
||||
ReadOnlyDictionary<string, IHasBatteryStats> Batteries { get; }
|
||||
}
|
||||
|
||||
public interface IHasBatteryStatsExtended : IHasBatteryStats
|
||||
{
|
||||
int InputVoltage { get; }
|
||||
int OutputVoltage { get; }
|
||||
int InptuCurrent { get; }
|
||||
int OutputCurrent { get; }
|
||||
|
||||
IntFeedback InputVoltageFeedback { get; }
|
||||
IntFeedback OutputVoltageFeedback { get; }
|
||||
IntFeedback InputCurrentFeedback { get; }
|
||||
IntFeedback OutputCurrentFeedback { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Interface for any device that is able to control its power, has a configurable reboot time, and has batteries that can be monitored
|
||||
/// </summary>
|
||||
public interface IHasPowerCycleWithBattery : IHasPowerCycle, IHasBatteryStats
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Interface for any device that is able to control it's power and has a configurable reboot time
|
||||
/// </summary>
|
||||
public interface IHasPowerCycle : IKeyName, IHasPowerControlWithFeedback
|
||||
{
|
||||
/// <summary>
|
||||
/// Delay between power off and power on for reboot
|
||||
/// </summary>
|
||||
int PowerCycleTimeMs { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Reboot outlet
|
||||
/// </summary>
|
||||
void PowerCycle();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Interface for any device that contains a collection of IHasPowerReboot Devices
|
||||
/// </summary>
|
||||
public interface IHasControlledPowerOutlets : IKeyName
|
||||
{
|
||||
/// <summary>
|
||||
/// Collection of IPduOutlets
|
||||
/// </summary>
|
||||
ReadOnlyDictionary<int, IHasPowerCycle> PduOutlets { get; }
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -175,8 +175,8 @@ namespace PepperDash.Essentials.Core
|
||||
/// <param name="filter"></param>
|
||||
public static void GetDeviceFactoryTypes(string filter)
|
||||
{
|
||||
var types = !string.IsNullOrEmpty(filter)
|
||||
? FactoryMethods.Where(k => k.Key.Contains(filter)).ToDictionary(k => k.Key, k => k.Value)
|
||||
var types = !string.IsNullOrEmpty(filter)
|
||||
? FactoryMethods.Where(k => k.Key.Contains(filter)).ToDictionary(k => k.Key, k => k.Value)
|
||||
: FactoryMethods;
|
||||
|
||||
CrestronConsole.ConsoleCommandResponse("Device Types:");
|
||||
@@ -186,12 +186,12 @@ namespace PepperDash.Essentials.Core
|
||||
var description = type.Value.Description;
|
||||
var cType = "Not Specified by Plugin";
|
||||
|
||||
if(type.Value.CType != null)
|
||||
if (type.Value.CType != null)
|
||||
{
|
||||
cType = type.Value.CType.FullName;
|
||||
}
|
||||
|
||||
CrestronConsole.ConsoleCommandResponse(
|
||||
CrestronConsole.ConsoleCommandResponse(
|
||||
@"Type: '{0}'
|
||||
CType: '{1}'
|
||||
Description: {2}", type.Key, cType, description);
|
||||
|
||||
@@ -21,35 +21,37 @@ namespace PepperDash.Essentials.Core
|
||||
/// </summary>
|
||||
/// <param name="fileName"></param>
|
||||
/// <returns></returns>
|
||||
public static FileInfo[] GetFiles(string fileName)
|
||||
{
|
||||
DirectoryInfo dirInfo = new DirectoryInfo(Path.GetDirectoryName(fileName));
|
||||
var files = dirInfo.GetFiles(Path.GetFileName(fileName));
|
||||
Debug.Console(0, "FileIO found: {0}, {1}", files.Count(), fileName);
|
||||
if (files.Count() > 0)
|
||||
{
|
||||
return files;
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
public static FileInfo[] GetFiles(string fileName)
|
||||
{
|
||||
string fullFilePath = Global.FilePathPrefix + fileName;
|
||||
DirectoryInfo dirInfo = new DirectoryInfo(Path.GetDirectoryName(fullFilePath));
|
||||
var files = dirInfo.GetFiles(Path.GetFileName(fullFilePath));
|
||||
Debug.Console(0, "FileIO found: {0}, {1}", files.Count(), fullFilePath);
|
||||
if (files.Count() > 0)
|
||||
{
|
||||
return files;
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static FileInfo GetFile(string fileName)
|
||||
{
|
||||
DirectoryInfo dirInfo = new DirectoryInfo(Path.GetDirectoryName(fileName));
|
||||
var files = dirInfo.GetFiles(Path.GetFileName(fileName));
|
||||
Debug.Console(0, "FileIO found: {0}, {1}", files.Count(), fileName);
|
||||
if (files.Count() > 0)
|
||||
{
|
||||
return files.FirstOrDefault();
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
public static FileInfo GetFile(string fileName)
|
||||
{
|
||||
string fullFilePath = Global.FilePathPrefix + fileName;
|
||||
DirectoryInfo dirInfo = new DirectoryInfo(Path.GetDirectoryName(fullFilePath));
|
||||
var files = dirInfo.GetFiles(Path.GetFileName(fullFilePath));
|
||||
Debug.Console(0, "FileIO found: {0}, {1}", files.Count(), fullFilePath);
|
||||
if (files.Count() > 0)
|
||||
{
|
||||
return files.FirstOrDefault();
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
@@ -81,7 +83,7 @@ namespace PepperDash.Essentials.Core
|
||||
{
|
||||
if (fileLock.TryEnter())
|
||||
{
|
||||
DirectoryInfo dirInfo = new DirectoryInfo(file.Name);
|
||||
DirectoryInfo dirInfo = new DirectoryInfo(file.DirectoryName);
|
||||
Debug.Console(2, "FileIO Getting Data {0}", file.FullName);
|
||||
|
||||
if (File.Exists(file.FullName))
|
||||
@@ -202,7 +204,7 @@ namespace PepperDash.Essentials.Core
|
||||
public static void WriteDataToFile(string data, string filePath)
|
||||
{
|
||||
Thread _WriteFileThread;
|
||||
_WriteFileThread = new Thread((O) => _WriteFileMethod(data, filePath), null, Thread.eThreadStartOptions.CreateSuspended);
|
||||
_WriteFileThread = new Thread((O) => _WriteFileMethod(data, Global.FilePathPrefix + "/" + filePath), null, Thread.eThreadStartOptions.CreateSuspended);
|
||||
_WriteFileThread.Priority = Thread.eThreadPriority.LowestPriority;
|
||||
_WriteFileThread.Start();
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "New WriteFile Thread");
|
||||
@@ -217,7 +219,8 @@ namespace PepperDash.Essentials.Core
|
||||
{
|
||||
if (fileLock.TryEnter())
|
||||
{
|
||||
using (StreamWriter sw = new StreamWriter(filePath))
|
||||
|
||||
using (StreamWriter sw = new StreamWriter(filePath))
|
||||
{
|
||||
sw.Write(data);
|
||||
sw.Flush();
|
||||
|
||||
@@ -94,7 +94,7 @@
|
||||
</Reference>
|
||||
<Reference Include="SimplSharpCWSHelperInterface, Version=2.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpCWSHelperInterface.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpCWSHelperInterface.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="SimplSharpHelperInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
@@ -200,6 +200,7 @@
|
||||
<Compile Include="Crestron IO\Relay\GenericRelayDevice.cs" />
|
||||
<Compile Include="Crestron IO\Relay\ISwitchedOutput.cs" />
|
||||
<Compile Include="Crestron IO\StatusSign\StatusSignController.cs" />
|
||||
<Compile Include="Devices\PowerInterfaces.cs" />
|
||||
<Compile Include="Web\RequestHandlers\AppDebugRequestHandler.cs" />
|
||||
<Compile Include="Web\RequestHandlers\GetFeedbacksForDeviceRequestHandler.cs" />
|
||||
<Compile Include="Web\EssentialsWebApiHelpers.cs" />
|
||||
|
||||
@@ -195,13 +195,12 @@ namespace PepperDash.Essentials
|
||||
public static void ReportAssemblyVersions(string command)
|
||||
{
|
||||
|
||||
CrestronConsole.ConsoleCommandResponse("Loaded Assemblies:");
|
||||
CrestronConsole.ConsoleCommandResponse("Loaded Assemblies:" + CrestronEnvironment.NewLine);
|
||||
foreach (var assembly in LoadedAssemblies)
|
||||
{
|
||||
CrestronConsole.ConsoleCommandResponse("{0} Version: {1}", assembly.Name, assembly.Version);
|
||||
CrestronConsole.ConsoleCommandResponse("{0} Version: {1}" + CrestronEnvironment.NewLine, assembly.Name, assembly.Version);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Moves any .dll assemblies not already loaded from the plugins folder to loadedPlugins folder
|
||||
/// </summary>
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace PepperDash.Essentials.DM.AirMedia
|
||||
[Description("Wrapper class for an AM-200 or AM-300")]
|
||||
public class AirMediaController : CrestronGenericBridgeableBaseDevice, IRoutingNumericWithFeedback, IIROutputPorts, IComPorts
|
||||
{
|
||||
public AmX00 AirMedia { get; private set; }
|
||||
public Am3x00 AirMedia { get; private set; }
|
||||
|
||||
public DeviceConfig DeviceConfig { get; private set; }
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace PepperDash.Essentials.DM.AirMedia
|
||||
public StringFeedback SerialNumberFeedback { get; private set; }
|
||||
public BoolFeedback AutomaticInputRoutingEnabledFeedback { get; private set; }
|
||||
|
||||
public AirMediaController(string key, string name, AmX00 device, DeviceConfig dc, AirMediaPropertiesConfig props)
|
||||
public AirMediaController(string key, string name, Am3x00 device, DeviceConfig dc, AirMediaPropertiesConfig props)
|
||||
: base(key, name, device)
|
||||
{
|
||||
|
||||
@@ -95,24 +95,31 @@ namespace PepperDash.Essentials.DM.AirMedia
|
||||
|
||||
AirMedia.AirMedia.AirMediaChange += new Crestron.SimplSharpPro.DeviceSupport.GenericEventHandler(AirMedia_AirMediaChange);
|
||||
|
||||
IsInSessionFeedback = new BoolFeedback(new Func<bool>(() => AirMedia.AirMedia.StatusFeedback.UShortValue == 0));
|
||||
ErrorFeedback = new IntFeedback(new Func<int>(() => AirMedia.AirMedia.ErrorFeedback.UShortValue));
|
||||
NumberOfUsersConnectedFeedback = new IntFeedback(new Func<int>(() => AirMedia.AirMedia.NumberOfUsersConnectedFeedback.UShortValue));
|
||||
LoginCodeFeedback = new IntFeedback(new Func<int>(() => AirMedia.AirMedia.LoginCodeFeedback.UShortValue));
|
||||
ConnectionAddressFeedback = new StringFeedback(new Func<string>(() => AirMedia.AirMedia.ConnectionAddressFeedback.StringValue));
|
||||
HostnameFeedback = new StringFeedback(new Func<string>(() => AirMedia.AirMedia.HostNameFeedback.StringValue));
|
||||
IsInSessionFeedback = new BoolFeedback(() => AirMedia.AirMedia.StatusFeedback.UShortValue == 0);
|
||||
ErrorFeedback = new IntFeedback(() => AirMedia.AirMedia.ErrorFeedback.UShortValue);
|
||||
NumberOfUsersConnectedFeedback = new IntFeedback(() => AirMedia.AirMedia.NumberOfUsersConnectedFeedback.UShortValue);
|
||||
LoginCodeFeedback = new IntFeedback(() => AirMedia.AirMedia.LoginCodeFeedback.UShortValue);
|
||||
ConnectionAddressFeedback = new StringFeedback(() => AirMedia.AirMedia.ConnectionAddressFeedback.StringValue);
|
||||
HostnameFeedback = new StringFeedback(() => AirMedia.AirMedia.HostNameFeedback.StringValue);
|
||||
|
||||
// TODO: Figure out if we can actually get the TSID/Serial
|
||||
SerialNumberFeedback = new StringFeedback(new Func<string>(() => "unknown"));
|
||||
SerialNumberFeedback = new StringFeedback(() => "unknown");
|
||||
|
||||
AirMedia.DisplayControl.DisplayControlChange += new Crestron.SimplSharpPro.DeviceSupport.GenericEventHandler(DisplayControl_DisplayControlChange);
|
||||
AirMedia.DisplayControl.DisplayControlChange += DisplayControl_DisplayControlChange;
|
||||
|
||||
VideoOutFeedback = new IntFeedback(new Func<int>(() => Convert.ToInt16(AirMedia.DisplayControl.VideoOutFeedback)));
|
||||
AutomaticInputRoutingEnabledFeedback = new BoolFeedback(new Func<bool>(() => AirMedia.DisplayControl.EnableAutomaticRoutingFeedback.BoolValue));
|
||||
VideoOutFeedback = new IntFeedback(() => Convert.ToInt16(AirMedia.DisplayControl.VideoOutFeedback));
|
||||
AutomaticInputRoutingEnabledFeedback = new BoolFeedback(() => AirMedia.DisplayControl.EnableAutomaticRoutingFeedback.BoolValue);
|
||||
|
||||
AirMedia.HdmiIn.StreamChange += new Crestron.SimplSharpPro.DeviceSupport.StreamEventHandler(HdmiIn_StreamChange);
|
||||
// Not all AirMedia versions support HDMI In like the 3200
|
||||
if (AirMedia.HdmiIn != null)
|
||||
{
|
||||
AirMedia.HdmiIn.StreamChange += HdmiIn_StreamChange;
|
||||
HdmiVideoSyncDetectedFeedback = new BoolFeedback(() => AirMedia.HdmiIn.SyncDetectedFeedback.BoolValue);
|
||||
return;
|
||||
}
|
||||
|
||||
HdmiVideoSyncDetectedFeedback = new BoolFeedback(new Func<bool>(() => AirMedia.HdmiIn.SyncDetectedFeedback.BoolValue));
|
||||
// Return false if the AirMedia device doesn't support HDMI Input
|
||||
HdmiVideoSyncDetectedFeedback = new BoolFeedback(() => false);
|
||||
}
|
||||
|
||||
public override bool CustomActivate()
|
||||
@@ -122,7 +129,7 @@ namespace PepperDash.Essentials.DM.AirMedia
|
||||
else
|
||||
AirMedia.DisplayControl.DisableAutomaticRouting();
|
||||
|
||||
return base.CustomActivate();
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||
@@ -179,31 +186,53 @@ namespace PepperDash.Essentials.DM.AirMedia
|
||||
/// <param name="e">Arguments defined as IKeyName sender, output, input, and eRoutingSignalType</param>
|
||||
private void OnSwitchChange(RoutingNumericEventArgs e)
|
||||
{
|
||||
var newEvent = NumericSwitchChange;
|
||||
if (newEvent != null) newEvent(this, e);
|
||||
}
|
||||
var handler = NumericSwitchChange;
|
||||
|
||||
if (handler == null) return;
|
||||
|
||||
handler(this, e);
|
||||
}
|
||||
|
||||
|
||||
void AirMedia_AirMediaChange(object sender, Crestron.SimplSharpPro.DeviceSupport.GenericEventArgs args)
|
||||
{
|
||||
if (args.EventId == AirMediaInputSlot.AirMediaStatusFeedbackEventId)
|
||||
IsInSessionFeedback.FireUpdate();
|
||||
else if (args.EventId == AirMediaInputSlot.AirMediaErrorFeedbackEventId)
|
||||
ErrorFeedback.FireUpdate();
|
||||
else if (args.EventId == AirMediaInputSlot.AirMediaNumberOfUserConnectedEventId)
|
||||
NumberOfUsersConnectedFeedback.FireUpdate();
|
||||
else if (args.EventId == AirMediaInputSlot.AirMediaLoginCodeEventId)
|
||||
LoginCodeFeedback.FireUpdate();
|
||||
else if (args.EventId == AirMediaInputSlot.AirMediaConnectionAddressFeedbackEventId)
|
||||
ConnectionAddressFeedback.FireUpdate();
|
||||
else if (args.EventId == AirMediaInputSlot.AirMediaHostNameFeedbackEventId)
|
||||
HostnameFeedback.FireUpdate();
|
||||
switch (args.EventId)
|
||||
{
|
||||
case AirMediaInputSlot.AirMediaStatusFeedbackEventId:
|
||||
{
|
||||
IsInSessionFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
case AirMediaInputSlot.AirMediaErrorFeedbackEventId:
|
||||
{
|
||||
ErrorFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
case AirMediaInputSlot.AirMediaNumberOfUserConnectedEventId:
|
||||
{
|
||||
NumberOfUsersConnectedFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
case AirMediaInputSlot.AirMediaLoginCodeEventId:
|
||||
{
|
||||
LoginCodeFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
case AirMediaInputSlot.AirMediaConnectionAddressFeedbackEventId:
|
||||
{
|
||||
ConnectionAddressFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
case AirMediaInputSlot.AirMediaHostNameFeedbackEventId:
|
||||
{
|
||||
HostnameFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DisplayControl_DisplayControlChange(object sender, Crestron.SimplSharpPro.DeviceSupport.GenericEventArgs args)
|
||||
{
|
||||
if (args.EventId == AmX00.VideoOutFeedbackEventId)
|
||||
{
|
||||
VideoOutFeedback.FireUpdate();
|
||||
|
||||
var localInputPort =
|
||||
@@ -211,8 +240,7 @@ namespace PepperDash.Essentials.DM.AirMedia
|
||||
|
||||
OnSwitchChange(new RoutingNumericEventArgs(1, VideoOutFeedback.UShortValue, OutputPorts.First(),
|
||||
localInputPort, eRoutingSignalType.AudioVideo));
|
||||
}
|
||||
else if (args.EventId == AmX00.EnableAutomaticRoutingFeedbackEventId)
|
||||
|
||||
AutomaticInputRoutingEnabledFeedback.FireUpdate();
|
||||
}
|
||||
|
||||
@@ -342,7 +370,7 @@ namespace PepperDash.Essentials.DM.AirMedia
|
||||
{
|
||||
public AirMediaControllerFactory()
|
||||
{
|
||||
TypeNames = new List<string>() { "am200", "am300" };
|
||||
TypeNames = new List<string>() { "am200", "am300", "am3200" };
|
||||
}
|
||||
|
||||
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||
@@ -351,12 +379,26 @@ namespace PepperDash.Essentials.DM.AirMedia
|
||||
|
||||
Debug.Console(1, "Factory Attempting to create new AirMedia Device");
|
||||
|
||||
var props = JsonConvert.DeserializeObject<AirMediaPropertiesConfig>(dc.Properties.ToString());
|
||||
AmX00 amDevice = null;
|
||||
if (type == "am200")
|
||||
amDevice = new Crestron.SimplSharpPro.DM.AirMedia.Am200(props.Control.IpIdInt, Global.ControlSystem);
|
||||
else if (type == "am300")
|
||||
amDevice = new Crestron.SimplSharpPro.DM.AirMedia.Am300(props.Control.IpIdInt, Global.ControlSystem);
|
||||
var props = dc.Properties.ToObject<AirMediaPropertiesConfig>();
|
||||
Am3x00 amDevice = null;
|
||||
switch (type)
|
||||
{
|
||||
case "am200" :
|
||||
{
|
||||
amDevice = new Am200(props.Control.IpIdInt, Global.ControlSystem);
|
||||
break;
|
||||
}
|
||||
case "am300" :
|
||||
{
|
||||
amDevice = new Am300(props.Control.IpIdInt, Global.ControlSystem);
|
||||
break;
|
||||
}
|
||||
case "am3200" :
|
||||
{
|
||||
amDevice = new Am3200(props.Control.IpIdInt, Global.ControlSystem);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return new AirMediaController(dc.Key, dc.Name, amDevice, dc, props);
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace PepperDash.Essentials.DM
|
||||
/// Builds a controller for basic DM-RMCs with Com and IR ports and no control functions
|
||||
///
|
||||
/// </summary>
|
||||
public class DmBladeChassisController : CrestronGenericBridgeableBaseDevice, IDmSwitch, IRoutingNumericWithFeedback
|
||||
public class DmBladeChassisController : CrestronGenericBridgeableBaseDevice, IDmSwitchWithEndpointOnlineFeedback, IRoutingNumericWithFeedback
|
||||
{
|
||||
private const string NonePortKey = "inputCard0--None";
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace PepperDash.Essentials.DM
|
||||
///
|
||||
/// </summary>
|
||||
[Description("Wrapper class for all DM-MD chassis variants from 8x8 to 32x32")]
|
||||
public class DmChassisController : CrestronGenericBridgeableBaseDevice, IDmSwitch, IRoutingNumericWithFeedback
|
||||
public class DmChassisController : CrestronGenericBridgeableBaseDevice, IDmSwitchWithEndpointOnlineFeedback, IRoutingNumericWithFeedback
|
||||
{
|
||||
private const string NonePortKey = "inputCard0--None";
|
||||
public DMChassisPropertiesConfig PropertiesConfig { get; set; }
|
||||
|
||||
@@ -17,11 +17,12 @@ using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using PepperDash.Essentials.Core.DeviceInfo;
|
||||
using PepperDash.Essentials.Core.Bridges;
|
||||
|
||||
namespace PepperDash.Essentials.DM.Endpoints.DGEs
|
||||
{
|
||||
[Description("Wrapper class for DGE-100")]
|
||||
public class Dge100Controller : CrestronGenericBaseDevice, IComPorts, IIROutputPorts, IHasBasicTriListWithSmartObject, ICec, IDeviceInfoProvider
|
||||
public class Dge100Controller : CrestronGenericBaseDevice, IComPorts, IIROutputPorts, IHasBasicTriListWithSmartObject, ICec, IDeviceInfoProvider, IBridgeAdvanced
|
||||
{
|
||||
private const int CtpPort = 41795;
|
||||
private readonly Dge100 _dge;
|
||||
@@ -30,9 +31,12 @@ namespace PepperDash.Essentials.DM.Endpoints.DGEs
|
||||
|
||||
public BasicTriListWithSmartObject Panel { get { return _dge; } }
|
||||
|
||||
private DeviceConfig _dc;
|
||||
private DeviceConfig _dc;
|
||||
|
||||
public VideoStatusOutputs VideoStatusFeedbacks { get; private set; }
|
||||
|
||||
CrestronTouchpanelPropertiesConfig PropertiesConfig;
|
||||
|
||||
CrestronTouchpanelPropertiesConfig PropertiesConfig;
|
||||
|
||||
public Dge100Controller(string key, string name, Dge100 device, DeviceConfig dc, CrestronTouchpanelPropertiesConfig props)
|
||||
:base(key, name, device)
|
||||
@@ -48,8 +52,20 @@ namespace PepperDash.Essentials.DM.Endpoints.DGEs
|
||||
|
||||
_dc = dc;
|
||||
|
||||
PropertiesConfig = props;
|
||||
}
|
||||
PropertiesConfig = props;
|
||||
|
||||
var videoStatusFuncs = new VideoStatusFuncsWrapper
|
||||
{
|
||||
HdcpActiveFeedbackFunc = () => _dge.HdmiIn.HdcpSupportOnFeedback.BoolValue,
|
||||
VideoResolutionFeedbackFunc = () => _dge.HdmiIn.VideoAttributes.GetVideoResolutionString(),
|
||||
VideoSyncFeedbackFunc = () => _dge.HdmiIn.SyncDetectedFeedback.BoolValue,
|
||||
};
|
||||
|
||||
VideoStatusFeedbacks = new VideoStatusOutputs(videoStatusFuncs);
|
||||
|
||||
_dge.HdmiIn.StreamChange += (s,a) => VideoStatusFeedbacks.FireAll();
|
||||
_dge.HdmiIn.VideoAttributes.AttributeChange += (o, a) => VideoStatusFeedbacks.FireAll();
|
||||
}
|
||||
|
||||
#region IComPorts Members
|
||||
|
||||
@@ -187,6 +203,63 @@ namespace PepperDash.Essentials.DM.Endpoints.DGEs
|
||||
handler(this, new DeviceInfoEventArgs(DeviceInfo));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IBridgeAdvanced Members
|
||||
|
||||
public void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||
{
|
||||
var joinMap = new DgeJoinMap(joinStart);
|
||||
|
||||
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
|
||||
|
||||
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||
joinMap = JsonConvert.DeserializeObject<DgeJoinMap>(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, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||
|
||||
//Presses
|
||||
trilist.SetSigTrueAction(joinMap.HdmiInHdcpOn.JoinNumber, () => _dge.HdmiIn.HdcpSupportOn());
|
||||
trilist.SetSigTrueAction(joinMap.HdmiInHdcpOff.JoinNumber,() => _dge.HdmiIn.HdcpSupportOff());
|
||||
trilist.SetSigTrueAction(joinMap.HdmiInHdcpToggle.JoinNumber, () => {
|
||||
if(_dge.HdmiIn.HdcpSupportOnFeedback.BoolValue)
|
||||
{
|
||||
_dge.HdmiIn.HdcpSupportOff();
|
||||
return;
|
||||
}
|
||||
|
||||
_dge.HdmiIn.HdcpSupportOn();
|
||||
});
|
||||
|
||||
|
||||
// Feedbacks
|
||||
VideoStatusFeedbacks.HdcpActiveFeedback.LinkInputSig(trilist.BooleanInput[joinMap.HdmiInHdcpOn.JoinNumber]);
|
||||
VideoStatusFeedbacks.HdcpActiveFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.HdmiInHdcpOff.JoinNumber]);
|
||||
|
||||
VideoStatusFeedbacks.VideoResolutionFeedback.LinkInputSig(trilist.StringInput[joinMap.CurrentInputResolution.JoinNumber]);
|
||||
VideoStatusFeedbacks.VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.SyncDetected.JoinNumber]);
|
||||
|
||||
IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]);
|
||||
|
||||
trilist.OnlineStatusChange += (o, a) =>
|
||||
{
|
||||
if (!a.DeviceOnLine) return;
|
||||
|
||||
VideoStatusFeedbacks.FireAll();
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.DM.Endpoints.DGEs
|
||||
{
|
||||
public class DgeJoinMap : JoinMapBaseAdvanced
|
||||
{
|
||||
[JoinName("IsOnline")]
|
||||
public JoinDataComplete IsOnline = new JoinDataComplete(new JoinData { JoinNumber = 1, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "DGE Online", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||
|
||||
[JoinName("CurrentInputResolution")]
|
||||
public JoinDataComplete CurrentInputResolution = new JoinDataComplete(new JoinData { JoinNumber = 1, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "DGE Current Input Resolution", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
|
||||
|
||||
[JoinName("SyncDetected")]
|
||||
public JoinDataComplete SyncDetected = new JoinDataComplete(new JoinData { JoinNumber = 2, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "DGE Sync Detected", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||
|
||||
[JoinName("HdmiHdcpOn")]
|
||||
public JoinDataComplete HdmiInHdcpOn = new JoinDataComplete(new JoinData { JoinNumber = 3, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "DGE HDMI HDCP State On", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
|
||||
|
||||
[JoinName("HdmiHdcpOff")]
|
||||
public JoinDataComplete HdmiInHdcpOff = new JoinDataComplete(new JoinData { JoinNumber = 4, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "DGE HDMI HDCP State Off", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
|
||||
|
||||
[JoinName("HdmiHdcpToggle")]
|
||||
public JoinDataComplete HdmiInHdcpToggle = new JoinDataComplete(new JoinData { JoinNumber = 5, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "DGE HDMI HDCP State Toggle", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
|
||||
|
||||
public DgeJoinMap(uint joinStart)
|
||||
: this(joinStart, typeof(DgeJoinMap))
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor to use when extending this Join map
|
||||
/// </summary>
|
||||
/// <param name="joinStart">Join this join map will start at</param>
|
||||
/// <param name="type">Type of the child join map</param>
|
||||
protected DgeJoinMap(uint joinStart, Type type) : base(joinStart, type)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -58,37 +58,37 @@ namespace PepperDash.Essentials.DM.Endpoints.DGEs
|
||||
HdmiOut.Port = _dge.HdmiOut; ;
|
||||
|
||||
}
|
||||
|
||||
public class DmDge200CControllerFactory : EssentialsDeviceFactory<DmDge200CController>
|
||||
{
|
||||
public DmDge200CControllerFactory()
|
||||
{
|
||||
TypeNames = new List<string>() { "dmdge200c" };
|
||||
}
|
||||
|
||||
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||
{
|
||||
var typeName = dc.Type.ToLower();
|
||||
var comm = CommFactory.GetControlPropertiesConfig(dc);
|
||||
var props = JsonConvert.DeserializeObject<CrestronTouchpanelPropertiesConfig>(dc.Properties.ToString());
|
||||
|
||||
Debug.Console(1, "Factory Attempting to create new DgeController Device");
|
||||
|
||||
DmDge200C dgeDevice = null;
|
||||
|
||||
if (typeName == "dmdge200c")
|
||||
dgeDevice = new DmDge200C(comm.IpIdInt, Global.ControlSystem);
|
||||
|
||||
if (dgeDevice == null)
|
||||
{
|
||||
Debug.Console(1, "Unable to create DGE device");
|
||||
return null;
|
||||
}
|
||||
|
||||
var dgeController = new DmDge200CController(dc.Key , dc.Name, dgeDevice, dc, props);
|
||||
|
||||
return dgeController;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class DmDge200CControllerFactory : EssentialsDeviceFactory<DmDge200CController>
|
||||
{
|
||||
public DmDge200CControllerFactory()
|
||||
{
|
||||
TypeNames = new List<string>() { "dmdge200c" };
|
||||
}
|
||||
|
||||
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||
{
|
||||
var typeName = dc.Type.ToLower();
|
||||
var comm = CommFactory.GetControlPropertiesConfig(dc);
|
||||
var props = JsonConvert.DeserializeObject<CrestronTouchpanelPropertiesConfig>(dc.Properties.ToString());
|
||||
|
||||
Debug.Console(1, "Factory Attempting to create new DgeController Device");
|
||||
|
||||
DmDge200C dgeDevice = null;
|
||||
|
||||
if (typeName == "dmdge200c")
|
||||
dgeDevice = new DmDge200C(comm.IpIdInt, Global.ControlSystem);
|
||||
|
||||
if (dgeDevice == null)
|
||||
{
|
||||
Debug.Console(1, "Unable to create DGE device");
|
||||
return null;
|
||||
}
|
||||
|
||||
var dgeController = new DmDge200CController(dc.Key, dc.Name, dgeDevice, dc, props);
|
||||
|
||||
return dgeController;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro.DM;
|
||||
using Crestron.SimplSharpPro.DM.Endpoints;
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash_Essentials_DM
|
||||
{
|
||||
public interface IHasDmInHdcpSet
|
||||
{
|
||||
void SetDmInHdcpState(eHdcpCapabilityType hdcpState);
|
||||
}
|
||||
|
||||
public interface IHasDmInHdcpGet
|
||||
{
|
||||
IntFeedback DmInHdcpStateFeedback { get; }
|
||||
}
|
||||
|
||||
public interface IHasDmInHdcp : IHasDmInHdcpGet, IHasDmInHdcpSet
|
||||
{
|
||||
eHdcpCapabilityType DmInHdcpCapability { get; }
|
||||
}
|
||||
|
||||
|
||||
public interface IHasHdmiInHdcpSet
|
||||
{
|
||||
void SetHdmiInHdcpState(eHdcpCapabilityType hdcpState);
|
||||
}
|
||||
|
||||
public interface IHasHdmiInHdcpGet
|
||||
{
|
||||
IntFeedback HdmiInHdcpStateFeedback { get; }
|
||||
}
|
||||
|
||||
public interface IHasHdmiInHdcp : IHasHdmiInHdcpGet, IHasHdmiInHdcpSet
|
||||
{
|
||||
eHdcpCapabilityType HdmiInHdcpCapability { get; }
|
||||
}
|
||||
|
||||
|
||||
public interface IHasHdmiIn1HdcpSet
|
||||
{
|
||||
void SetHdmiIn1HdcpState(eHdcpCapabilityType hdcpState);
|
||||
}
|
||||
|
||||
public interface IHasHdmiIn1HdcpGet
|
||||
{
|
||||
IntFeedback HdmiIn1HdcpStateFeedback { get; }
|
||||
}
|
||||
|
||||
public interface IHasHdmiIn1Hdcp : IHasHdmiIn1HdcpGet, IHasHdmiIn1HdcpSet
|
||||
{
|
||||
eHdcpCapabilityType HdmiIn1HdcpCapability { get; }
|
||||
}
|
||||
|
||||
|
||||
public interface IHasHdmiIn2HdcpSet
|
||||
{
|
||||
void SetHdmiIn2HdcpState(eHdcpCapabilityType hdcpState);
|
||||
}
|
||||
|
||||
public interface IHasHdmiIn2HdcpGet
|
||||
{
|
||||
IntFeedback HdmiInIn2HdcpStateFeedback { get; }
|
||||
}
|
||||
|
||||
public interface IHasHdmi2InHdcp : IHasHdmiIn2HdcpGet, IHasHdmiIn2HdcpSet
|
||||
{
|
||||
eHdcpCapabilityType Hdmi2InHdcpCapability { get; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
public interface IHasDisplayPortInHdcpGet
|
||||
{
|
||||
IntFeedback DisplayPortInHdcpStateFeedback { get; }
|
||||
}
|
||||
|
||||
public interface IHasDisplayPortInHdcpSet
|
||||
{
|
||||
void SetDisplayPortInHdcpState(eHdcpCapabilityType hdcpState);
|
||||
}
|
||||
|
||||
public interface IHasDisplayPortInHdcp : IHasDisplayPortInHdcpGet, IHasDisplayPortInHdcpSet
|
||||
{
|
||||
eHdcpCapabilityType DisplayPortInHdcpCapability { get; }
|
||||
}
|
||||
}
|
||||
@@ -28,6 +28,8 @@ namespace PepperDash.Essentials.DM
|
||||
|
||||
InputPorts = new RoutingPortCollection<RoutingInputPort> {DmIn};
|
||||
OutputPorts = new RoutingPortCollection<RoutingOutputPort> {HDBaseTSink};
|
||||
PreventRegistration = true;
|
||||
rmc.Register();
|
||||
}
|
||||
|
||||
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||
|
||||
@@ -1,99 +1,99 @@
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Crestron.SimplSharpPro.DM;
|
||||
using Crestron.SimplSharpPro.DM.Endpoints.Receivers;
|
||||
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Bridges;
|
||||
|
||||
namespace PepperDash.Essentials.DM
|
||||
{
|
||||
/// <summary>
|
||||
/// Builds a controller for basic DM-RMCs with Com and IR ports and no control functions
|
||||
///
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Crestron.SimplSharpPro.DM;
|
||||
using Crestron.SimplSharpPro.DM.Endpoints.Receivers;
|
||||
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Bridges;
|
||||
|
||||
namespace PepperDash.Essentials.DM
|
||||
{
|
||||
/// <summary>
|
||||
/// Builds a controller for basic DM-RMCs with Com and IR ports and no control functions
|
||||
///
|
||||
/// </summary>
|
||||
[Description("Wrapper Class for DM-RMC-150-S")]
|
||||
public class DmRmc150SController : DmRmcControllerBase, IRoutingInputsOutputs,
|
||||
IIROutputPorts, IComPorts, ICec
|
||||
{
|
||||
private readonly DmRmc150S _rmc;
|
||||
|
||||
public RoutingInputPort DmIn { get; private set; }
|
||||
public RoutingOutputPort HdmiOut { get; private set; }
|
||||
|
||||
public RoutingPortCollection<RoutingInputPort> InputPorts
|
||||
{
|
||||
get; private set;
|
||||
}
|
||||
|
||||
public RoutingPortCollection<RoutingOutputPort> OutputPorts
|
||||
{
|
||||
get;
|
||||
private set ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Make a Crestron RMC and put it in here
|
||||
/// </summary>
|
||||
public DmRmc150SController(string key, string name, DmRmc150S rmc)
|
||||
: base(key, name, rmc)
|
||||
{
|
||||
_rmc = rmc;
|
||||
DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo,
|
||||
eRoutingPortConnectionType.DmCat, 0, this);
|
||||
HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
|
||||
eRoutingPortConnectionType.Hdmi, null, this);
|
||||
|
||||
EdidManufacturerFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Manufacturer.StringValue);
|
||||
EdidNameFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Name.StringValue);
|
||||
EdidPreferredTimingFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.PreferredTiming.StringValue);
|
||||
EdidSerialNumberFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.SerialNumber.StringValue);
|
||||
|
||||
InputPorts = new RoutingPortCollection<RoutingInputPort> {DmIn};
|
||||
OutputPorts = new RoutingPortCollection<RoutingOutputPort> {HdmiOut};
|
||||
|
||||
_rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange;
|
||||
|
||||
// Set Ports for CEC
|
||||
HdmiOut.Port = _rmc.HdmiOutput;
|
||||
}
|
||||
|
||||
void ConnectedDevice_DeviceInformationChange(ConnectedDeviceInformation connectedDevice, ConnectedDeviceEventArgs args)
|
||||
{
|
||||
switch (args.EventId)
|
||||
{
|
||||
case ConnectedDeviceEventIds.ManufacturerEventId:
|
||||
EdidManufacturerFeedback.FireUpdate();
|
||||
break;
|
||||
case ConnectedDeviceEventIds.NameEventId:
|
||||
EdidNameFeedback.FireUpdate();
|
||||
break;
|
||||
case ConnectedDeviceEventIds.PreferredTimingEventId:
|
||||
EdidPreferredTimingFeedback.FireUpdate();
|
||||
break;
|
||||
case ConnectedDeviceEventIds.SerialNumberEventId:
|
||||
EdidSerialNumberFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||
{
|
||||
LinkDmRmcToApi(this, trilist, joinStart, joinMapKey, bridge);
|
||||
}
|
||||
|
||||
#region IIROutputPorts Members
|
||||
public CrestronCollection<IROutputPort> IROutputPorts { get { return _rmc.IROutputPorts; } }
|
||||
public int NumberOfIROutputPorts { get { return _rmc.NumberOfIROutputPorts; } }
|
||||
#endregion
|
||||
|
||||
#region IComPorts Members
|
||||
public CrestronCollection<ComPort> ComPorts { get { return _rmc.ComPorts; } }
|
||||
public int NumberOfComPorts { get { return _rmc.NumberOfComPorts; } }
|
||||
#endregion
|
||||
|
||||
#region ICec Members
|
||||
public Cec StreamCec { get { return _rmc.HdmiOutput.StreamCec; } }
|
||||
#endregion
|
||||
}
|
||||
[Description("Wrapper Class for DM-RMC-150-S")]
|
||||
public class DmRmc150SController : DmRmcControllerBase, IRoutingInputsOutputs,
|
||||
IIROutputPorts, IComPorts, ICec
|
||||
{
|
||||
private readonly DmRmc150S _rmc;
|
||||
|
||||
public RoutingInputPort DmIn { get; private set; }
|
||||
public RoutingOutputPort HdmiOut { get; private set; }
|
||||
|
||||
public RoutingPortCollection<RoutingInputPort> InputPorts
|
||||
{
|
||||
get; private set;
|
||||
}
|
||||
|
||||
public RoutingPortCollection<RoutingOutputPort> OutputPorts
|
||||
{
|
||||
get;
|
||||
private set ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Make a Crestron RMC and put it in here
|
||||
/// </summary>
|
||||
public DmRmc150SController(string key, string name, DmRmc150S rmc)
|
||||
: base(key, name, rmc)
|
||||
{
|
||||
_rmc = rmc;
|
||||
DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo,
|
||||
eRoutingPortConnectionType.DmCat, 0, this);
|
||||
HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
|
||||
eRoutingPortConnectionType.Hdmi, null, this);
|
||||
|
||||
EdidManufacturerFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Manufacturer.StringValue);
|
||||
EdidNameFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Name.StringValue);
|
||||
EdidPreferredTimingFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.PreferredTiming.StringValue);
|
||||
EdidSerialNumberFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.SerialNumber.StringValue);
|
||||
|
||||
InputPorts = new RoutingPortCollection<RoutingInputPort> {DmIn};
|
||||
OutputPorts = new RoutingPortCollection<RoutingOutputPort> {HdmiOut};
|
||||
|
||||
_rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange;
|
||||
|
||||
// Set Ports for CEC
|
||||
HdmiOut.Port = _rmc.HdmiOutput;
|
||||
}
|
||||
|
||||
void ConnectedDevice_DeviceInformationChange(ConnectedDeviceInformation connectedDevice, ConnectedDeviceEventArgs args)
|
||||
{
|
||||
switch (args.EventId)
|
||||
{
|
||||
case ConnectedDeviceEventIds.ManufacturerEventId:
|
||||
EdidManufacturerFeedback.FireUpdate();
|
||||
break;
|
||||
case ConnectedDeviceEventIds.NameEventId:
|
||||
EdidNameFeedback.FireUpdate();
|
||||
break;
|
||||
case ConnectedDeviceEventIds.PreferredTimingEventId:
|
||||
EdidPreferredTimingFeedback.FireUpdate();
|
||||
break;
|
||||
case ConnectedDeviceEventIds.SerialNumberEventId:
|
||||
EdidSerialNumberFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||
{
|
||||
LinkDmRmcToApi(this, trilist, joinStart, joinMapKey, bridge);
|
||||
}
|
||||
|
||||
#region IIROutputPorts Members
|
||||
public CrestronCollection<IROutputPort> IROutputPorts { get { return _rmc.IROutputPorts; } }
|
||||
public int NumberOfIROutputPorts { get { return _rmc.NumberOfIROutputPorts; } }
|
||||
#endregion
|
||||
|
||||
#region IComPorts Members
|
||||
public CrestronCollection<ComPort> ComPorts { get { return _rmc.ComPorts; } }
|
||||
public int NumberOfComPorts { get { return _rmc.NumberOfComPorts; } }
|
||||
#endregion
|
||||
|
||||
#region ICec Members
|
||||
public Cec StreamCec { get { return _rmc.HdmiOutput.StreamCec; } }
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,111 +1,111 @@
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Crestron.SimplSharpPro.DM;
|
||||
using Crestron.SimplSharpPro.DM.Endpoints;
|
||||
using Crestron.SimplSharpPro.DM.Endpoints.Receivers;
|
||||
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Bridges;
|
||||
|
||||
namespace PepperDash.Essentials.DM
|
||||
{
|
||||
/// <summary>
|
||||
/// Builds a controller for basic DM-RMCs with Com and IR ports and no control functions
|
||||
///
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Crestron.SimplSharpPro.DM;
|
||||
using Crestron.SimplSharpPro.DM.Endpoints;
|
||||
using Crestron.SimplSharpPro.DM.Endpoints.Receivers;
|
||||
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Bridges;
|
||||
|
||||
namespace PepperDash.Essentials.DM
|
||||
{
|
||||
/// <summary>
|
||||
/// Builds a controller for basic DM-RMCs with Com and IR ports and no control functions
|
||||
///
|
||||
/// </summary>
|
||||
[Description("Wrapper Class for DM-RMC-200-C")]
|
||||
public class DmRmc200CController : DmRmcControllerBase, IRoutingInputsOutputs,
|
||||
IIROutputPorts, IComPorts, ICec
|
||||
{
|
||||
private readonly DmRmc200C _rmc;
|
||||
|
||||
public RoutingInputPort DmIn { get; private set; }
|
||||
public class DmRmc200CController : DmRmcControllerBase, IRoutingInputsOutputs,
|
||||
IIROutputPorts, IComPorts, ICec
|
||||
{
|
||||
private readonly DmRmc200C _rmc;
|
||||
|
||||
public RoutingInputPort DmIn { get; private set; }
|
||||
public RoutingOutputPort HdmiOut { get; private set; }
|
||||
|
||||
public RoutingPortCollection<RoutingInputPort> InputPorts
|
||||
{
|
||||
get; private set;
|
||||
}
|
||||
|
||||
public RoutingPortCollection<RoutingOutputPort> OutputPorts
|
||||
{
|
||||
get; private set;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Make a Crestron RMC and put it in here
|
||||
/// </summary>
|
||||
public DmRmc200CController(string key, string name, DmRmc200C rmc)
|
||||
: base(key, name, rmc)
|
||||
{
|
||||
_rmc = rmc;
|
||||
DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo,
|
||||
eRoutingPortConnectionType.DmCat, 0, this);
|
||||
HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
|
||||
eRoutingPortConnectionType.Hdmi, null, this);
|
||||
|
||||
EdidManufacturerFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Manufacturer.StringValue);
|
||||
EdidNameFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Name.StringValue);
|
||||
EdidPreferredTimingFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.PreferredTiming.StringValue);
|
||||
EdidSerialNumberFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.SerialNumber.StringValue);
|
||||
|
||||
VideoOutputResolutionFeedback = new StringFeedback(() => _rmc.HdmiOutput.GetVideoResolutionString());
|
||||
|
||||
_rmc.HdmiOutput.OutputStreamChange += HdmiOutput_OutputStreamChange;
|
||||
_rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange;
|
||||
|
||||
InputPorts = new RoutingPortCollection<RoutingInputPort> {DmIn};
|
||||
OutputPorts = new RoutingPortCollection<RoutingOutputPort> {HdmiOut};
|
||||
|
||||
// Set Ports for CEC
|
||||
HdmiOut.Port = _rmc.HdmiOutput;
|
||||
}
|
||||
|
||||
void HdmiOutput_OutputStreamChange(EndpointOutputStream outputStream, EndpointOutputStreamEventArgs args)
|
||||
{
|
||||
if (args.EventId == EndpointOutputStreamEventIds.HorizontalResolutionFeedbackEventId || args.EventId == EndpointOutputStreamEventIds.VerticalResolutionFeedbackEventId ||
|
||||
args.EventId == EndpointOutputStreamEventIds.FramesPerSecondFeedbackEventId)
|
||||
{
|
||||
VideoOutputResolutionFeedback.FireUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
void ConnectedDevice_DeviceInformationChange(ConnectedDeviceInformation connectedDevice, ConnectedDeviceEventArgs args)
|
||||
{
|
||||
switch (args.EventId)
|
||||
{
|
||||
case ConnectedDeviceEventIds.ManufacturerEventId:
|
||||
EdidManufacturerFeedback.FireUpdate();
|
||||
break;
|
||||
case ConnectedDeviceEventIds.NameEventId:
|
||||
EdidNameFeedback.FireUpdate();
|
||||
break;
|
||||
case ConnectedDeviceEventIds.PreferredTimingEventId:
|
||||
EdidPreferredTimingFeedback.FireUpdate();
|
||||
break;
|
||||
case ConnectedDeviceEventIds.SerialNumberEventId:
|
||||
EdidSerialNumberFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||
{
|
||||
LinkDmRmcToApi(this, trilist, joinStart, joinMapKey, bridge);
|
||||
}
|
||||
|
||||
#region IIROutputPorts Members
|
||||
public CrestronCollection<IROutputPort> IROutputPorts { get { return _rmc.IROutputPorts; } }
|
||||
public int NumberOfIROutputPorts { get { return _rmc.NumberOfIROutputPorts; } }
|
||||
#endregion
|
||||
|
||||
#region IComPorts Members
|
||||
public CrestronCollection<ComPort> ComPorts { get { return _rmc.ComPorts; } }
|
||||
public int NumberOfComPorts { get { return _rmc.NumberOfComPorts; } }
|
||||
#endregion
|
||||
|
||||
#region ICec Members
|
||||
public Cec StreamCec { get { return _rmc.HdmiOutput.StreamCec; } }
|
||||
#endregion
|
||||
}
|
||||
|
||||
public RoutingPortCollection<RoutingInputPort> InputPorts
|
||||
{
|
||||
get; private set;
|
||||
}
|
||||
|
||||
public RoutingPortCollection<RoutingOutputPort> OutputPorts
|
||||
{
|
||||
get; private set;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Make a Crestron RMC and put it in here
|
||||
/// </summary>
|
||||
public DmRmc200CController(string key, string name, DmRmc200C rmc)
|
||||
: base(key, name, rmc)
|
||||
{
|
||||
_rmc = rmc;
|
||||
DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo,
|
||||
eRoutingPortConnectionType.DmCat, 0, this);
|
||||
HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
|
||||
eRoutingPortConnectionType.Hdmi, null, this);
|
||||
|
||||
EdidManufacturerFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Manufacturer.StringValue);
|
||||
EdidNameFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Name.StringValue);
|
||||
EdidPreferredTimingFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.PreferredTiming.StringValue);
|
||||
EdidSerialNumberFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.SerialNumber.StringValue);
|
||||
|
||||
VideoOutputResolutionFeedback = new StringFeedback(() => _rmc.HdmiOutput.GetVideoResolutionString());
|
||||
|
||||
_rmc.HdmiOutput.OutputStreamChange += HdmiOutput_OutputStreamChange;
|
||||
_rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange;
|
||||
|
||||
InputPorts = new RoutingPortCollection<RoutingInputPort> {DmIn};
|
||||
OutputPorts = new RoutingPortCollection<RoutingOutputPort> {HdmiOut};
|
||||
|
||||
// Set Ports for CEC
|
||||
HdmiOut.Port = _rmc.HdmiOutput;
|
||||
}
|
||||
|
||||
void HdmiOutput_OutputStreamChange(EndpointOutputStream outputStream, EndpointOutputStreamEventArgs args)
|
||||
{
|
||||
if (args.EventId == EndpointOutputStreamEventIds.HorizontalResolutionFeedbackEventId || args.EventId == EndpointOutputStreamEventIds.VerticalResolutionFeedbackEventId ||
|
||||
args.EventId == EndpointOutputStreamEventIds.FramesPerSecondFeedbackEventId)
|
||||
{
|
||||
VideoOutputResolutionFeedback.FireUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
void ConnectedDevice_DeviceInformationChange(ConnectedDeviceInformation connectedDevice, ConnectedDeviceEventArgs args)
|
||||
{
|
||||
switch (args.EventId)
|
||||
{
|
||||
case ConnectedDeviceEventIds.ManufacturerEventId:
|
||||
EdidManufacturerFeedback.FireUpdate();
|
||||
break;
|
||||
case ConnectedDeviceEventIds.NameEventId:
|
||||
EdidNameFeedback.FireUpdate();
|
||||
break;
|
||||
case ConnectedDeviceEventIds.PreferredTimingEventId:
|
||||
EdidPreferredTimingFeedback.FireUpdate();
|
||||
break;
|
||||
case ConnectedDeviceEventIds.SerialNumberEventId:
|
||||
EdidSerialNumberFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||
{
|
||||
LinkDmRmcToApi(this, trilist, joinStart, joinMapKey, bridge);
|
||||
}
|
||||
|
||||
#region IIROutputPorts Members
|
||||
public CrestronCollection<IROutputPort> IROutputPorts { get { return _rmc.IROutputPorts; } }
|
||||
public int NumberOfIROutputPorts { get { return _rmc.NumberOfIROutputPorts; } }
|
||||
#endregion
|
||||
|
||||
#region IComPorts Members
|
||||
public CrestronCollection<ComPort> ComPorts { get { return _rmc.ComPorts; } }
|
||||
public int NumberOfComPorts { get { return _rmc.NumberOfComPorts; } }
|
||||
#endregion
|
||||
|
||||
#region ICec Members
|
||||
public Cec StreamCec { get { return _rmc.HdmiOutput.StreamCec; } }
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,196 +1,220 @@
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Crestron.SimplSharpPro.DM;
|
||||
using Crestron.SimplSharpPro.DM.Endpoints;
|
||||
using Crestron.SimplSharpPro.DM.Endpoints.Receivers;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Bridges;
|
||||
|
||||
namespace PepperDash.Essentials.DM
|
||||
{
|
||||
/// <summary>
|
||||
/// Builds a controller for basic DM-RMCs with Com and IR ports and no control functions
|
||||
///
|
||||
/// </summary>
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Crestron.SimplSharpPro.DM;
|
||||
using Crestron.SimplSharpPro.DM.Endpoints;
|
||||
using Crestron.SimplSharpPro.DM.Endpoints.Receivers;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Bridges;
|
||||
using PepperDash_Essentials_DM;
|
||||
|
||||
namespace PepperDash.Essentials.DM
|
||||
{
|
||||
/// <summary>
|
||||
/// Builds a controller for basic DM-RMCs with Com and IR ports and no control functions
|
||||
///
|
||||
/// </summary>
|
||||
[Description("Wrapper Class for DM-RMC-4K-SCALER-C")]
|
||||
public class DmRmc4kScalerCController : DmRmcControllerBase, IRoutingInputsOutputs, IBasicVolumeWithFeedback,
|
||||
IIROutputPorts, IComPorts, ICec, IRelayPorts
|
||||
{
|
||||
private readonly DmRmc4kScalerC _rmc;
|
||||
|
||||
public RoutingInputPort DmIn { get; private set; }
|
||||
public RoutingOutputPort HdmiOut { get; private set; }
|
||||
public RoutingOutputPort BalancedAudioOut { get; private set; }
|
||||
|
||||
public RoutingPortCollection<RoutingInputPort> InputPorts { get; private set; }
|
||||
|
||||
public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Make a Crestron RMC and put it in here
|
||||
/// </summary>
|
||||
public DmRmc4kScalerCController(string key, string name, DmRmc4kScalerC rmc)
|
||||
: base(key, name, rmc)
|
||||
{
|
||||
_rmc = rmc;
|
||||
|
||||
DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo,
|
||||
eRoutingPortConnectionType.DmCat, 0, this);
|
||||
HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
|
||||
eRoutingPortConnectionType.Hdmi, null, this);
|
||||
BalancedAudioOut = new RoutingOutputPort(DmPortName.BalancedAudioOut, eRoutingSignalType.Audio,
|
||||
eRoutingPortConnectionType.LineAudio, null, this);
|
||||
|
||||
MuteFeedback = new BoolFeedback(() => false);
|
||||
|
||||
VolumeLevelFeedback = new IntFeedback("MainVolumeLevelFeedback", () =>
|
||||
rmc.AudioOutput.VolumeFeedback.UShortValue);
|
||||
|
||||
EdidManufacturerFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Manufacturer.StringValue);
|
||||
EdidNameFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Name.StringValue);
|
||||
EdidPreferredTimingFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.PreferredTiming.StringValue);
|
||||
EdidSerialNumberFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.SerialNumber.StringValue);
|
||||
|
||||
InputPorts = new RoutingPortCollection<RoutingInputPort> {DmIn};
|
||||
OutputPorts = new RoutingPortCollection<RoutingOutputPort> {HdmiOut, BalancedAudioOut};
|
||||
|
||||
VideoOutputResolutionFeedback = new StringFeedback(() => _rmc.HdmiOutput.GetVideoResolutionString());
|
||||
|
||||
_rmc.HdmiOutput.OutputStreamChange += HdmiOutput_OutputStreamChange;
|
||||
_rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange;
|
||||
|
||||
// Set Ports for CEC
|
||||
HdmiOut.Port = _rmc.HdmiOutput;
|
||||
}
|
||||
|
||||
void HdmiOutput_OutputStreamChange(EndpointOutputStream outputStream, EndpointOutputStreamEventArgs args)
|
||||
{
|
||||
if (args.EventId == EndpointOutputStreamEventIds.HorizontalResolutionFeedbackEventId || args.EventId == EndpointOutputStreamEventIds.VerticalResolutionFeedbackEventId ||
|
||||
args.EventId == EndpointOutputStreamEventIds.FramesPerSecondFeedbackEventId)
|
||||
{
|
||||
VideoOutputResolutionFeedback.FireUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
void ConnectedDevice_DeviceInformationChange(ConnectedDeviceInformation connectedDevice, ConnectedDeviceEventArgs args)
|
||||
{
|
||||
switch (args.EventId)
|
||||
{
|
||||
case ConnectedDeviceEventIds.ManufacturerEventId:
|
||||
EdidManufacturerFeedback.FireUpdate();
|
||||
break;
|
||||
case ConnectedDeviceEventIds.NameEventId:
|
||||
EdidNameFeedback.FireUpdate();
|
||||
break;
|
||||
case ConnectedDeviceEventIds.PreferredTimingEventId:
|
||||
EdidPreferredTimingFeedback.FireUpdate();
|
||||
break;
|
||||
case ConnectedDeviceEventIds.SerialNumberEventId:
|
||||
EdidSerialNumberFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||
{
|
||||
LinkDmRmcToApi(this, trilist, joinStart, joinMapKey, bridge);
|
||||
}
|
||||
|
||||
#region IIROutputPorts Members
|
||||
public CrestronCollection<IROutputPort> IROutputPorts { get { return _rmc.IROutputPorts; } }
|
||||
public int NumberOfIROutputPorts { get { return _rmc.NumberOfIROutputPorts; } }
|
||||
#endregion
|
||||
|
||||
#region IComPorts Members
|
||||
public CrestronCollection<ComPort> ComPorts { get { return _rmc.ComPorts; } }
|
||||
public int NumberOfComPorts { get { return _rmc.NumberOfComPorts; } }
|
||||
#endregion
|
||||
|
||||
#region ICec Members
|
||||
/// <summary>
|
||||
/// Gets the CEC stream directly from the HDMI port.
|
||||
/// </summary>
|
||||
public Cec StreamCec { get { return _rmc.HdmiOutput.StreamCec; } }
|
||||
#endregion
|
||||
|
||||
#region IRelayPorts Members
|
||||
|
||||
public int NumberOfRelayPorts
|
||||
{
|
||||
get { return _rmc.NumberOfRelayPorts; }
|
||||
}
|
||||
|
||||
public CrestronCollection<Relay> RelayPorts
|
||||
{
|
||||
get { return _rmc.RelayPorts; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IBasicVolumeWithFeedback Members
|
||||
|
||||
public BoolFeedback MuteFeedback
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Not implemented
|
||||
/// </summary>
|
||||
public void MuteOff()
|
||||
{
|
||||
Debug.Console(2, this, "DM Endpoint {0} does not have a mute function", Key);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Not implemented
|
||||
/// </summary>
|
||||
public void MuteOn()
|
||||
{
|
||||
Debug.Console(2, this, "DM Endpoint {0} does not have a mute function", Key);
|
||||
}
|
||||
|
||||
public void SetVolume(ushort level)
|
||||
{
|
||||
_rmc.AudioOutput.Volume.UShortValue = level;
|
||||
}
|
||||
|
||||
public IntFeedback VolumeLevelFeedback
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IBasicVolumeControls Members
|
||||
|
||||
/// <summary>
|
||||
/// Not implemented
|
||||
/// </summary>
|
||||
public void MuteToggle()
|
||||
{
|
||||
Debug.Console(2, this, "DM Endpoint {0} does not have a mute function", Key);
|
||||
}
|
||||
|
||||
public void VolumeDown(bool pressRelease)
|
||||
{
|
||||
if (pressRelease)
|
||||
SigHelper.RampTimeScaled(_rmc.AudioOutput.Volume, 0, 4000);
|
||||
else
|
||||
_rmc.AudioOutput.Volume.StopRamp();
|
||||
}
|
||||
|
||||
public void VolumeUp(bool pressRelease)
|
||||
{
|
||||
if (pressRelease)
|
||||
SigHelper.RampTimeScaled(_rmc.AudioOutput.Volume, 65535, 4000);
|
||||
else
|
||||
_rmc.AudioOutput.Volume.StopRamp();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
public class DmRmc4kScalerCController : DmRmcControllerBase, IRoutingInputsOutputs, IBasicVolumeWithFeedback,
|
||||
IIROutputPorts, IComPorts, ICec, IRelayPorts, IHasDmInHdcp
|
||||
{
|
||||
private readonly DmRmc4kScalerC _rmc;
|
||||
|
||||
public RoutingInputPort DmIn { get; private set; }
|
||||
public RoutingOutputPort HdmiOut { get; private set; }
|
||||
public RoutingOutputPort BalancedAudioOut { get; private set; }
|
||||
|
||||
public RoutingPortCollection<RoutingInputPort> InputPorts { get; private set; }
|
||||
|
||||
public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; private set; }
|
||||
|
||||
public EndpointDmInputStreamWithCec DmInput { get; private set; }
|
||||
|
||||
public IntFeedback DmInHdcpStateFeedback { get; private set; }
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Make a Crestron RMC and put it in here
|
||||
/// </summary>
|
||||
public DmRmc4kScalerCController(string key, string name, DmRmc4kScalerC rmc)
|
||||
: base(key, name, rmc)
|
||||
{
|
||||
_rmc = rmc;
|
||||
|
||||
DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo,
|
||||
eRoutingPortConnectionType.DmCat, 0, this);
|
||||
HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
|
||||
eRoutingPortConnectionType.Hdmi, null, this);
|
||||
BalancedAudioOut = new RoutingOutputPort(DmPortName.BalancedAudioOut, eRoutingSignalType.Audio,
|
||||
eRoutingPortConnectionType.LineAudio, null, this);
|
||||
|
||||
MuteFeedback = new BoolFeedback(() => false);
|
||||
|
||||
VolumeLevelFeedback = new IntFeedback("MainVolumeLevelFeedback", () =>
|
||||
rmc.AudioOutput.VolumeFeedback.UShortValue);
|
||||
|
||||
EdidManufacturerFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Manufacturer.StringValue);
|
||||
EdidNameFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Name.StringValue);
|
||||
EdidPreferredTimingFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.PreferredTiming.StringValue);
|
||||
EdidSerialNumberFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.SerialNumber.StringValue);
|
||||
|
||||
InputPorts = new RoutingPortCollection<RoutingInputPort> { DmIn };
|
||||
OutputPorts = new RoutingPortCollection<RoutingOutputPort> { HdmiOut, BalancedAudioOut };
|
||||
|
||||
VideoOutputResolutionFeedback = new StringFeedback(() => _rmc.HdmiOutput.GetVideoResolutionString());
|
||||
DmInHdcpStateFeedback = new IntFeedback("DmInHdcpCapability",
|
||||
() => (int)_rmc.DmInput.HdcpCapabilityFeedback);
|
||||
|
||||
AddToFeedbackList(DmInHdcpStateFeedback);
|
||||
|
||||
|
||||
_rmc.HdmiOutput.OutputStreamChange += HdmiOutput_OutputStreamChange;
|
||||
_rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange;
|
||||
|
||||
// Set Ports for CEC
|
||||
HdmiOut.Port = _rmc.HdmiOutput;
|
||||
}
|
||||
|
||||
void HdmiOutput_OutputStreamChange(EndpointOutputStream outputStream, EndpointOutputStreamEventArgs args)
|
||||
{
|
||||
if (args.EventId == EndpointOutputStreamEventIds.HorizontalResolutionFeedbackEventId || args.EventId == EndpointOutputStreamEventIds.VerticalResolutionFeedbackEventId ||
|
||||
args.EventId == EndpointOutputStreamEventIds.FramesPerSecondFeedbackEventId)
|
||||
{
|
||||
VideoOutputResolutionFeedback.FireUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
void ConnectedDevice_DeviceInformationChange(ConnectedDeviceInformation connectedDevice, ConnectedDeviceEventArgs args)
|
||||
{
|
||||
switch (args.EventId)
|
||||
{
|
||||
case ConnectedDeviceEventIds.ManufacturerEventId:
|
||||
EdidManufacturerFeedback.FireUpdate();
|
||||
break;
|
||||
case ConnectedDeviceEventIds.NameEventId:
|
||||
EdidNameFeedback.FireUpdate();
|
||||
break;
|
||||
case ConnectedDeviceEventIds.PreferredTimingEventId:
|
||||
EdidPreferredTimingFeedback.FireUpdate();
|
||||
break;
|
||||
case ConnectedDeviceEventIds.SerialNumberEventId:
|
||||
EdidSerialNumberFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||
{
|
||||
LinkDmRmcToApi(this, trilist, joinStart, joinMapKey, bridge);
|
||||
}
|
||||
|
||||
#region IIROutputPorts Members
|
||||
public CrestronCollection<IROutputPort> IROutputPorts { get { return _rmc.IROutputPorts; } }
|
||||
public int NumberOfIROutputPorts { get { return _rmc.NumberOfIROutputPorts; } }
|
||||
#endregion
|
||||
|
||||
#region IComPorts Members
|
||||
public CrestronCollection<ComPort> ComPorts { get { return _rmc.ComPorts; } }
|
||||
public int NumberOfComPorts { get { return _rmc.NumberOfComPorts; } }
|
||||
#endregion
|
||||
|
||||
#region ICec Members
|
||||
/// <summary>
|
||||
/// Gets the CEC stream directly from the HDMI port.
|
||||
/// </summary>
|
||||
public Cec StreamCec { get { return _rmc.HdmiOutput.StreamCec; } }
|
||||
#endregion
|
||||
|
||||
#region IRelayPorts Members
|
||||
|
||||
public int NumberOfRelayPorts
|
||||
{
|
||||
get { return _rmc.NumberOfRelayPorts; }
|
||||
}
|
||||
|
||||
public CrestronCollection<Relay> RelayPorts
|
||||
{
|
||||
get { return _rmc.RelayPorts; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IBasicVolumeWithFeedback Members
|
||||
|
||||
public BoolFeedback MuteFeedback
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Not implemented
|
||||
/// </summary>
|
||||
public void MuteOff()
|
||||
{
|
||||
Debug.Console(2, this, "DM Endpoint {0} does not have a mute function", Key);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Not implemented
|
||||
/// </summary>
|
||||
public void MuteOn()
|
||||
{
|
||||
Debug.Console(2, this, "DM Endpoint {0} does not have a mute function", Key);
|
||||
}
|
||||
|
||||
public void SetVolume(ushort level)
|
||||
{
|
||||
_rmc.AudioOutput.Volume.UShortValue = level;
|
||||
}
|
||||
|
||||
public IntFeedback VolumeLevelFeedback
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IBasicVolumeControls Members
|
||||
|
||||
/// <summary>
|
||||
/// Not implemented
|
||||
/// </summary>
|
||||
public void MuteToggle()
|
||||
{
|
||||
Debug.Console(2, this, "DM Endpoint {0} does not have a mute function", Key);
|
||||
}
|
||||
|
||||
public void VolumeDown(bool pressRelease)
|
||||
{
|
||||
if (pressRelease)
|
||||
SigHelper.RampTimeScaled(_rmc.AudioOutput.Volume, 0, 4000);
|
||||
else
|
||||
_rmc.AudioOutput.Volume.StopRamp();
|
||||
}
|
||||
|
||||
public void VolumeUp(bool pressRelease)
|
||||
{
|
||||
if (pressRelease)
|
||||
SigHelper.RampTimeScaled(_rmc.AudioOutput.Volume, 65535, 4000);
|
||||
else
|
||||
_rmc.AudioOutput.Volume.StopRamp();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public eHdcpCapabilityType DmInHdcpCapability
|
||||
{
|
||||
get { return eHdcpCapabilityType.Hdcp2_2Support; }
|
||||
}
|
||||
|
||||
public void SetDmInHdcpState(eHdcpCapabilityType hdcpState)
|
||||
{
|
||||
if (_rmc == null) return;
|
||||
_rmc.DmInput.HdcpCapability = hdcpState;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -32,7 +32,9 @@ namespace PepperDash.Essentials.DM
|
||||
eRoutingPortConnectionType.Hdmi, null, this) {Port = _rmc};
|
||||
|
||||
InputPorts = new RoutingPortCollection<RoutingInputPort> {DmIn};
|
||||
OutputPorts = new RoutingPortCollection<RoutingOutputPort> {HdmiOut};
|
||||
OutputPorts = new RoutingPortCollection<RoutingOutputPort> {HdmiOut};
|
||||
PreventRegistration = true;
|
||||
rmc.Register();
|
||||
}
|
||||
|
||||
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||
|
||||
@@ -5,8 +5,9 @@ using Crestron.SimplSharpPro.DM.Endpoints;
|
||||
using Crestron.SimplSharpPro.DM.Endpoints.Receivers;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Bridges;
|
||||
|
||||
using PepperDash.Essentials.Core.Bridges;
|
||||
using PepperDash_Essentials_DM;
|
||||
|
||||
namespace PepperDash.Essentials.DM
|
||||
{
|
||||
/// <summary>
|
||||
@@ -15,7 +16,7 @@ namespace PepperDash.Essentials.DM
|
||||
/// </summary>
|
||||
[Description("Wrapper Class for DM-RMC-4K-SCALER-C-DSP")]
|
||||
public class DmRmc4kScalerCDspController : DmRmcControllerBase, IRoutingInputsOutputs, IBasicVolumeWithFeedback,
|
||||
IIROutputPorts, IComPorts, ICec, IRelayPorts
|
||||
IIROutputPorts, IComPorts, ICec, IRelayPorts, IHasDmInHdcp
|
||||
{
|
||||
private readonly DmRmc4kScalerCDsp _rmc;
|
||||
|
||||
@@ -25,7 +26,12 @@ namespace PepperDash.Essentials.DM
|
||||
|
||||
public RoutingPortCollection<RoutingInputPort> InputPorts { get; private set; }
|
||||
|
||||
public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; private set; }
|
||||
public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; private set; }
|
||||
|
||||
public EndpointDmInputStreamWithCec DmInput { get; private set; }
|
||||
|
||||
public IntFeedback DmInHdcpStateFeedback { get; private set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Make a Crestron RMC and put it in here
|
||||
@@ -51,7 +57,13 @@ namespace PepperDash.Essentials.DM
|
||||
EdidPreferredTimingFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.PreferredTiming.StringValue);
|
||||
EdidSerialNumberFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.SerialNumber.StringValue);
|
||||
|
||||
VideoOutputResolutionFeedback = new StringFeedback(() => _rmc.HdmiOutput.GetVideoResolutionString());
|
||||
VideoOutputResolutionFeedback = new StringFeedback(() => _rmc.HdmiOutput.GetVideoResolutionString());
|
||||
|
||||
DmInHdcpStateFeedback = new IntFeedback("DmInHdcpCapability",
|
||||
() => (int) _rmc.DmInput.HdcpCapabilityFeedback);
|
||||
|
||||
AddToFeedbackList(DmInHdcpStateFeedback);
|
||||
|
||||
|
||||
InputPorts = new RoutingPortCollection<RoutingInputPort> {DmIn};
|
||||
OutputPorts = new RoutingPortCollection<RoutingOutputPort> {HdmiOut, BalancedAudioOut};
|
||||
@@ -190,6 +202,18 @@ namespace PepperDash.Essentials.DM
|
||||
_rmc.AudioOutput.Volume.StopRamp();
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
public eHdcpCapabilityType DmInHdcpCapability
|
||||
{
|
||||
get { return eHdcpCapabilityType.Hdcp2_2Support; }
|
||||
}
|
||||
|
||||
public void SetDmInHdcpState(eHdcpCapabilityType hdcpState)
|
||||
{
|
||||
if (_rmc == null) return;
|
||||
_rmc.DmInput.HdcpCapability = hdcpState;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -9,12 +9,13 @@ using Crestron.SimplSharpPro.DM.Endpoints.Receivers;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Bridges;
|
||||
using PepperDash.Core;
|
||||
using PepperDash_Essentials_DM;
|
||||
|
||||
namespace PepperDash.Essentials.DM
|
||||
{
|
||||
[Description("Wrapper Class for DM-RMC-4K-Z-SCALER-C")]
|
||||
public class DmRmc4kZScalerCController : DmRmcControllerBase, IRmcRoutingWithFeedback,
|
||||
IIROutputPorts, IComPorts, ICec, IRelayPorts
|
||||
IIROutputPorts, IComPorts, ICec, IRelayPorts, IHasDmInHdcp, IHasHdmiInHdcp
|
||||
{
|
||||
private readonly DmRmc4kzScalerC _rmc;
|
||||
|
||||
@@ -22,6 +23,13 @@ namespace PepperDash.Essentials.DM
|
||||
public RoutingInputPort HdmiIn { get; private set; }
|
||||
public RoutingOutputPort HdmiOut { get; private set; }
|
||||
|
||||
public IntFeedback DmInHdcpStateFeedback { get; private set; }
|
||||
public IntFeedback HdmiInHdcpStateFeedback { get; private set; }
|
||||
|
||||
public BoolFeedback HdmiVideoSyncFeedback { get; private set; }
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// The value of the current video source for the HDMI output on the receiver
|
||||
/// </summary>
|
||||
@@ -42,13 +50,13 @@ namespace PepperDash.Essentials.DM
|
||||
{
|
||||
var newEvent = NumericSwitchChange;
|
||||
if (newEvent != null) newEvent(this, e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public DmRmc4kZScalerCController(string key, string name, DmRmc4kzScalerC rmc)
|
||||
: base(key, name, rmc)
|
||||
{
|
||||
_rmc = rmc;
|
||||
|
||||
DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo,
|
||||
eRoutingPortConnectionType.DmCat, 0, this)
|
||||
{
|
||||
@@ -62,6 +70,16 @@ namespace PepperDash.Essentials.DM
|
||||
HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
|
||||
eRoutingPortConnectionType.Hdmi, null, this);
|
||||
|
||||
HdmiInHdcpStateFeedback = new IntFeedback("HdmiInHdcpCapability",
|
||||
() => (int)_rmc.HdmiIn.HdcpCapabilityFeedback);
|
||||
DmInHdcpStateFeedback = new IntFeedback("DmInHdcpCapability",
|
||||
() => (int)_rmc.DmInput.HdcpCapabilityFeedback);
|
||||
HdmiVideoSyncFeedback = new BoolFeedback("HdmiInVideoSync",
|
||||
() => _rmc.HdmiIn.SyncDetectedFeedback.BoolValue);
|
||||
|
||||
AddToFeedbackList(HdmiInHdcpStateFeedback, DmInHdcpStateFeedback, HdmiVideoSyncFeedback);
|
||||
|
||||
|
||||
EdidManufacturerFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Manufacturer.StringValue);
|
||||
EdidNameFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Name.StringValue);
|
||||
EdidPreferredTimingFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.PreferredTiming.StringValue);
|
||||
@@ -69,11 +87,13 @@ namespace PepperDash.Essentials.DM
|
||||
|
||||
VideoOutputResolutionFeedback = new StringFeedback(() => _rmc.HdmiOutput.GetVideoResolutionString());
|
||||
|
||||
InputPorts = new RoutingPortCollection<RoutingInputPort> {DmIn, HdmiIn};
|
||||
OutputPorts = new RoutingPortCollection<RoutingOutputPort> {HdmiOut};
|
||||
InputPorts = new RoutingPortCollection<RoutingInputPort> { DmIn, HdmiIn };
|
||||
OutputPorts = new RoutingPortCollection<RoutingOutputPort> { HdmiOut };
|
||||
|
||||
_rmc.HdmiOutput.OutputStreamChange += HdmiOutput_OutputStreamChange;
|
||||
_rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange;
|
||||
_rmc.HdmiIn.InputStreamChange += InputStreamChangeEvent;
|
||||
_rmc.DmInput.InputStreamChange += InputStreamChangeEvent;
|
||||
|
||||
_rmc.OnlineStatusChange += _rmc_OnlineStatusChange;
|
||||
|
||||
@@ -83,6 +103,20 @@ namespace PepperDash.Essentials.DM
|
||||
AudioVideoSourceNumericFeedback = new IntFeedback(() => (ushort)(_rmc.SelectedSourceFeedback));
|
||||
}
|
||||
|
||||
void InputStreamChangeEvent(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
|
||||
{
|
||||
switch (args.EventId)
|
||||
{
|
||||
case EndpointInputStreamEventIds.HdcpCapabilityFeedbackEventId:
|
||||
if (inputStream == _rmc.HdmiIn) HdmiInHdcpStateFeedback.FireUpdate();
|
||||
if (inputStream == _rmc.DmInput) DmInHdcpStateFeedback.FireUpdate();
|
||||
break;
|
||||
case EndpointInputStreamEventIds.SyncDetectedFeedbackEventId:
|
||||
if (inputStream == _rmc.HdmiIn) HdmiVideoSyncFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void _rmc_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
|
||||
{
|
||||
AudioVideoSourceNumericFeedback.FireUpdate();
|
||||
@@ -181,5 +215,31 @@ namespace PepperDash.Essentials.DM
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
public eHdcpCapabilityType DmInHdcpCapability
|
||||
{
|
||||
get { return eHdcpCapabilityType.Hdcp2_2Support; }
|
||||
}
|
||||
|
||||
public void SetDmInHdcpState(eHdcpCapabilityType hdcpState)
|
||||
{
|
||||
|
||||
if (_rmc == null) return;
|
||||
_rmc.DmInput.HdcpCapability = hdcpState;
|
||||
}
|
||||
|
||||
|
||||
public eHdcpCapabilityType HdmiInHdcpCapability
|
||||
{
|
||||
get { return eHdcpCapabilityType.Hdcp2_2Support; }
|
||||
}
|
||||
|
||||
public void SetHdmiInHdcpState(eHdcpCapabilityType hdcpState)
|
||||
{
|
||||
if (_rmc == null) return;
|
||||
_rmc.HdmiIn.HdcpCapability = hdcpState;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Crestron.SimplSharpPro.DM;
|
||||
using Crestron.SimplSharpPro.DM.Cards;
|
||||
@@ -11,11 +12,12 @@ using PepperDash.Essentials.Core.Bridges;
|
||||
using PepperDash.Essentials.Core.DeviceInfo;
|
||||
using PepperDash.Essentials.DM.Config;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
using PepperDash_Essentials_DM;
|
||||
|
||||
namespace PepperDash.Essentials.DM
|
||||
{
|
||||
[Description("Wrapper class for all DM-RMC variants")]
|
||||
public abstract class DmRmcControllerBase : CrestronGenericBridgeableBaseDevice, IDeviceInfoProvider
|
||||
public abstract class DmRmcControllerBase : CrestronGenericBridgeableBaseDevice, IDeviceInfoProvider
|
||||
{
|
||||
private const int CtpPort = 41795;
|
||||
private readonly EndpointReceiverBase _rmc; //kept here just in case. Only property or method on this class that's not device-specific is the DMOutput that it's attached to.
|
||||
@@ -27,15 +29,15 @@ namespace PepperDash.Essentials.DM
|
||||
public StringFeedback EdidSerialNumberFeedback { get; protected set; }
|
||||
|
||||
protected DmRmcControllerBase(string key, string name, EndpointReceiverBase device)
|
||||
: base(key, name, device)
|
||||
: base(key, name, device)
|
||||
{
|
||||
_rmc = device;
|
||||
|
||||
// if wired to a chassis, skip registration step in base class
|
||||
// if wired to a chassis, skip registration step in base class
|
||||
PreventRegistration = _rmc.DMOutput != null;
|
||||
|
||||
|
||||
AddToFeedbackList(VideoOutputResolutionFeedback, EdidManufacturerFeedback, EdidSerialNumberFeedback, EdidNameFeedback, EdidPreferredTimingFeedback);
|
||||
|
||||
|
||||
DeviceInfo = new DeviceInfo();
|
||||
|
||||
IsOnline.OutputChange += (currentDevice, args) => { if (args.BoolValue) UpdateDeviceInfo(); };
|
||||
@@ -73,19 +75,80 @@ namespace PepperDash.Essentials.DM
|
||||
rmc.EdidPreferredTimingFeedback.LinkInputSig(trilist.StringInput[joinMap.EdidPrefferedTiming.JoinNumber]);
|
||||
if (rmc.EdidSerialNumberFeedback != null)
|
||||
rmc.EdidSerialNumberFeedback.LinkInputSig(trilist.StringInput[joinMap.EdidSerialNumber.JoinNumber]);
|
||||
|
||||
|
||||
|
||||
//If the device is an DM-RMC-4K-Z-SCALER-C
|
||||
var routing = rmc as IRmcRouting;
|
||||
var routing = rmc as IRoutingInputsOutputs;
|
||||
|
||||
trilist.UShortInput[joinMap.HdcpInputPortCount.JoinNumber].UShortValue = (ushort)(routing == null
|
||||
? 1
|
||||
: routing.InputPorts.Count);
|
||||
|
||||
if (routing == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
var hdcpCapability = eHdcpCapabilityType.HdcpSupportOff;
|
||||
if (routing.InputPorts[DmPortName.HdmiIn] != null)
|
||||
{
|
||||
var hdmiInHdcp = routing as IHasHdmiInHdcp;
|
||||
if (hdmiInHdcp != null)
|
||||
{
|
||||
if (rmc.Feedbacks["HdmiInHdcpCapability"] != null)
|
||||
{
|
||||
var intFeedback = rmc.Feedbacks["HdmiInHdcpCapability"] as IntFeedback;
|
||||
if (intFeedback != null)
|
||||
intFeedback.LinkInputSig(trilist.UShortInput[joinMap.Port1HdcpState.JoinNumber]);
|
||||
}
|
||||
if (rmc.Feedbacks["HdmiInVideoSync"] != null)
|
||||
{
|
||||
var boolFeedback = rmc.Feedbacks["HdmiInVideoSync"] as BoolFeedback;
|
||||
if (boolFeedback != null)
|
||||
boolFeedback.LinkInputSig(trilist.BooleanInput[joinMap.HdmiInputSync.JoinNumber]);
|
||||
}
|
||||
hdcpCapability = hdmiInHdcp.HdmiInHdcpCapability > hdcpCapability
|
||||
? hdmiInHdcp.HdmiInHdcpCapability
|
||||
: hdcpCapability;
|
||||
|
||||
if (routing.AudioVideoSourceNumericFeedback != null)
|
||||
routing.AudioVideoSourceNumericFeedback.LinkInputSig(trilist.UShortInput[joinMap.AudioVideoSource.JoinNumber]);
|
||||
trilist.SetUShortSigAction(joinMap.Port1HdcpState.JoinNumber, a => hdmiInHdcp.SetHdmiInHdcpState((eHdcpCapabilityType)a));
|
||||
}
|
||||
}
|
||||
if (routing.InputPorts[DmPortName.DmIn] != null)
|
||||
{
|
||||
var dmInHdcp = rmc as IHasDmInHdcp;
|
||||
|
||||
trilist.SetUShortSigAction(joinMap.AudioVideoSource.JoinNumber, a => routing.ExecuteNumericSwitch(a, 1, eRoutingSignalType.AudioVideo));
|
||||
if (dmInHdcp != null)
|
||||
{
|
||||
if (rmc.Feedbacks["DmInHdcpCapability"] != null)
|
||||
{
|
||||
var intFeedback = rmc.Feedbacks["DmInHdcpCapability"] as IntFeedback;
|
||||
if (intFeedback != null)
|
||||
intFeedback.LinkInputSig(trilist.UShortInput[joinMap.Port2HdcpState.JoinNumber]);
|
||||
}
|
||||
|
||||
hdcpCapability = dmInHdcp.DmInHdcpCapability > hdcpCapability
|
||||
? dmInHdcp.DmInHdcpCapability
|
||||
: hdcpCapability;
|
||||
|
||||
|
||||
trilist.SetUShortSigAction(joinMap.Port2HdcpState.JoinNumber, a => dmInHdcp.SetDmInHdcpState((eHdcpCapabilityType)a));
|
||||
}
|
||||
}
|
||||
|
||||
trilist.UShortInput[joinMap.HdcpSupportCapability.JoinNumber].UShortValue = (ushort)hdcpCapability;
|
||||
|
||||
trilist.UShortInput[joinMap.HdcpInputPortCount.JoinNumber].UShortValue = (ushort)routing.InputPorts.Count;
|
||||
|
||||
var routingWithFeedback = routing as IRmcRouting;
|
||||
if (routingWithFeedback == null) return;
|
||||
|
||||
if (routingWithFeedback.AudioVideoSourceNumericFeedback != null)
|
||||
routingWithFeedback.AudioVideoSourceNumericFeedback.LinkInputSig(
|
||||
trilist.UShortInput[joinMap.AudioVideoSource.JoinNumber]);
|
||||
|
||||
|
||||
trilist.SetUShortSigAction(joinMap.AudioVideoSource.JoinNumber,
|
||||
a => routingWithFeedback.ExecuteNumericSwitch(a, 1, eRoutingSignalType.AudioVideo));
|
||||
}
|
||||
|
||||
#region Implementation of IDeviceInfoProvider
|
||||
@@ -143,13 +206,13 @@ namespace PepperDash.Essentials.DM
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (args.Text.ToLower().Contains("host"))
|
||||
{
|
||||
DeviceInfo.HostName = args.Text.Split(':')[1].Trim();
|
||||
|
||||
tcpClient.SendText("maca\r\n");
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -202,17 +265,17 @@ namespace PepperDash.Essentials.DM
|
||||
}
|
||||
}
|
||||
|
||||
public class DmRmcHelper
|
||||
{
|
||||
private static readonly Dictionary<string, Func<string, string, uint, CrestronGenericBaseDevice>> ProcessorFactoryDict;
|
||||
private static readonly Dictionary<string, Func<string, string, DMOutput, CrestronGenericBaseDevice>> ChassisCpu3Dict;
|
||||
public class DmRmcHelper
|
||||
{
|
||||
private static readonly Dictionary<string, Func<string, string, uint, CrestronGenericBaseDevice>> ProcessorFactoryDict;
|
||||
private static readonly Dictionary<string, Func<string, string, DMOutput, CrestronGenericBaseDevice>> ChassisCpu3Dict;
|
||||
|
||||
private static readonly Dictionary<string, Func<string, string, uint, DMOutput, CrestronGenericBaseDevice>>
|
||||
ChassisDict;
|
||||
private static readonly Dictionary<string, Func<string, string, uint, DMOutput, CrestronGenericBaseDevice>>
|
||||
ChassisDict;
|
||||
|
||||
static DmRmcHelper()
|
||||
{
|
||||
ProcessorFactoryDict = new Dictionary<string, Func<string, string, uint, CrestronGenericBaseDevice>>
|
||||
static DmRmcHelper()
|
||||
{
|
||||
ProcessorFactoryDict = new Dictionary<string, Func<string, string, uint, CrestronGenericBaseDevice>>
|
||||
{
|
||||
{"dmrmc100c", (k, n, i) => new DmRmcX100CController(k, n, new DmRmc100C(i, Global.ControlSystem))},
|
||||
{"dmrmc100s", (k, n, i) => new DmRmc100SController(k, n, new DmRmc100S(i, Global.ControlSystem))},
|
||||
@@ -306,31 +369,34 @@ namespace PepperDash.Essentials.DM
|
||||
{"dmrmc4k100c1g", (k,n,i,d) => new DmRmc4k100C1GController(k,n, new DmRmc4K100C1G(i, d))}
|
||||
};
|
||||
}
|
||||
/// <summary>
|
||||
/// A factory method for various DmRmcControllers
|
||||
/// </summary>
|
||||
/// <param name="key">device key. Used to uniquely identify device</param>
|
||||
/// <param name="name">device name</param>
|
||||
/// <param name="typeName">device type name. Used to retrived the correct device</param>
|
||||
/// <param name="props">Config from config file</param>
|
||||
/// <returns></returns>
|
||||
public static CrestronGenericBaseDevice GetDmRmcController(string key, string name, string typeName, DmRmcPropertiesConfig props)
|
||||
{
|
||||
typeName = typeName.ToLower();
|
||||
var ipid = props.Control.IpIdInt;
|
||||
/// <summary>
|
||||
/// A factory method for various DmRmcControllers
|
||||
/// </summary>
|
||||
/// <param name="key">device key. Used to uniquely identify device</param>
|
||||
/// <param name="name">device name</param>
|
||||
/// <param name="typeName">device type name. Used to retrived the correct device</param>
|
||||
/// <param name="props">Config from config file</param>
|
||||
/// <returns></returns>
|
||||
public static CrestronGenericBaseDevice GetDmRmcController(string key, string name, string typeName, DmRmcPropertiesConfig props)
|
||||
{
|
||||
typeName = typeName.ToLower();
|
||||
var ipid = props.Control.IpIdInt;
|
||||
|
||||
var pKey = props.ParentDeviceKey.ToLower();
|
||||
var pKey = props.ParentDeviceKey.ToLower();
|
||||
|
||||
// Non-DM-chassis endpoints
|
||||
return pKey == "processor" ? GetDmRmcControllerForProcessor(key, name, typeName, ipid) : GetDmRmcControllerForChassis(key, name, typeName, props, pKey, ipid);
|
||||
}
|
||||
// Non-DM-chassis endpoints
|
||||
return pKey == "processor" ? GetDmRmcControllerForProcessor(key, name, typeName, ipid) : GetDmRmcControllerForChassis(key, name, typeName, props, pKey, ipid);
|
||||
}
|
||||
|
||||
private static CrestronGenericBaseDevice GetDmRmcControllerForChassis(string key, string name, string typeName,
|
||||
DmRmcPropertiesConfig props, string pKey, uint ipid)
|
||||
{
|
||||
var parentDev = DeviceManager.GetDeviceForKey(pKey);
|
||||
if (parentDev is DmpsRoutingController)
|
||||
{
|
||||
private static CrestronGenericBaseDevice GetDmRmcControllerForChassis(string key, string name, string typeName,
|
||||
DmRmcPropertiesConfig props, string pKey, uint ipid)
|
||||
{
|
||||
var parentDev = DeviceManager.GetDeviceForKey(pKey);
|
||||
CrestronGenericBaseDevice rx;
|
||||
bool useChassisForOfflineFeedback = false;
|
||||
|
||||
if (parentDev is DmpsRoutingController)
|
||||
{
|
||||
var dmps = parentDev as DmpsRoutingController;
|
||||
//Check that the input is within range of this chassis' possible inputs
|
||||
var num = props.ParentOutputNumber;
|
||||
@@ -342,26 +408,37 @@ namespace PepperDash.Essentials.DM
|
||||
return null;
|
||||
}
|
||||
// Must use different constructor for DMPS4K types. No IPID
|
||||
if (Global.ControlSystemIsDmps4kType || typeName == "hdbasetrx" || typeName == "dmrmc4k100c1g")
|
||||
if (Global.ControlSystemIsDmps4kType)
|
||||
{
|
||||
var rmc = GetDmRmcControllerForDmps4k(key, name, typeName, dmps, props.ParentOutputNumber);
|
||||
Debug.Console(0, "DM endpoint output {0} is for Dmps4k, changing online feedback to chassis", num);
|
||||
rmc.IsOnline.SetValueFunc(() => dmps.OutputEndpointOnlineFeedbacks[num].BoolValue);
|
||||
rx = GetDmRmcControllerForDmps4k(key, name, typeName, dmps, props.ParentOutputNumber);
|
||||
useChassisForOfflineFeedback = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
rx = GetDmRmcControllerForDmps(key, name, typeName, ipid, dmps, props.ParentOutputNumber);
|
||||
if (typeName == "hdbasetrx" || typeName == "dmrmc4k100c1g")
|
||||
{
|
||||
useChassisForOfflineFeedback = true;
|
||||
}
|
||||
}
|
||||
if (useChassisForOfflineFeedback)
|
||||
{
|
||||
Debug.Console(0, "DM endpoint output {0} does not have direct online feedback, changing online feedback to chassis", num);
|
||||
rx.IsOnline.SetValueFunc(() => dmps.OutputEndpointOnlineFeedbacks[num].BoolValue);
|
||||
dmps.OutputEndpointOnlineFeedbacks[num].OutputChange += (o, a) =>
|
||||
{
|
||||
foreach (var feedback in rmc.Feedbacks)
|
||||
foreach (var feedback in rx.Feedbacks)
|
||||
{
|
||||
if (feedback != null)
|
||||
feedback.FireUpdate();
|
||||
}
|
||||
};
|
||||
return rmc;
|
||||
}
|
||||
return GetDmRmcControllerForDmps(key, name, typeName, ipid, dmps, props.ParentOutputNumber);
|
||||
}
|
||||
else if (parentDev is DmChassisController)
|
||||
return rx;
|
||||
}
|
||||
else if (parentDev is IDmSwitchWithEndpointOnlineFeedback)
|
||||
{
|
||||
var controller = parentDev as DmChassisController;
|
||||
var controller = parentDev as IDmSwitchWithEndpointOnlineFeedback;
|
||||
var chassis = controller.Chassis;
|
||||
var num = props.ParentOutputNumber;
|
||||
Debug.Console(1, "Creating DM Chassis device '{0}'. Output number '{1}'.", key, num);
|
||||
@@ -371,7 +448,7 @@ namespace PepperDash.Essentials.DM
|
||||
Debug.Console(0, "Cannot create DM device '{0}'. Output number '{1}' is out of range",
|
||||
key, num);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
controller.RxDictionary.Add(num, key);
|
||||
// Catch constructor failures, mainly dues to IPID
|
||||
try
|
||||
@@ -380,23 +457,33 @@ namespace PepperDash.Essentials.DM
|
||||
if (chassis is DmMd8x8Cpu3 || chassis is DmMd16x16Cpu3 ||
|
||||
chassis is DmMd32x32Cpu3 || chassis is DmMd8x8Cpu3rps ||
|
||||
chassis is DmMd16x16Cpu3rps || chassis is DmMd32x32Cpu3rps ||
|
||||
chassis is DmMd128x128 || chassis is DmMd64x64
|
||||
|| typeName == "hdbasetrx" || typeName == "dmrmc4k100c1g")
|
||||
chassis is DmMd128x128 || chassis is DmMd64x64)
|
||||
{
|
||||
var rmc = GetDmRmcControllerForCpu3Chassis(key, name, typeName, chassis, num, parentDev);
|
||||
Debug.Console(0, "DM endpoint output {0} is for Cpu3, changing online feedback to chassis", num);
|
||||
rmc.IsOnline.SetValueFunc(() => controller.OutputEndpointOnlineFeedbacks[num].BoolValue);
|
||||
controller.OutputEndpointOnlineFeedbacks[num].OutputChange += (o, a) =>
|
||||
{
|
||||
foreach (var feedback in rmc.Feedbacks)
|
||||
{
|
||||
if (feedback != null)
|
||||
feedback.FireUpdate();
|
||||
}
|
||||
};
|
||||
return rmc;
|
||||
rx = GetDmRmcControllerForCpu3Chassis(key, name, typeName, chassis, num, parentDev);
|
||||
useChassisForOfflineFeedback = true;
|
||||
}
|
||||
return GetDmRmcControllerForCpu2Chassis(key, name, typeName, ipid, chassis, num, parentDev);
|
||||
else
|
||||
{
|
||||
rx = GetDmRmcControllerForCpu2Chassis(key, name, typeName, ipid, chassis, num, parentDev);
|
||||
if (typeName == "hdbasetrx" || typeName == "dmrmc4k100c1g")
|
||||
{
|
||||
useChassisForOfflineFeedback = true;
|
||||
}
|
||||
}
|
||||
if (useChassisForOfflineFeedback)
|
||||
{
|
||||
Debug.Console(0, "DM endpoint output {0} does not have direct online feedback, changing online feedback to chassis", num);
|
||||
rx.IsOnline.SetValueFunc(() => controller.OutputEndpointOnlineFeedbacks[num].BoolValue);
|
||||
controller.OutputEndpointOnlineFeedbacks[num].OutputChange += (o, a) =>
|
||||
{
|
||||
foreach (var feedback in rx.Feedbacks)
|
||||
{
|
||||
if (feedback != null)
|
||||
feedback.FireUpdate();
|
||||
}
|
||||
};
|
||||
}
|
||||
return rx;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -410,31 +497,31 @@ namespace PepperDash.Essentials.DM
|
||||
key, pKey);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static CrestronGenericBaseDevice GetDmRmcControllerForCpu2Chassis(string key, string name, string typeName,
|
||||
uint ipid, Switch chassis, uint num, IKeyed parentDev)
|
||||
{
|
||||
Func<string, string, uint, DMOutput, CrestronGenericBaseDevice> handler;
|
||||
if (ChassisDict.TryGetValue(typeName.ToLower(), out handler))
|
||||
{
|
||||
return handler(key, name, ipid, chassis.Outputs[num]);
|
||||
}
|
||||
Debug.Console(0, "Cannot create DM-RMC of type '{0}' with parent device {1}", typeName, parentDev.Key);
|
||||
return null;
|
||||
}
|
||||
private static CrestronGenericBaseDevice GetDmRmcControllerForCpu2Chassis(string key, string name, string typeName,
|
||||
uint ipid, Switch chassis, uint num, IKeyed parentDev)
|
||||
{
|
||||
Func<string, string, uint, DMOutput, CrestronGenericBaseDevice> handler;
|
||||
if (ChassisDict.TryGetValue(typeName.ToLower(), out handler))
|
||||
{
|
||||
return handler(key, name, ipid, chassis.Outputs[num]);
|
||||
}
|
||||
Debug.Console(0, "Cannot create DM-RMC of type '{0}' with parent device {1}", typeName, parentDev.Key);
|
||||
return null;
|
||||
}
|
||||
|
||||
private static CrestronGenericBaseDevice GetDmRmcControllerForCpu3Chassis(string key, string name, string typeName,
|
||||
Switch chassis, uint num, IKeyed parentDev)
|
||||
{
|
||||
Func<string, string, DMOutput, CrestronGenericBaseDevice> cpu3Handler;
|
||||
if (ChassisCpu3Dict.TryGetValue(typeName.ToLower(), out cpu3Handler))
|
||||
{
|
||||
return cpu3Handler(key, name, chassis.Outputs[num]);
|
||||
}
|
||||
Debug.Console(0, "Cannot create DM-RMC of type '{0}' with parent device {1}", typeName, parentDev.Key);
|
||||
return null;
|
||||
}
|
||||
private static CrestronGenericBaseDevice GetDmRmcControllerForCpu3Chassis(string key, string name, string typeName,
|
||||
Switch chassis, uint num, IKeyed parentDev)
|
||||
{
|
||||
Func<string, string, DMOutput, CrestronGenericBaseDevice> cpu3Handler;
|
||||
if (ChassisCpu3Dict.TryGetValue(typeName.ToLower(), out cpu3Handler))
|
||||
{
|
||||
return cpu3Handler(key, name, chassis.Outputs[num]);
|
||||
}
|
||||
Debug.Console(0, "Cannot create DM-RMC of type '{0}' with parent device {1}", typeName, parentDev.Key);
|
||||
return null;
|
||||
}
|
||||
|
||||
private static CrestronGenericBaseDevice GetDmRmcControllerForDmps(string key, string name, string typeName,
|
||||
uint ipid, DmpsRoutingController controller, uint num)
|
||||
@@ -458,51 +545,49 @@ namespace PepperDash.Essentials.DM
|
||||
return null;
|
||||
}
|
||||
|
||||
private static CrestronGenericBaseDevice GetDmRmcControllerForDmps4k(string key, string name, string typeName,
|
||||
DmpsRoutingController controller, uint num)
|
||||
{
|
||||
Func<string, string, DMOutput, CrestronGenericBaseDevice> dmps4kHandler;
|
||||
if (ChassisCpu3Dict.TryGetValue(typeName.ToLower(), out dmps4kHandler))
|
||||
{
|
||||
var output = controller.Dmps.SwitcherOutputs[num] as DMOutput;
|
||||
private static CrestronGenericBaseDevice GetDmRmcControllerForDmps4k(string key, string name, string typeName,
|
||||
DmpsRoutingController controller, uint num)
|
||||
{
|
||||
Func<string, string, DMOutput, CrestronGenericBaseDevice> dmps4kHandler;
|
||||
if (ChassisCpu3Dict.TryGetValue(typeName.ToLower(), out dmps4kHandler))
|
||||
{
|
||||
var output = controller.Dmps.SwitcherOutputs[num] as DMOutput;
|
||||
|
||||
if (output != null)
|
||||
{
|
||||
return dmps4kHandler(key, name, output);
|
||||
}
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Error,
|
||||
"Cannot attach DM-RMC of type '{0}' to output {1} on DMPS-4K chassis. Output is not a DM Output.",
|
||||
typeName, num);
|
||||
return null;
|
||||
}
|
||||
if (output != null)
|
||||
{
|
||||
return dmps4kHandler(key, name, output);
|
||||
}
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Error,
|
||||
"Cannot attach DM-RMC of type '{0}' to output {1} on DMPS-4K chassis. Output is not a DM Output.",
|
||||
typeName, num);
|
||||
return null;
|
||||
}
|
||||
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Error, "Cannot create DM-RMC of type '{0}' to output {1} on DMPS-4K chassis", typeName, num);
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static CrestronGenericBaseDevice GetDmRmcControllerForProcessor(string key, string name, string typeName, uint ipid)
|
||||
{
|
||||
try
|
||||
{
|
||||
Func<string, string, uint, CrestronGenericBaseDevice> handler;
|
||||
private static CrestronGenericBaseDevice GetDmRmcControllerForProcessor(string key, string name, string typeName, uint ipid)
|
||||
{
|
||||
try
|
||||
{
|
||||
Func<string, string, uint, CrestronGenericBaseDevice> handler;
|
||||
|
||||
if (ProcessorFactoryDict.TryGetValue(typeName.ToLower(), out handler))
|
||||
{
|
||||
return handler(key, name, ipid);
|
||||
}
|
||||
Debug.Console(0, "Cannot create DM-RMC of type: '{0}'", typeName);
|
||||
if (ProcessorFactoryDict.TryGetValue(typeName.ToLower(), out handler))
|
||||
{
|
||||
return handler(key, name, ipid);
|
||||
}
|
||||
Debug.Console(0, "Cannot create DM-RMC of type: '{0}'", typeName);
|
||||
|
||||
return null;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(0, "[{0}] WARNING: Cannot create DM-RMC device: {1}", key, e.Message);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(0, "[{0}] WARNING: Cannot create DM-RMC device: {1}", key, e.Message);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class DmRmcControllerFactory : EssentialsDeviceFactory<DmRmcControllerBase>
|
||||
{
|
||||
@@ -522,7 +607,7 @@ namespace PepperDash.Essentials.DM
|
||||
|
||||
var props = JsonConvert.DeserializeObject
|
||||
<DmRmcPropertiesConfig>(dc.Properties.ToString());
|
||||
return DmRmcHelper.GetDmRmcController(dc.Key, dc.Name, type, props);
|
||||
return DmRmcHelper.GetDmRmcController(dc.Key, dc.Name, type, props);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,41 +1,41 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Crestron.SimplSharpPro.DM;
|
||||
using Crestron.SimplSharpPro.DM.Endpoints;
|
||||
using Crestron.SimplSharpPro.DM.Endpoints.Transmitters;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Bridges;
|
||||
|
||||
namespace PepperDash.Essentials.DM
|
||||
{
|
||||
// using eVst = Crestron.SimplSharpPro.DeviceSupport.eX02VideoSourceType;
|
||||
|
||||
/// <summary>
|
||||
/// Controller class for all DM-TX-201C/S/F transmitters
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Crestron.SimplSharpPro.DM;
|
||||
using Crestron.SimplSharpPro.DM.Endpoints;
|
||||
using Crestron.SimplSharpPro.DM.Endpoints.Transmitters;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Bridges;
|
||||
|
||||
namespace PepperDash.Essentials.DM
|
||||
{
|
||||
// using eVst = Crestron.SimplSharpPro.DeviceSupport.eX02VideoSourceType;
|
||||
|
||||
/// <summary>
|
||||
/// Controller class for all DM-TX-201C/S/F transmitters
|
||||
/// </summary>
|
||||
[Description("Wrapper class for DM-TX-200-C")]
|
||||
public class DmTx200Controller : DmTxControllerBase, ITxRoutingWithFeedback, IHasFreeRun, IVgaBrightnessContrastControls
|
||||
{
|
||||
public DmTx200C2G Tx { get; private set; }
|
||||
|
||||
public RoutingInputPortWithVideoStatuses HdmiInput { get; private set; }
|
||||
public RoutingInputPortWithVideoStatuses VgaInput { get; private set; }
|
||||
public RoutingOutputPort DmOutput { get; private set; }
|
||||
|
||||
public override StringFeedback ActiveVideoInputFeedback { get; protected set; }
|
||||
public IntFeedback VideoSourceNumericFeedback { get; protected set; }
|
||||
public IntFeedback AudioSourceNumericFeedback { get; protected set; }
|
||||
public IntFeedback HdmiInHdcpCapabilityFeedback { get; protected set; } //actually state
|
||||
public BoolFeedback HdmiVideoSyncFeedback { get; protected set; }
|
||||
public BoolFeedback VgaVideoSyncFeedback { get; protected set; }
|
||||
|
||||
public BoolFeedback FreeRunEnabledFeedback { get; protected set; }
|
||||
|
||||
public IntFeedback VgaBrightnessFeedback { get; protected set; }
|
||||
public class DmTx200Controller : DmTxControllerBase, ITxRoutingWithFeedback, IHasFreeRun, IVgaBrightnessContrastControls
|
||||
{
|
||||
public DmTx200C2G Tx { get; private set; }
|
||||
|
||||
public RoutingInputPortWithVideoStatuses HdmiInput { get; private set; }
|
||||
public RoutingInputPortWithVideoStatuses VgaInput { get; private set; }
|
||||
public RoutingOutputPort DmOutput { get; private set; }
|
||||
|
||||
public override StringFeedback ActiveVideoInputFeedback { get; protected set; }
|
||||
public IntFeedback VideoSourceNumericFeedback { get; protected set; }
|
||||
public IntFeedback AudioSourceNumericFeedback { get; protected set; }
|
||||
public IntFeedback HdmiInHdcpCapabilityFeedback { get; protected set; } //actually state
|
||||
public BoolFeedback HdmiVideoSyncFeedback { get; protected set; }
|
||||
public BoolFeedback VgaVideoSyncFeedback { get; protected set; }
|
||||
|
||||
public BoolFeedback FreeRunEnabledFeedback { get; protected set; }
|
||||
|
||||
public IntFeedback VgaBrightnessFeedback { get; protected set; }
|
||||
public IntFeedback VgaContrastFeedback { get; protected set; }
|
||||
|
||||
//IroutingNumericEvent
|
||||
@@ -49,57 +49,57 @@ namespace PepperDash.Essentials.DM
|
||||
{
|
||||
var newEvent = NumericSwitchChange;
|
||||
if (newEvent != null) newEvent(this, e);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Helps get the "real" inputs, including when in Auto
|
||||
/// </summary>
|
||||
public DmTx200Base.eSourceSelection ActualActiveVideoInput
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Tx.VideoSourceFeedback == DmTx200Base.eSourceSelection.Digital ||
|
||||
Tx.VideoSourceFeedback == DmTx200Base.eSourceSelection.Analog ||
|
||||
Tx.VideoSourceFeedback == DmTx200Base.eSourceSelection.Disable)
|
||||
return Tx.VideoSourceFeedback;
|
||||
if (Tx.HdmiInput.SyncDetectedFeedback.BoolValue)
|
||||
return DmTx200Base.eSourceSelection.Digital;
|
||||
|
||||
return Tx.VgaInput.SyncDetectedFeedback.BoolValue ? DmTx200Base.eSourceSelection.Analog : DmTx200Base.eSourceSelection.Disable;
|
||||
}
|
||||
}
|
||||
|
||||
public RoutingPortCollection<RoutingInputPort> InputPorts
|
||||
{
|
||||
get
|
||||
{
|
||||
return new RoutingPortCollection<RoutingInputPort>
|
||||
{
|
||||
HdmiInput,
|
||||
VgaInput,
|
||||
AnyVideoInput
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public RoutingPortCollection<RoutingOutputPort> OutputPorts
|
||||
{
|
||||
get
|
||||
{
|
||||
return new RoutingPortCollection<RoutingOutputPort> { DmOutput };
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <param name="name"></param>
|
||||
/// <param name="tx"></param>
|
||||
public DmTx200Controller(string key, string name, DmTx200C2G tx, bool preventRegistration)
|
||||
: base(key, name, tx)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Helps get the "real" inputs, including when in Auto
|
||||
/// </summary>
|
||||
public DmTx200Base.eSourceSelection ActualActiveVideoInput
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Tx.VideoSourceFeedback == DmTx200Base.eSourceSelection.Digital ||
|
||||
Tx.VideoSourceFeedback == DmTx200Base.eSourceSelection.Analog ||
|
||||
Tx.VideoSourceFeedback == DmTx200Base.eSourceSelection.Disable)
|
||||
return Tx.VideoSourceFeedback;
|
||||
if (Tx.HdmiInput.SyncDetectedFeedback.BoolValue)
|
||||
return DmTx200Base.eSourceSelection.Digital;
|
||||
|
||||
return Tx.VgaInput.SyncDetectedFeedback.BoolValue ? DmTx200Base.eSourceSelection.Analog : DmTx200Base.eSourceSelection.Disable;
|
||||
}
|
||||
}
|
||||
|
||||
public RoutingPortCollection<RoutingInputPort> InputPorts
|
||||
{
|
||||
get
|
||||
{
|
||||
return new RoutingPortCollection<RoutingInputPort>
|
||||
{
|
||||
HdmiInput,
|
||||
VgaInput,
|
||||
AnyVideoInput
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public RoutingPortCollection<RoutingOutputPort> OutputPorts
|
||||
{
|
||||
get
|
||||
{
|
||||
return new RoutingPortCollection<RoutingOutputPort> { DmOutput };
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <param name="name"></param>
|
||||
/// <param name="tx"></param>
|
||||
public DmTx200Controller(string key, string name, DmTx200C2G tx, bool preventRegistration)
|
||||
: base(key, name, tx)
|
||||
{
|
||||
Tx = tx;
|
||||
PreventRegistration = preventRegistration;
|
||||
|
||||
@@ -116,300 +116,300 @@ namespace PepperDash.Essentials.DM
|
||||
VideoStatusHelper.GetVgaInputStatusFuncs(tx.VgaInput))
|
||||
{
|
||||
FeedbackMatchObject = DmTx200Base.eSourceSelection.Analog
|
||||
};
|
||||
|
||||
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
||||
() => ActualActiveVideoInput.ToString());
|
||||
|
||||
Tx.HdmiInput.InputStreamChange += InputStreamChangeEvent;
|
||||
Tx.VgaInput.InputStreamChange += VgaInputOnInputStreamChange;
|
||||
Tx.BaseEvent += Tx_BaseEvent;
|
||||
Tx.OnlineStatusChange += Tx_OnlineStatusChange;
|
||||
|
||||
VideoSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback);
|
||||
AudioSourceNumericFeedback = new IntFeedback(() => (int)Tx.AudioSourceFeedback);
|
||||
|
||||
};
|
||||
|
||||
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
||||
() => ActualActiveVideoInput.ToString());
|
||||
|
||||
Tx.HdmiInput.InputStreamChange += InputStreamChangeEvent;
|
||||
Tx.VgaInput.InputStreamChange += VgaInputOnInputStreamChange;
|
||||
Tx.BaseEvent += Tx_BaseEvent;
|
||||
Tx.OnlineStatusChange += Tx_OnlineStatusChange;
|
||||
|
||||
VideoSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback);
|
||||
AudioSourceNumericFeedback = new IntFeedback(() => (int)Tx.AudioSourceFeedback);
|
||||
|
||||
HdmiInHdcpCapabilityFeedback = new IntFeedback("HdmiInHdcpCapability", () => tx.HdmiInput.HdcpSupportOnFeedback.BoolValue ? 1 : 0);
|
||||
|
||||
//setting this on the base class so that we can get it easily on the chassis.
|
||||
HdcpStateFeedback = HdmiInHdcpCapabilityFeedback;
|
||||
|
||||
HdcpSupportCapability = eHdcpCapabilityType.HdcpAutoSupport;
|
||||
|
||||
HdmiVideoSyncFeedback = new BoolFeedback(() => tx.HdmiInput.SyncDetectedFeedback.BoolValue);
|
||||
|
||||
VgaVideoSyncFeedback = new BoolFeedback(() => tx.VgaInput.SyncDetectedFeedback.BoolValue);
|
||||
|
||||
FreeRunEnabledFeedback = new BoolFeedback(() => tx.VgaInput.FreeRunFeedback == eDmFreeRunSetting.Enabled);
|
||||
|
||||
VgaBrightnessFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.BrightnessFeedback.UShortValue);
|
||||
VgaContrastFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.ContrastFeedback.UShortValue);
|
||||
|
||||
tx.VgaInput.VideoControls.ControlChange += VideoControls_ControlChange;
|
||||
|
||||
|
||||
var combinedFuncs = new VideoStatusFuncsWrapper
|
||||
{
|
||||
HdcpActiveFeedbackFunc = () =>
|
||||
(ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital
|
||||
&& tx.HdmiInput.VideoAttributes.HdcpActiveFeedback.BoolValue),
|
||||
|
||||
HdcpStateFeedbackFunc = () => ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital ? tx.HdmiInput.VideoAttributes.HdcpStateFeedback.ToString() : "",
|
||||
|
||||
VideoResolutionFeedbackFunc = () =>
|
||||
{
|
||||
if (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital)
|
||||
return tx.HdmiInput.VideoAttributes.GetVideoResolutionString();
|
||||
return ActualActiveVideoInput == DmTx200Base.eSourceSelection.Analog ? tx.VgaInput.VideoAttributes.GetVideoResolutionString() : "";
|
||||
},
|
||||
VideoSyncFeedbackFunc = () =>
|
||||
(ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital
|
||||
&& tx.HdmiInput.SyncDetectedFeedback.BoolValue)
|
||||
|| (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Analog
|
||||
&& tx.VgaInput.SyncDetectedFeedback.BoolValue)
|
||||
|| (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Auto
|
||||
&& (tx.VgaInput.SyncDetectedFeedback.BoolValue || tx.HdmiInput.SyncDetectedFeedback.BoolValue))
|
||||
|
||||
};
|
||||
|
||||
AnyVideoInput = new RoutingInputPortWithVideoStatuses(DmPortName.AnyVideoIn,
|
||||
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.None, 0, this, combinedFuncs);
|
||||
|
||||
DmOutput = new RoutingOutputPort(DmPortName.DmOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
||||
eRoutingPortConnectionType.DmCat, null, this);
|
||||
|
||||
AddToFeedbackList(ActiveVideoInputFeedback, VideoSourceNumericFeedback, AudioSourceNumericFeedback,
|
||||
AnyVideoInput.VideoStatus.HasVideoStatusFeedback, AnyVideoInput.VideoStatus.HdcpActiveFeedback,
|
||||
AnyVideoInput.VideoStatus.HdcpStateFeedback, AnyVideoInput.VideoStatus.VideoResolutionFeedback,
|
||||
AnyVideoInput.VideoStatus.VideoSyncFeedback, HdmiInHdcpCapabilityFeedback, HdmiVideoSyncFeedback,
|
||||
VgaVideoSyncFeedback);
|
||||
|
||||
// Set Ports for CEC
|
||||
HdmiInput.Port = Tx.HdmiInput;
|
||||
VgaInput.Port = Tx.VgaInput;
|
||||
DmOutput.Port = Tx.DmOutput;
|
||||
}
|
||||
|
||||
private void VgaInputOnInputStreamChange(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
|
||||
{
|
||||
switch (args.EventId)
|
||||
{
|
||||
case EndpointInputStreamEventIds.FreeRunFeedbackEventId:
|
||||
FreeRunEnabledFeedback.FireUpdate();
|
||||
break;
|
||||
case EndpointInputStreamEventIds.SyncDetectedFeedbackEventId:
|
||||
VgaVideoSyncFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void VideoControls_ControlChange(object sender, GenericEventArgs args)
|
||||
{
|
||||
var id = args.EventId;
|
||||
Debug.Console(2, this, "EventId {0}", args.EventId);
|
||||
|
||||
switch (id)
|
||||
{
|
||||
case VideoControlsEventIds.BrightnessFeedbackEventId:
|
||||
VgaBrightnessFeedback.FireUpdate();
|
||||
break;
|
||||
case VideoControlsEventIds.ContrastFeedbackEventId:
|
||||
VgaContrastFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
HdcpStateFeedback = HdmiInHdcpCapabilityFeedback;
|
||||
|
||||
HdcpSupportCapability = eHdcpCapabilityType.HdcpAutoSupport;
|
||||
|
||||
HdmiVideoSyncFeedback = new BoolFeedback(() => tx.HdmiInput.SyncDetectedFeedback.BoolValue);
|
||||
|
||||
VgaVideoSyncFeedback = new BoolFeedback(() => tx.VgaInput.SyncDetectedFeedback.BoolValue);
|
||||
|
||||
FreeRunEnabledFeedback = new BoolFeedback(() => tx.VgaInput.FreeRunFeedback == eDmFreeRunSetting.Enabled);
|
||||
|
||||
VgaBrightnessFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.BrightnessFeedback.UShortValue);
|
||||
VgaContrastFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.ContrastFeedback.UShortValue);
|
||||
|
||||
tx.VgaInput.VideoControls.ControlChange += VideoControls_ControlChange;
|
||||
|
||||
|
||||
var combinedFuncs = new VideoStatusFuncsWrapper
|
||||
{
|
||||
HdcpActiveFeedbackFunc = () =>
|
||||
(ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital
|
||||
&& tx.HdmiInput.VideoAttributes.HdcpActiveFeedback.BoolValue),
|
||||
|
||||
HdcpStateFeedbackFunc = () => ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital ? tx.HdmiInput.VideoAttributes.HdcpStateFeedback.ToString() : "",
|
||||
|
||||
VideoResolutionFeedbackFunc = () =>
|
||||
{
|
||||
if (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital)
|
||||
return tx.HdmiInput.VideoAttributes.GetVideoResolutionString();
|
||||
return ActualActiveVideoInput == DmTx200Base.eSourceSelection.Analog ? tx.VgaInput.VideoAttributes.GetVideoResolutionString() : "";
|
||||
},
|
||||
VideoSyncFeedbackFunc = () =>
|
||||
(ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital
|
||||
&& tx.HdmiInput.SyncDetectedFeedback.BoolValue)
|
||||
|| (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Analog
|
||||
&& tx.VgaInput.SyncDetectedFeedback.BoolValue)
|
||||
|| (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Auto
|
||||
&& (tx.VgaInput.SyncDetectedFeedback.BoolValue || tx.HdmiInput.SyncDetectedFeedback.BoolValue))
|
||||
|
||||
};
|
||||
|
||||
AnyVideoInput = new RoutingInputPortWithVideoStatuses(DmPortName.AnyVideoIn,
|
||||
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.None, 0, this, combinedFuncs);
|
||||
|
||||
DmOutput = new RoutingOutputPort(DmPortName.DmOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
||||
eRoutingPortConnectionType.DmCat, null, this);
|
||||
|
||||
AddToFeedbackList(ActiveVideoInputFeedback, VideoSourceNumericFeedback, AudioSourceNumericFeedback,
|
||||
AnyVideoInput.VideoStatus.HasVideoStatusFeedback, AnyVideoInput.VideoStatus.HdcpActiveFeedback,
|
||||
AnyVideoInput.VideoStatus.HdcpStateFeedback, AnyVideoInput.VideoStatus.VideoResolutionFeedback,
|
||||
AnyVideoInput.VideoStatus.VideoSyncFeedback, HdmiInHdcpCapabilityFeedback, HdmiVideoSyncFeedback,
|
||||
VgaVideoSyncFeedback);
|
||||
|
||||
// Set Ports for CEC
|
||||
HdmiInput.Port = Tx.HdmiInput;
|
||||
VgaInput.Port = Tx.VgaInput;
|
||||
DmOutput.Port = Tx.DmOutput;
|
||||
}
|
||||
|
||||
private void VgaInputOnInputStreamChange(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
|
||||
{
|
||||
switch (args.EventId)
|
||||
{
|
||||
case EndpointInputStreamEventIds.FreeRunFeedbackEventId:
|
||||
FreeRunEnabledFeedback.FireUpdate();
|
||||
break;
|
||||
case EndpointInputStreamEventIds.SyncDetectedFeedbackEventId:
|
||||
VgaVideoSyncFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void VideoControls_ControlChange(object sender, GenericEventArgs args)
|
||||
{
|
||||
var id = args.EventId;
|
||||
Debug.Console(2, this, "EventId {0}", args.EventId);
|
||||
|
||||
switch (id)
|
||||
{
|
||||
case VideoControlsEventIds.BrightnessFeedbackEventId:
|
||||
VgaBrightnessFeedback.FireUpdate();
|
||||
break;
|
||||
case VideoControlsEventIds.ContrastFeedbackEventId:
|
||||
VgaContrastFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Tx_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
|
||||
{
|
||||
var localVideoInputPort =
|
||||
InputPorts.FirstOrDefault(p => (DmTx200Base.eSourceSelection) p.Selector == Tx.VideoSourceFeedback);
|
||||
var localAudioInputPort =
|
||||
InputPorts.FirstOrDefault(p => (DmTx200Base.eSourceSelection) p.Selector == Tx.AudioSourceFeedback);
|
||||
|
||||
|
||||
ActiveVideoInputFeedback.FireUpdate();
|
||||
VideoSourceNumericFeedback.FireUpdate();
|
||||
InputPorts.FirstOrDefault(p => (DmTx200Base.eSourceSelection) p.Selector == Tx.AudioSourceFeedback);
|
||||
|
||||
|
||||
ActiveVideoInputFeedback.FireUpdate();
|
||||
VideoSourceNumericFeedback.FireUpdate();
|
||||
AudioSourceNumericFeedback.FireUpdate();
|
||||
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, OutputPorts.First(), localVideoInputPort, eRoutingSignalType.Video));
|
||||
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, OutputPorts.First(), localAudioInputPort, eRoutingSignalType.Audio));
|
||||
}
|
||||
|
||||
public override bool CustomActivate()
|
||||
{
|
||||
|
||||
Tx.HdmiInput.InputStreamChange += (o, a) => FowardInputStreamChange(HdmiInput, a.EventId);
|
||||
Tx.HdmiInput.VideoAttributes.AttributeChange += (o, a) => FireVideoAttributeChange(HdmiInput, a.EventId);
|
||||
|
||||
Tx.VgaInput.InputStreamChange += (o, a) => FowardInputStreamChange(VgaInput, a.EventId);
|
||||
Tx.VgaInput.VideoAttributes.AttributeChange += (o, a) => FireVideoAttributeChange(VgaInput, a.EventId);
|
||||
|
||||
// Base does register and sets up comm monitoring.
|
||||
return base.CustomActivate();
|
||||
}
|
||||
|
||||
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||
{
|
||||
var joinMap = GetDmTxJoinMap(joinStart, joinMapKey);
|
||||
|
||||
if (HdmiVideoSyncFeedback != null)
|
||||
{
|
||||
HdmiVideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Input1VideoSyncStatus.JoinNumber]);
|
||||
}
|
||||
if (VgaVideoSyncFeedback != null)
|
||||
{
|
||||
VgaVideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Input2VideoSyncStatus.JoinNumber]);
|
||||
}
|
||||
|
||||
LinkDmTxToApi(this, trilist, joinMap, bridge);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Enables or disables free run
|
||||
/// </summary>
|
||||
/// <param name="enable"></param>
|
||||
public void SetFreeRunEnabled(bool enable)
|
||||
{
|
||||
Tx.VgaInput.FreeRun = enable ? eDmFreeRunSetting.Enabled : eDmFreeRunSetting.Disabled;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the VGA brightness level
|
||||
/// </summary>
|
||||
/// <param name="level"></param>
|
||||
public void SetVgaBrightness(ushort level)
|
||||
{
|
||||
Tx.VgaInput.VideoControls.Brightness.UShortValue = level;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the VGA contrast level
|
||||
/// </summary>
|
||||
/// <param name="level"></param>
|
||||
public void SetVgaContrast(ushort level)
|
||||
{
|
||||
Tx.VgaInput.VideoControls.Contrast.UShortValue = level;
|
||||
}
|
||||
|
||||
public void ExecuteNumericSwitch(ushort input, ushort output, eRoutingSignalType type)
|
||||
{
|
||||
Debug.Console(2, this, "Executing Numeric Switch to input {0}.", input);
|
||||
|
||||
switch (input)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
ExecuteSwitch(DmTx200Base.eSourceSelection.Auto, null, type);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
ExecuteSwitch(HdmiInput.Selector, null, type);
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
ExecuteSwitch(VgaInput.Selector, null, type);
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
ExecuteSwitch(DmTx200Base.eSourceSelection.Disable, null, type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType signalType)
|
||||
{
|
||||
if ((signalType | eRoutingSignalType.Video) == eRoutingSignalType.Video)
|
||||
Tx.VideoSource = (DmTx200Base.eSourceSelection)inputSelector;
|
||||
if ((signalType | eRoutingSignalType.Audio) == eRoutingSignalType.Audio)
|
||||
Tx.AudioSource = (DmTx200Base.eSourceSelection)inputSelector;
|
||||
}
|
||||
|
||||
void Tx_BaseEvent(GenericBase device, BaseEventArgs args)
|
||||
{
|
||||
var id = args.EventId;
|
||||
Debug.Console(2, this, "EventId {0}", args.EventId);
|
||||
|
||||
switch (id)
|
||||
{
|
||||
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, OutputPorts.First(), localAudioInputPort, eRoutingSignalType.Audio));
|
||||
}
|
||||
|
||||
public override bool CustomActivate()
|
||||
{
|
||||
|
||||
Tx.HdmiInput.InputStreamChange += (o, a) => FowardInputStreamChange(HdmiInput, a.EventId);
|
||||
Tx.HdmiInput.VideoAttributes.AttributeChange += (o, a) => FireVideoAttributeChange(HdmiInput, a.EventId);
|
||||
|
||||
Tx.VgaInput.InputStreamChange += (o, a) => FowardInputStreamChange(VgaInput, a.EventId);
|
||||
Tx.VgaInput.VideoAttributes.AttributeChange += (o, a) => FireVideoAttributeChange(VgaInput, a.EventId);
|
||||
|
||||
// Base does register and sets up comm monitoring.
|
||||
return base.CustomActivate();
|
||||
}
|
||||
|
||||
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||
{
|
||||
var joinMap = GetDmTxJoinMap(joinStart, joinMapKey);
|
||||
|
||||
if (HdmiVideoSyncFeedback != null)
|
||||
{
|
||||
HdmiVideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Input1VideoSyncStatus.JoinNumber]);
|
||||
}
|
||||
if (VgaVideoSyncFeedback != null)
|
||||
{
|
||||
VgaVideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Input2VideoSyncStatus.JoinNumber]);
|
||||
}
|
||||
|
||||
LinkDmTxToApi(this, trilist, joinMap, bridge);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Enables or disables free run
|
||||
/// </summary>
|
||||
/// <param name="enable"></param>
|
||||
public void SetFreeRunEnabled(bool enable)
|
||||
{
|
||||
Tx.VgaInput.FreeRun = enable ? eDmFreeRunSetting.Enabled : eDmFreeRunSetting.Disabled;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the VGA brightness level
|
||||
/// </summary>
|
||||
/// <param name="level"></param>
|
||||
public void SetVgaBrightness(ushort level)
|
||||
{
|
||||
Tx.VgaInput.VideoControls.Brightness.UShortValue = level;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the VGA contrast level
|
||||
/// </summary>
|
||||
/// <param name="level"></param>
|
||||
public void SetVgaContrast(ushort level)
|
||||
{
|
||||
Tx.VgaInput.VideoControls.Contrast.UShortValue = level;
|
||||
}
|
||||
|
||||
public void ExecuteNumericSwitch(ushort input, ushort output, eRoutingSignalType type)
|
||||
{
|
||||
Debug.Console(2, this, "Executing Numeric Switch to input {0}.", input);
|
||||
|
||||
switch (input)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
ExecuteSwitch(DmTx200Base.eSourceSelection.Auto, null, type);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
ExecuteSwitch(HdmiInput.Selector, null, type);
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
ExecuteSwitch(VgaInput.Selector, null, type);
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
ExecuteSwitch(DmTx200Base.eSourceSelection.Disable, null, type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType signalType)
|
||||
{
|
||||
if ((signalType | eRoutingSignalType.Video) == eRoutingSignalType.Video)
|
||||
Tx.VideoSource = (DmTx200Base.eSourceSelection)inputSelector;
|
||||
if ((signalType | eRoutingSignalType.Audio) == eRoutingSignalType.Audio)
|
||||
Tx.AudioSource = (DmTx200Base.eSourceSelection)inputSelector;
|
||||
}
|
||||
|
||||
void Tx_BaseEvent(GenericBase device, BaseEventArgs args)
|
||||
{
|
||||
var id = args.EventId;
|
||||
Debug.Console(2, this, "EventId {0}", args.EventId);
|
||||
|
||||
switch (id)
|
||||
{
|
||||
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
|
||||
var localVideoInputPort = InputPorts.FirstOrDefault(p => (DmTx200Base.eSourceSelection)p.Selector == Tx.VideoSourceFeedback);
|
||||
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
|
||||
VideoSourceNumericFeedback.FireUpdate();
|
||||
var localVideoInputPort = InputPorts.FirstOrDefault(p => (DmTx200Base.eSourceSelection)p.Selector == Tx.VideoSourceFeedback);
|
||||
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
|
||||
VideoSourceNumericFeedback.FireUpdate();
|
||||
ActiveVideoInputFeedback.FireUpdate();
|
||||
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, OutputPorts.First(), localVideoInputPort, eRoutingSignalType.Video));
|
||||
break;
|
||||
break;
|
||||
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
|
||||
var localInputAudioPort = InputPorts.FirstOrDefault(p => (DmTx200Base.eSourceSelection)p.Selector == Tx.AudioSourceFeedback);
|
||||
Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback);
|
||||
var localInputAudioPort = InputPorts.FirstOrDefault(p => (DmTx200Base.eSourceSelection)p.Selector == Tx.AudioSourceFeedback);
|
||||
Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback);
|
||||
AudioSourceNumericFeedback.FireUpdate();
|
||||
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, OutputPorts.First(), localInputAudioPort, eRoutingSignalType.Audio));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void InputStreamChangeEvent(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
|
||||
{
|
||||
Debug.Console(2, "{0} event {1} stream {2}", Tx.ToString(), inputStream.ToString(), args.EventId.ToString());
|
||||
|
||||
switch (args.EventId)
|
||||
{
|
||||
case EndpointInputStreamEventIds.HdcpSupportOffFeedbackEventId:
|
||||
HdmiInHdcpCapabilityFeedback.FireUpdate();
|
||||
break;
|
||||
case EndpointInputStreamEventIds.HdcpSupportOnFeedbackEventId:
|
||||
HdmiInHdcpCapabilityFeedback.FireUpdate();
|
||||
break;
|
||||
case EndpointInputStreamEventIds.SyncDetectedFeedbackEventId:
|
||||
HdmiVideoSyncFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Relays the input stream change to the appropriate RoutingInputPort.
|
||||
/// </summary>
|
||||
void FowardInputStreamChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
|
||||
{
|
||||
if (eventId != EndpointInputStreamEventIds.SyncDetectedFeedbackEventId)
|
||||
{
|
||||
return;
|
||||
}
|
||||
inputPort.VideoStatus.VideoSyncFeedback.FireUpdate();
|
||||
AnyVideoInput.VideoStatus.VideoSyncFeedback.FireUpdate();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Relays the VideoAttributes change to a RoutingInputPort
|
||||
/// </summary>
|
||||
void FireVideoAttributeChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
|
||||
{
|
||||
//// LOCATION: Crestron.SimplSharpPro.DM.VideoAttributeEventIds
|
||||
//Debug.Console(2, this, "VideoAttributes_AttributeChange event id={0} from {1}",
|
||||
// args.EventId, (sender as VideoAttributesEnhanced).Owner.GetType());
|
||||
switch (eventId)
|
||||
{
|
||||
case VideoAttributeEventIds.HdcpActiveFeedbackEventId:
|
||||
inputPort.VideoStatus.HdcpActiveFeedback.FireUpdate();
|
||||
AnyVideoInput.VideoStatus.HdcpActiveFeedback.FireUpdate();
|
||||
break;
|
||||
case VideoAttributeEventIds.HdcpStateFeedbackEventId:
|
||||
inputPort.VideoStatus.HdcpStateFeedback.FireUpdate();
|
||||
AnyVideoInput.VideoStatus.HdcpStateFeedback.FireUpdate();
|
||||
break;
|
||||
case VideoAttributeEventIds.HorizontalResolutionFeedbackEventId:
|
||||
case VideoAttributeEventIds.VerticalResolutionFeedbackEventId:
|
||||
inputPort.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
||||
AnyVideoInput.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
||||
break;
|
||||
case VideoAttributeEventIds.FramesPerSecondFeedbackEventId:
|
||||
inputPort.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
||||
AnyVideoInput.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, OutputPorts.First(), localInputAudioPort, eRoutingSignalType.Audio));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void InputStreamChangeEvent(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
|
||||
{
|
||||
Debug.Console(2, "{0} event {1} stream {2}", Tx.ToString(), inputStream.ToString(), args.EventId.ToString());
|
||||
|
||||
switch (args.EventId)
|
||||
{
|
||||
case EndpointInputStreamEventIds.HdcpSupportOffFeedbackEventId:
|
||||
HdmiInHdcpCapabilityFeedback.FireUpdate();
|
||||
break;
|
||||
case EndpointInputStreamEventIds.HdcpSupportOnFeedbackEventId:
|
||||
HdmiInHdcpCapabilityFeedback.FireUpdate();
|
||||
break;
|
||||
case EndpointInputStreamEventIds.SyncDetectedFeedbackEventId:
|
||||
HdmiVideoSyncFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Relays the input stream change to the appropriate RoutingInputPort.
|
||||
/// </summary>
|
||||
void FowardInputStreamChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
|
||||
{
|
||||
if (eventId != EndpointInputStreamEventIds.SyncDetectedFeedbackEventId)
|
||||
{
|
||||
return;
|
||||
}
|
||||
inputPort.VideoStatus.VideoSyncFeedback.FireUpdate();
|
||||
AnyVideoInput.VideoStatus.VideoSyncFeedback.FireUpdate();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Relays the VideoAttributes change to a RoutingInputPort
|
||||
/// </summary>
|
||||
void FireVideoAttributeChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
|
||||
{
|
||||
//// LOCATION: Crestron.SimplSharpPro.DM.VideoAttributeEventIds
|
||||
//Debug.Console(2, this, "VideoAttributes_AttributeChange event id={0} from {1}",
|
||||
// args.EventId, (sender as VideoAttributesEnhanced).Owner.GetType());
|
||||
switch (eventId)
|
||||
{
|
||||
case VideoAttributeEventIds.HdcpActiveFeedbackEventId:
|
||||
inputPort.VideoStatus.HdcpActiveFeedback.FireUpdate();
|
||||
AnyVideoInput.VideoStatus.HdcpActiveFeedback.FireUpdate();
|
||||
break;
|
||||
case VideoAttributeEventIds.HdcpStateFeedbackEventId:
|
||||
inputPort.VideoStatus.HdcpStateFeedback.FireUpdate();
|
||||
AnyVideoInput.VideoStatus.HdcpStateFeedback.FireUpdate();
|
||||
break;
|
||||
case VideoAttributeEventIds.HorizontalResolutionFeedbackEventId:
|
||||
case VideoAttributeEventIds.VerticalResolutionFeedbackEventId:
|
||||
inputPort.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
||||
AnyVideoInput.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
||||
break;
|
||||
case VideoAttributeEventIds.FramesPerSecondFeedbackEventId:
|
||||
inputPort.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
||||
AnyVideoInput.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -8,33 +8,33 @@ using System.Linq;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Bridges;
|
||||
|
||||
namespace PepperDash.Essentials.DM
|
||||
{
|
||||
/// <summary>
|
||||
/// Controller class for all DM-TX-201C/S/F transmitters
|
||||
using PepperDash.Essentials.Core.Bridges;
|
||||
|
||||
namespace PepperDash.Essentials.DM
|
||||
{
|
||||
/// <summary>
|
||||
/// Controller class for all DM-TX-201C/S/F transmitters
|
||||
/// </summary>
|
||||
[Description("Wrapper class for DM-TX-201-C")]
|
||||
public class DmTx201CController : DmTxControllerBase, ITxRoutingWithFeedback, IHasFreeRun, IVgaBrightnessContrastControls
|
||||
{
|
||||
public DmTx201C Tx { get; private set; }
|
||||
|
||||
public RoutingInputPortWithVideoStatuses HdmiInput { get; private set; }
|
||||
public RoutingInputPortWithVideoStatuses VgaInput { get; private set; }
|
||||
public RoutingOutputPort DmOutput { get; private set; }
|
||||
public RoutingOutputPort HdmiLoopOut { get; private set; }
|
||||
|
||||
public override StringFeedback ActiveVideoInputFeedback { get; protected set; }
|
||||
public IntFeedback VideoSourceNumericFeedback { get; protected set; }
|
||||
public IntFeedback AudioSourceNumericFeedback { get; protected set; }
|
||||
public IntFeedback HdmiInHdcpCapabilityFeedback { get; protected set; }
|
||||
public BoolFeedback HdmiVideoSyncFeedback { get; protected set; }
|
||||
public BoolFeedback VgaVideoSyncFeedback { get; protected set; }
|
||||
|
||||
public BoolFeedback FreeRunEnabledFeedback { get; protected set; }
|
||||
|
||||
public IntFeedback VgaBrightnessFeedback { get; protected set; }
|
||||
public class DmTx201CController : DmTxControllerBase, ITxRoutingWithFeedback, IHasFreeRun, IVgaBrightnessContrastControls
|
||||
{
|
||||
public DmTx201C Tx { get; private set; }
|
||||
|
||||
public RoutingInputPortWithVideoStatuses HdmiInput { get; private set; }
|
||||
public RoutingInputPortWithVideoStatuses VgaInput { get; private set; }
|
||||
public RoutingOutputPort DmOutput { get; private set; }
|
||||
public RoutingOutputPort HdmiLoopOut { get; private set; }
|
||||
|
||||
public override StringFeedback ActiveVideoInputFeedback { get; protected set; }
|
||||
public IntFeedback VideoSourceNumericFeedback { get; protected set; }
|
||||
public IntFeedback AudioSourceNumericFeedback { get; protected set; }
|
||||
public IntFeedback HdmiInHdcpCapabilityFeedback { get; protected set; }
|
||||
public BoolFeedback HdmiVideoSyncFeedback { get; protected set; }
|
||||
public BoolFeedback VgaVideoSyncFeedback { get; protected set; }
|
||||
|
||||
public BoolFeedback FreeRunEnabledFeedback { get; protected set; }
|
||||
|
||||
public IntFeedback VgaBrightnessFeedback { get; protected set; }
|
||||
public IntFeedback VgaContrastFeedback { get; protected set; }
|
||||
|
||||
//IroutingNumericEvent
|
||||
@@ -48,61 +48,61 @@ namespace PepperDash.Essentials.DM
|
||||
{
|
||||
var newEvent = NumericSwitchChange;
|
||||
if (newEvent != null) newEvent(this, e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Helps get the "real" inputs, including when in Auto
|
||||
/// </summary>
|
||||
public DmTx200Base.eSourceSelection ActualActiveVideoInput
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Tx.VideoSourceFeedback == DmTx200Base.eSourceSelection.Digital ||
|
||||
Tx.VideoSourceFeedback == DmTx200Base.eSourceSelection.Analog ||
|
||||
Tx.VideoSourceFeedback == DmTx200Base.eSourceSelection.Disable)
|
||||
return Tx.VideoSourceFeedback;
|
||||
else // auto
|
||||
{
|
||||
if (Tx.HdmiInput.SyncDetectedFeedback.BoolValue)
|
||||
return DmTx200Base.eSourceSelection.Digital;
|
||||
else if (Tx.VgaInput.SyncDetectedFeedback.BoolValue)
|
||||
return DmTx200Base.eSourceSelection.Analog;
|
||||
else
|
||||
return DmTx200Base.eSourceSelection.Disable;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public RoutingPortCollection<RoutingInputPort> InputPorts
|
||||
{
|
||||
get
|
||||
{
|
||||
return new RoutingPortCollection<RoutingInputPort>
|
||||
{
|
||||
HdmiInput,
|
||||
VgaInput,
|
||||
AnyVideoInput
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public RoutingPortCollection<RoutingOutputPort> OutputPorts
|
||||
{
|
||||
get
|
||||
{
|
||||
return new RoutingPortCollection<RoutingOutputPort> { DmOutput, HdmiLoopOut };
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <param name="name"></param>
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Helps get the "real" inputs, including when in Auto
|
||||
/// </summary>
|
||||
public DmTx200Base.eSourceSelection ActualActiveVideoInput
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Tx.VideoSourceFeedback == DmTx200Base.eSourceSelection.Digital ||
|
||||
Tx.VideoSourceFeedback == DmTx200Base.eSourceSelection.Analog ||
|
||||
Tx.VideoSourceFeedback == DmTx200Base.eSourceSelection.Disable)
|
||||
return Tx.VideoSourceFeedback;
|
||||
else // auto
|
||||
{
|
||||
if (Tx.HdmiInput.SyncDetectedFeedback.BoolValue)
|
||||
return DmTx200Base.eSourceSelection.Digital;
|
||||
else if (Tx.VgaInput.SyncDetectedFeedback.BoolValue)
|
||||
return DmTx200Base.eSourceSelection.Analog;
|
||||
else
|
||||
return DmTx200Base.eSourceSelection.Disable;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public RoutingPortCollection<RoutingInputPort> InputPorts
|
||||
{
|
||||
get
|
||||
{
|
||||
return new RoutingPortCollection<RoutingInputPort>
|
||||
{
|
||||
HdmiInput,
|
||||
VgaInput,
|
||||
AnyVideoInput
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public RoutingPortCollection<RoutingOutputPort> OutputPorts
|
||||
{
|
||||
get
|
||||
{
|
||||
return new RoutingPortCollection<RoutingOutputPort> { DmOutput, HdmiLoopOut };
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <param name="name"></param>
|
||||
/// <param name="tx"></param>
|
||||
public DmTx201CController(string key, string name, DmTx201C tx, bool preventRegistration)
|
||||
: base(key, name, tx)
|
||||
{
|
||||
public DmTx201CController(string key, string name, DmTx201C tx, bool preventRegistration)
|
||||
: base(key, name, tx)
|
||||
{
|
||||
Tx = tx;
|
||||
PreventRegistration = preventRegistration;
|
||||
|
||||
@@ -119,89 +119,89 @@ namespace PepperDash.Essentials.DM
|
||||
VideoStatusHelper.GetVgaInputStatusFuncs(tx.VgaInput))
|
||||
{
|
||||
FeedbackMatchObject = DmTx200Base.eSourceSelection.Analog
|
||||
};
|
||||
|
||||
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
||||
() => ActualActiveVideoInput.ToString());
|
||||
|
||||
};
|
||||
|
||||
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
||||
() => ActualActiveVideoInput.ToString());
|
||||
|
||||
Tx.HdmiInput.InputStreamChange += InputStreamChangeEvent;
|
||||
Tx.VgaInput.InputStreamChange += VgaInputOnInputStreamChange;
|
||||
Tx.BaseEvent += Tx_BaseEvent;
|
||||
Tx.OnlineStatusChange += new OnlineStatusChangeEventHandler(Tx_OnlineStatusChange);
|
||||
|
||||
VideoSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback);
|
||||
|
||||
Tx.VgaInput.InputStreamChange += VgaInputOnInputStreamChange;
|
||||
Tx.BaseEvent += Tx_BaseEvent;
|
||||
Tx.OnlineStatusChange += new OnlineStatusChangeEventHandler(Tx_OnlineStatusChange);
|
||||
|
||||
VideoSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback);
|
||||
|
||||
AudioSourceNumericFeedback = new IntFeedback(() => (int)Tx.AudioSourceFeedback);
|
||||
|
||||
HdmiInHdcpCapabilityFeedback = new IntFeedback("HdmiInHdcpCapability", () =>
|
||||
(tx.HdmiInput.HdcpSupportOnFeedback.BoolValue ? 1 : 0));
|
||||
|
||||
HdcpStateFeedback = HdmiInHdcpCapabilityFeedback;
|
||||
|
||||
HdmiVideoSyncFeedback = new BoolFeedback(() => (bool)tx.HdmiInput.SyncDetectedFeedback.BoolValue);
|
||||
|
||||
VgaVideoSyncFeedback = new BoolFeedback(() => (bool)tx.VgaInput.SyncDetectedFeedback.BoolValue);
|
||||
|
||||
FreeRunEnabledFeedback = new BoolFeedback(() => tx.VgaInput.FreeRunFeedback == eDmFreeRunSetting.Enabled);
|
||||
|
||||
VgaBrightnessFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.BrightnessFeedback.UShortValue);
|
||||
|
||||
VgaContrastFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.ContrastFeedback.UShortValue);
|
||||
|
||||
tx.VgaInput.VideoControls.ControlChange += VideoControls_ControlChange;
|
||||
|
||||
HdcpSupportCapability = eHdcpCapabilityType.HdcpAutoSupport;
|
||||
|
||||
var combinedFuncs = new VideoStatusFuncsWrapper
|
||||
{
|
||||
HdcpActiveFeedbackFunc = () =>
|
||||
(ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital
|
||||
&& tx.HdmiInput.VideoAttributes.HdcpActiveFeedback.BoolValue),
|
||||
HdcpStateFeedback = HdmiInHdcpCapabilityFeedback;
|
||||
|
||||
HdcpStateFeedbackFunc = () => ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital ?
|
||||
tx.HdmiInput.VideoAttributes.HdcpStateFeedback.ToString() : "",
|
||||
|
||||
VideoResolutionFeedbackFunc = () =>
|
||||
{
|
||||
if (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital)
|
||||
return tx.HdmiInput.VideoAttributes.GetVideoResolutionString();
|
||||
return ActualActiveVideoInput == DmTx200Base.eSourceSelection.Analog ?
|
||||
tx.VgaInput.VideoAttributes.GetVideoResolutionString() : "";
|
||||
},
|
||||
|
||||
VideoSyncFeedbackFunc = () =>
|
||||
(ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital
|
||||
&& tx.HdmiInput.SyncDetectedFeedback.BoolValue)
|
||||
|| (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Analog
|
||||
&& tx.VgaInput.SyncDetectedFeedback.BoolValue)
|
||||
|| (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Auto
|
||||
&& (tx.VgaInput.SyncDetectedFeedback.BoolValue || tx.HdmiInput.SyncDetectedFeedback.BoolValue))
|
||||
|
||||
};
|
||||
|
||||
AnyVideoInput = new RoutingInputPortWithVideoStatuses(DmPortName.AnyVideoIn,
|
||||
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.None, 0, this, combinedFuncs);
|
||||
|
||||
DmOutput = new RoutingOutputPort(DmPortName.DmOut, eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DmCat, null, this);
|
||||
HdmiLoopOut = new RoutingOutputPort(DmPortName.HdmiLoopOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
||||
eRoutingPortConnectionType.Hdmi, null, this);
|
||||
|
||||
AddToFeedbackList(ActiveVideoInputFeedback, VideoSourceNumericFeedback, AudioSourceNumericFeedback,
|
||||
AnyVideoInput.VideoStatus.HasVideoStatusFeedback, AnyVideoInput.VideoStatus.HdcpActiveFeedback,
|
||||
AnyVideoInput.VideoStatus.HdcpStateFeedback, AnyVideoInput.VideoStatus.VideoResolutionFeedback,
|
||||
AnyVideoInput.VideoStatus.VideoSyncFeedback, HdmiInHdcpCapabilityFeedback, HdmiVideoSyncFeedback,
|
||||
VgaVideoSyncFeedback);
|
||||
|
||||
// Set Ports for CEC
|
||||
HdmiInput.Port = Tx.HdmiInput;
|
||||
VgaInput.Port = Tx.VgaInput;
|
||||
HdmiLoopOut.Port = Tx.HdmiOutput;
|
||||
DmOutput.Port = Tx.DmOutput;
|
||||
}
|
||||
|
||||
void VideoControls_ControlChange(object sender, Crestron.SimplSharpPro.DeviceSupport.GenericEventArgs args)
|
||||
{
|
||||
var id = args.EventId;
|
||||
HdmiVideoSyncFeedback = new BoolFeedback(() => (bool)tx.HdmiInput.SyncDetectedFeedback.BoolValue);
|
||||
|
||||
VgaVideoSyncFeedback = new BoolFeedback(() => (bool)tx.VgaInput.SyncDetectedFeedback.BoolValue);
|
||||
|
||||
FreeRunEnabledFeedback = new BoolFeedback(() => tx.VgaInput.FreeRunFeedback == eDmFreeRunSetting.Enabled);
|
||||
|
||||
VgaBrightnessFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.BrightnessFeedback.UShortValue);
|
||||
|
||||
VgaContrastFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.ContrastFeedback.UShortValue);
|
||||
|
||||
tx.VgaInput.VideoControls.ControlChange += VideoControls_ControlChange;
|
||||
|
||||
HdcpSupportCapability = eHdcpCapabilityType.HdcpAutoSupport;
|
||||
|
||||
var combinedFuncs = new VideoStatusFuncsWrapper
|
||||
{
|
||||
HdcpActiveFeedbackFunc = () =>
|
||||
(ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital
|
||||
&& tx.HdmiInput.VideoAttributes.HdcpActiveFeedback.BoolValue),
|
||||
|
||||
HdcpStateFeedbackFunc = () => ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital ?
|
||||
tx.HdmiInput.VideoAttributes.HdcpStateFeedback.ToString() : "",
|
||||
|
||||
VideoResolutionFeedbackFunc = () =>
|
||||
{
|
||||
if (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital)
|
||||
return tx.HdmiInput.VideoAttributes.GetVideoResolutionString();
|
||||
return ActualActiveVideoInput == DmTx200Base.eSourceSelection.Analog ?
|
||||
tx.VgaInput.VideoAttributes.GetVideoResolutionString() : "";
|
||||
},
|
||||
|
||||
VideoSyncFeedbackFunc = () =>
|
||||
(ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital
|
||||
&& tx.HdmiInput.SyncDetectedFeedback.BoolValue)
|
||||
|| (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Analog
|
||||
&& tx.VgaInput.SyncDetectedFeedback.BoolValue)
|
||||
|| (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Auto
|
||||
&& (tx.VgaInput.SyncDetectedFeedback.BoolValue || tx.HdmiInput.SyncDetectedFeedback.BoolValue))
|
||||
|
||||
};
|
||||
|
||||
AnyVideoInput = new RoutingInputPortWithVideoStatuses(DmPortName.AnyVideoIn,
|
||||
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.None, 0, this, combinedFuncs);
|
||||
|
||||
DmOutput = new RoutingOutputPort(DmPortName.DmOut, eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DmCat, null, this);
|
||||
HdmiLoopOut = new RoutingOutputPort(DmPortName.HdmiLoopOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
||||
eRoutingPortConnectionType.Hdmi, null, this);
|
||||
|
||||
AddToFeedbackList(ActiveVideoInputFeedback, VideoSourceNumericFeedback, AudioSourceNumericFeedback,
|
||||
AnyVideoInput.VideoStatus.HasVideoStatusFeedback, AnyVideoInput.VideoStatus.HdcpActiveFeedback,
|
||||
AnyVideoInput.VideoStatus.HdcpStateFeedback, AnyVideoInput.VideoStatus.VideoResolutionFeedback,
|
||||
AnyVideoInput.VideoStatus.VideoSyncFeedback, HdmiInHdcpCapabilityFeedback, HdmiVideoSyncFeedback,
|
||||
VgaVideoSyncFeedback);
|
||||
|
||||
// Set Ports for CEC
|
||||
HdmiInput.Port = Tx.HdmiInput;
|
||||
VgaInput.Port = Tx.VgaInput;
|
||||
HdmiLoopOut.Port = Tx.HdmiOutput;
|
||||
DmOutput.Port = Tx.DmOutput;
|
||||
}
|
||||
|
||||
void VideoControls_ControlChange(object sender, Crestron.SimplSharpPro.DeviceSupport.GenericEventArgs args)
|
||||
{
|
||||
var id = args.EventId;
|
||||
Debug.Console(2, this, "EventId {0}", args.EventId);
|
||||
|
||||
switch (id)
|
||||
@@ -212,7 +212,7 @@ namespace PepperDash.Essentials.DM
|
||||
case VideoControlsEventIds.ContrastFeedbackEventId:
|
||||
VgaContrastFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Tx_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
|
||||
@@ -228,7 +228,7 @@ namespace PepperDash.Essentials.DM
|
||||
AudioSourceNumericFeedback.FireUpdate();
|
||||
OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, OutputPorts.First(), localVideoInputPort, eRoutingSignalType.Video));
|
||||
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, OutputPorts.First(), localAudioInputPort, eRoutingSignalType.Audio));
|
||||
}
|
||||
}
|
||||
|
||||
private void VgaInputOnInputStreamChange(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
|
||||
{
|
||||
@@ -241,107 +241,107 @@ namespace PepperDash.Essentials.DM
|
||||
VgaVideoSyncFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool CustomActivate()
|
||||
{
|
||||
Tx.HdmiInput.InputStreamChange += (o, a) => FowardInputStreamChange(HdmiInput, a.EventId);
|
||||
Tx.HdmiInput.VideoAttributes.AttributeChange += (o, a) => FireVideoAttributeChange(HdmiInput, a.EventId);
|
||||
|
||||
Tx.VgaInput.InputStreamChange += (o, a) => FowardInputStreamChange(VgaInput, a.EventId);
|
||||
Tx.VgaInput.VideoAttributes.AttributeChange += (o, a) => FireVideoAttributeChange(VgaInput, a.EventId);
|
||||
|
||||
// Base does register and sets up comm monitoring.
|
||||
return base.CustomActivate();
|
||||
}
|
||||
|
||||
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||
{
|
||||
var joinMap = GetDmTxJoinMap(joinStart, joinMapKey);
|
||||
|
||||
if (HdmiVideoSyncFeedback != null)
|
||||
{
|
||||
HdmiVideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Input1VideoSyncStatus.JoinNumber]);
|
||||
}
|
||||
if (VgaVideoSyncFeedback != null)
|
||||
{
|
||||
VgaVideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Input2VideoSyncStatus.JoinNumber]);
|
||||
}
|
||||
|
||||
LinkDmTxToApi(this, trilist, joinMap, bridge);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Enables or disables free run
|
||||
/// </summary>
|
||||
/// <param name="enable"></param>
|
||||
public void SetFreeRunEnabled(bool enable)
|
||||
}
|
||||
|
||||
public override bool CustomActivate()
|
||||
{
|
||||
Tx.HdmiInput.InputStreamChange += (o, a) => FowardInputStreamChange(HdmiInput, a.EventId);
|
||||
Tx.HdmiInput.VideoAttributes.AttributeChange += (o, a) => FireVideoAttributeChange(HdmiInput, a.EventId);
|
||||
|
||||
Tx.VgaInput.InputStreamChange += (o, a) => FowardInputStreamChange(VgaInput, a.EventId);
|
||||
Tx.VgaInput.VideoAttributes.AttributeChange += (o, a) => FireVideoAttributeChange(VgaInput, a.EventId);
|
||||
|
||||
// Base does register and sets up comm monitoring.
|
||||
return base.CustomActivate();
|
||||
}
|
||||
|
||||
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||
{
|
||||
Tx.VgaInput.FreeRun = enable ? eDmFreeRunSetting.Enabled : eDmFreeRunSetting.Disabled;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the VGA brightness level
|
||||
/// </summary>
|
||||
/// <param name="level"></param>
|
||||
public void SetVgaBrightness(ushort level)
|
||||
{
|
||||
Tx.VgaInput.VideoControls.Brightness.UShortValue = level;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the VGA contrast level
|
||||
/// </summary>
|
||||
/// <param name="level"></param>
|
||||
public void SetVgaContrast(ushort level)
|
||||
{
|
||||
Tx.VgaInput.VideoControls.Contrast.UShortValue = level;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Switches the audio/video source based on the integer value (0-Auto, 1-HDMI, 2-VGA, 3-Disable)
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <param name="output"></param>
|
||||
/// <param name="type"></param>
|
||||
public void ExecuteNumericSwitch(ushort input, ushort output, eRoutingSignalType type)
|
||||
{
|
||||
Debug.Console(2, this, "Executing Numeric Switch to input {0}.", input);
|
||||
|
||||
switch (input)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
ExecuteSwitch(DmTx200Base.eSourceSelection.Auto, null, type);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
ExecuteSwitch(HdmiInput.Selector, null, type);
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
ExecuteSwitch(VgaInput.Selector, null, type);
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
ExecuteSwitch(DmTx200Base.eSourceSelection.Disable, null, type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType signalType)
|
||||
{
|
||||
if((signalType | eRoutingSignalType.Video) == eRoutingSignalType.Video)
|
||||
Tx.VideoSource = (DmTx200Base.eSourceSelection)inputSelector;
|
||||
if ((signalType | eRoutingSignalType.Audio) == eRoutingSignalType.Audio)
|
||||
Tx.AudioSource = (DmTx200Base.eSourceSelection)inputSelector;
|
||||
}
|
||||
|
||||
void Tx_BaseEvent(GenericBase device, BaseEventArgs args)
|
||||
var joinMap = GetDmTxJoinMap(joinStart, joinMapKey);
|
||||
|
||||
if (HdmiVideoSyncFeedback != null)
|
||||
{
|
||||
HdmiVideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Input1VideoSyncStatus.JoinNumber]);
|
||||
}
|
||||
if (VgaVideoSyncFeedback != null)
|
||||
{
|
||||
VgaVideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Input2VideoSyncStatus.JoinNumber]);
|
||||
}
|
||||
|
||||
LinkDmTxToApi(this, trilist, joinMap, bridge);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Enables or disables free run
|
||||
/// </summary>
|
||||
/// <param name="enable"></param>
|
||||
public void SetFreeRunEnabled(bool enable)
|
||||
{
|
||||
Tx.VgaInput.FreeRun = enable ? eDmFreeRunSetting.Enabled : eDmFreeRunSetting.Disabled;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the VGA brightness level
|
||||
/// </summary>
|
||||
/// <param name="level"></param>
|
||||
public void SetVgaBrightness(ushort level)
|
||||
{
|
||||
Tx.VgaInput.VideoControls.Brightness.UShortValue = level;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the VGA contrast level
|
||||
/// </summary>
|
||||
/// <param name="level"></param>
|
||||
public void SetVgaContrast(ushort level)
|
||||
{
|
||||
Tx.VgaInput.VideoControls.Contrast.UShortValue = level;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Switches the audio/video source based on the integer value (0-Auto, 1-HDMI, 2-VGA, 3-Disable)
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <param name="output"></param>
|
||||
/// <param name="type"></param>
|
||||
public void ExecuteNumericSwitch(ushort input, ushort output, eRoutingSignalType type)
|
||||
{
|
||||
Debug.Console(2, this, "Executing Numeric Switch to input {0}.", input);
|
||||
|
||||
switch (input)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
ExecuteSwitch(DmTx200Base.eSourceSelection.Auto, null, type);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
ExecuteSwitch(HdmiInput.Selector, null, type);
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
ExecuteSwitch(VgaInput.Selector, null, type);
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
ExecuteSwitch(DmTx200Base.eSourceSelection.Disable, null, type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType signalType)
|
||||
{
|
||||
if((signalType | eRoutingSignalType.Video) == eRoutingSignalType.Video)
|
||||
Tx.VideoSource = (DmTx200Base.eSourceSelection)inputSelector;
|
||||
if ((signalType | eRoutingSignalType.Audio) == eRoutingSignalType.Audio)
|
||||
Tx.AudioSource = (DmTx200Base.eSourceSelection)inputSelector;
|
||||
}
|
||||
|
||||
void Tx_BaseEvent(GenericBase device, BaseEventArgs args)
|
||||
{
|
||||
var id = args.EventId;
|
||||
Debug.Console(2, this, "EventId {0}", args.EventId);
|
||||
@@ -361,11 +361,11 @@ namespace PepperDash.Essentials.DM
|
||||
AudioSourceNumericFeedback.FireUpdate();
|
||||
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, OutputPorts.First(), localInputAudioPort, eRoutingSignalType.Audio));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void InputStreamChangeEvent(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
void InputStreamChangeEvent(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
|
||||
{
|
||||
Debug.Console(2, "{0} event {1} stream {2}", Tx.ToString(), inputStream.ToString(), args.EventId.ToString());
|
||||
|
||||
switch (args.EventId)
|
||||
@@ -379,52 +379,52 @@ namespace PepperDash.Essentials.DM
|
||||
case EndpointInputStreamEventIds.SyncDetectedFeedbackEventId:
|
||||
HdmiVideoSyncFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Relays the input stream change to the appropriate RoutingInputPort.
|
||||
/// </summary>
|
||||
void FowardInputStreamChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
|
||||
{
|
||||
if (eventId != EndpointInputStreamEventIds.SyncDetectedFeedbackEventId)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Relays the input stream change to the appropriate RoutingInputPort.
|
||||
/// </summary>
|
||||
void FowardInputStreamChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
|
||||
{
|
||||
if (eventId != EndpointInputStreamEventIds.SyncDetectedFeedbackEventId)
|
||||
{
|
||||
return;
|
||||
return;
|
||||
}
|
||||
inputPort.VideoStatus.VideoSyncFeedback.FireUpdate();
|
||||
AnyVideoInput.VideoStatus.VideoSyncFeedback.FireUpdate();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Relays the VideoAttributes change to a RoutingInputPort
|
||||
/// </summary>
|
||||
void FireVideoAttributeChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
|
||||
{
|
||||
//// LOCATION: Crestron.SimplSharpPro.DM.VideoAttributeEventIds
|
||||
//Debug.Console(2, this, "VideoAttributes_AttributeChange event id={0} from {1}",
|
||||
// args.EventId, (sender as VideoAttributesEnhanced).Owner.GetType());
|
||||
switch (eventId)
|
||||
{
|
||||
case VideoAttributeEventIds.HdcpActiveFeedbackEventId:
|
||||
inputPort.VideoStatus.HdcpActiveFeedback.FireUpdate();
|
||||
AnyVideoInput.VideoStatus.HdcpActiveFeedback.FireUpdate();
|
||||
break;
|
||||
case VideoAttributeEventIds.HdcpStateFeedbackEventId:
|
||||
inputPort.VideoStatus.HdcpStateFeedback.FireUpdate();
|
||||
AnyVideoInput.VideoStatus.HdcpStateFeedback.FireUpdate();
|
||||
break;
|
||||
case VideoAttributeEventIds.HorizontalResolutionFeedbackEventId:
|
||||
case VideoAttributeEventIds.VerticalResolutionFeedbackEventId:
|
||||
inputPort.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
||||
AnyVideoInput.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
||||
break;
|
||||
case VideoAttributeEventIds.FramesPerSecondFeedbackEventId:
|
||||
inputPort.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
||||
AnyVideoInput.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
AnyVideoInput.VideoStatus.VideoSyncFeedback.FireUpdate();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Relays the VideoAttributes change to a RoutingInputPort
|
||||
/// </summary>
|
||||
void FireVideoAttributeChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
|
||||
{
|
||||
//// LOCATION: Crestron.SimplSharpPro.DM.VideoAttributeEventIds
|
||||
//Debug.Console(2, this, "VideoAttributes_AttributeChange event id={0} from {1}",
|
||||
// args.EventId, (sender as VideoAttributesEnhanced).Owner.GetType());
|
||||
switch (eventId)
|
||||
{
|
||||
case VideoAttributeEventIds.HdcpActiveFeedbackEventId:
|
||||
inputPort.VideoStatus.HdcpActiveFeedback.FireUpdate();
|
||||
AnyVideoInput.VideoStatus.HdcpActiveFeedback.FireUpdate();
|
||||
break;
|
||||
case VideoAttributeEventIds.HdcpStateFeedbackEventId:
|
||||
inputPort.VideoStatus.HdcpStateFeedback.FireUpdate();
|
||||
AnyVideoInput.VideoStatus.HdcpStateFeedback.FireUpdate();
|
||||
break;
|
||||
case VideoAttributeEventIds.HorizontalResolutionFeedbackEventId:
|
||||
case VideoAttributeEventIds.VerticalResolutionFeedbackEventId:
|
||||
inputPort.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
||||
AnyVideoInput.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
||||
break;
|
||||
case VideoAttributeEventIds.FramesPerSecondFeedbackEventId:
|
||||
inputPort.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
||||
AnyVideoInput.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -78,6 +78,8 @@ namespace PepperDash.Essentials.DM
|
||||
IsOnline.SetValueFunc(() => controller.InputEndpointOnlineFeedbacks[num].BoolValue);
|
||||
controller.InputEndpointOnlineFeedbacks[num].OutputChange += (o, a) => IsOnline.FireUpdate();
|
||||
}
|
||||
PreventRegistration = true;
|
||||
tx.Register();
|
||||
}
|
||||
|
||||
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||
|
||||
@@ -1,42 +1,42 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
//using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Crestron.SimplSharpPro.DM;
|
||||
using Crestron.SimplSharpPro.DM.Endpoints;
|
||||
using Crestron.SimplSharpPro.DM.Endpoints.Transmitters;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Bridges;
|
||||
using PepperDash.Essentials.DM.Config;
|
||||
|
||||
namespace PepperDash.Essentials.DM
|
||||
{
|
||||
using eVst = Crestron.SimplSharpPro.DeviceSupport.eX02VideoSourceType;
|
||||
using eAst = Crestron.SimplSharpPro.DeviceSupport.eX02AudioSourceType;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
//using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Crestron.SimplSharpPro.DM;
|
||||
using Crestron.SimplSharpPro.DM.Endpoints;
|
||||
using Crestron.SimplSharpPro.DM.Endpoints.Transmitters;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Bridges;
|
||||
using PepperDash.Essentials.DM.Config;
|
||||
|
||||
namespace PepperDash.Essentials.DM
|
||||
{
|
||||
using eVst = Crestron.SimplSharpPro.DeviceSupport.eX02VideoSourceType;
|
||||
using eAst = Crestron.SimplSharpPro.DeviceSupport.eX02AudioSourceType;
|
||||
|
||||
[Description("Wrapper class for DM-TX-4K-202-C")]
|
||||
public class DmTx4k202CController : DmTxControllerBase, ITxRoutingWithFeedback, IHasFeedback,
|
||||
IIROutputPorts, IComPorts
|
||||
{
|
||||
public DmTx4k202C Tx { get; private set; }
|
||||
|
||||
public RoutingInputPortWithVideoStatuses HdmiIn1 { get; private set; }
|
||||
public RoutingInputPortWithVideoStatuses HdmiIn2 { get; private set; }
|
||||
public RoutingOutputPort DmOut { get; private set; }
|
||||
public RoutingOutputPort HdmiLoopOut { get; private set; }
|
||||
|
||||
public override StringFeedback ActiveVideoInputFeedback { get; protected set; }
|
||||
public IntFeedback VideoSourceNumericFeedback { get; protected set; }
|
||||
public IntFeedback AudioSourceNumericFeedback { get; protected set; }
|
||||
public IntFeedback HdmiIn1HdcpCapabilityFeedback { get; protected set; }
|
||||
public IntFeedback HdmiIn2HdcpCapabilityFeedback { get; protected set; }
|
||||
public BoolFeedback Hdmi1VideoSyncFeedback { get; protected set; }
|
||||
public class DmTx4k202CController : DmTxControllerBase, ITxRoutingWithFeedback, IHasFeedback,
|
||||
IIROutputPorts, IComPorts
|
||||
{
|
||||
public DmTx4k202C Tx { get; private set; }
|
||||
|
||||
public RoutingInputPortWithVideoStatuses HdmiIn1 { get; private set; }
|
||||
public RoutingInputPortWithVideoStatuses HdmiIn2 { get; private set; }
|
||||
public RoutingOutputPort DmOut { get; private set; }
|
||||
public RoutingOutputPort HdmiLoopOut { get; private set; }
|
||||
|
||||
public override StringFeedback ActiveVideoInputFeedback { get; protected set; }
|
||||
public IntFeedback VideoSourceNumericFeedback { get; protected set; }
|
||||
public IntFeedback AudioSourceNumericFeedback { get; protected set; }
|
||||
public IntFeedback HdmiIn1HdcpCapabilityFeedback { get; protected set; }
|
||||
public IntFeedback HdmiIn2HdcpCapabilityFeedback { get; protected set; }
|
||||
public BoolFeedback Hdmi1VideoSyncFeedback { get; protected set; }
|
||||
public BoolFeedback Hdmi2VideoSyncFeedback { get; protected set; }
|
||||
|
||||
//IroutingNumericEvent
|
||||
@@ -50,50 +50,50 @@ namespace PepperDash.Essentials.DM
|
||||
{
|
||||
var newEvent = NumericSwitchChange;
|
||||
if (newEvent != null) newEvent(this, e);
|
||||
}
|
||||
|
||||
|
||||
//public override IntFeedback HdcpSupportAllFeedback { get; protected set; }
|
||||
//public override ushort HdcpSupportCapability { get; protected set; }
|
||||
|
||||
/// <summary>
|
||||
/// Helps get the "real" inputs, including when in Auto
|
||||
/// </summary>
|
||||
public Crestron.SimplSharpPro.DeviceSupport.eX02VideoSourceType ActualActiveVideoInput
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Tx.VideoSourceFeedback != eVst.Auto)
|
||||
return Tx.VideoSourceFeedback;
|
||||
else // auto
|
||||
{
|
||||
if (Tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue)
|
||||
return eVst.Hdmi1;
|
||||
else if (Tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue)
|
||||
return eVst.Hdmi2;
|
||||
else
|
||||
return eVst.AllDisabled;
|
||||
}
|
||||
}
|
||||
}
|
||||
public RoutingPortCollection<RoutingInputPort> InputPorts
|
||||
{
|
||||
get
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//public override IntFeedback HdcpSupportAllFeedback { get; protected set; }
|
||||
//public override ushort HdcpSupportCapability { get; protected set; }
|
||||
|
||||
/// <summary>
|
||||
/// Helps get the "real" inputs, including when in Auto
|
||||
/// </summary>
|
||||
public Crestron.SimplSharpPro.DeviceSupport.eX02VideoSourceType ActualActiveVideoInput
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Tx.VideoSourceFeedback != eVst.Auto)
|
||||
return Tx.VideoSourceFeedback;
|
||||
else // auto
|
||||
{
|
||||
if (Tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue)
|
||||
return eVst.Hdmi1;
|
||||
else if (Tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue)
|
||||
return eVst.Hdmi2;
|
||||
else
|
||||
return eVst.AllDisabled;
|
||||
}
|
||||
}
|
||||
}
|
||||
public RoutingPortCollection<RoutingInputPort> InputPorts
|
||||
{
|
||||
get
|
||||
{
|
||||
return new RoutingPortCollection<RoutingInputPort>
|
||||
{
|
||||
HdmiIn1,
|
||||
HdmiIn2,
|
||||
AnyVideoInput
|
||||
};
|
||||
}
|
||||
}
|
||||
public RoutingPortCollection<RoutingOutputPort> OutputPorts
|
||||
{
|
||||
get
|
||||
{
|
||||
return new RoutingPortCollection<RoutingOutputPort> { DmOut, HdmiLoopOut };
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
public RoutingPortCollection<RoutingOutputPort> OutputPorts
|
||||
{
|
||||
get
|
||||
{
|
||||
return new RoutingPortCollection<RoutingOutputPort> { DmOut, HdmiLoopOut };
|
||||
}
|
||||
}
|
||||
|
||||
public DmTx4k202CController(string key, string name, DmTx4k202C tx, bool preventRegistration)
|
||||
@@ -127,28 +127,23 @@ namespace PepperDash.Essentials.DM
|
||||
|
||||
Tx.OnlineStatusChange += Tx_OnlineStatusChange;
|
||||
|
||||
VideoSourceNumericFeedback = new IntFeedback(() => (int) Tx.VideoSourceFeedback);
|
||||
VideoSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback);
|
||||
|
||||
AudioSourceNumericFeedback = new IntFeedback(() => (int) Tx.AudioSourceFeedback);
|
||||
AudioSourceNumericFeedback = new IntFeedback(() => (int)Tx.AudioSourceFeedback);
|
||||
|
||||
HdmiIn1HdcpCapabilityFeedback = new IntFeedback("HdmiIn1HdcpCapability",
|
||||
() => (int) tx.HdmiInputs[1].HdcpCapabilityFeedback);
|
||||
() => (int)tx.HdmiInputs[1].HdcpCapabilityFeedback);
|
||||
|
||||
HdmiIn2HdcpCapabilityFeedback = new IntFeedback("HdmiIn2HdcpCapability",
|
||||
() => (int) tx.HdmiInputs[2].HdcpCapabilityFeedback);
|
||||
|
||||
HdcpStateFeedback =
|
||||
new IntFeedback(
|
||||
() =>
|
||||
tx.HdmiInputs[1].HdcpCapabilityFeedback > tx.HdmiInputs[2].HdcpCapabilityFeedback
|
||||
? (int) tx.HdmiInputs[1].HdcpCapabilityFeedback
|
||||
: (int) tx.HdmiInputs[2].HdcpCapabilityFeedback);
|
||||
() => (int)tx.HdmiInputs[2].HdcpCapabilityFeedback);
|
||||
|
||||
HdcpSupportCapability = eHdcpCapabilityType.Hdcp2_2Support;
|
||||
|
||||
Hdmi1VideoSyncFeedback = new BoolFeedback(() => (bool) tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue);
|
||||
HdcpStateFeedback = new IntFeedback(() => (int)HdcpSupportCapability);
|
||||
|
||||
Hdmi2VideoSyncFeedback = new BoolFeedback(() => (bool) tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue);
|
||||
Hdmi1VideoSyncFeedback = new BoolFeedback(() => (bool)tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue);
|
||||
|
||||
Hdmi2VideoSyncFeedback = new BoolFeedback(() => (bool)tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue);
|
||||
|
||||
var combinedFuncs = new VideoStatusFuncsWrapper
|
||||
{
|
||||
@@ -210,120 +205,120 @@ namespace PepperDash.Essentials.DM
|
||||
|
||||
|
||||
|
||||
public override bool CustomActivate()
|
||||
{
|
||||
// Link up all of these damned events to the various RoutingPorts via a helper handler
|
||||
Tx.HdmiInputs[1].InputStreamChange += (o, a) => FowardInputStreamChange(HdmiIn1, a.EventId);
|
||||
Tx.HdmiInputs[1].VideoAttributes.AttributeChange += (o, a) => ForwardVideoAttributeChange(HdmiIn1, a.EventId);
|
||||
|
||||
Tx.HdmiInputs[2].InputStreamChange += (o, a) => FowardInputStreamChange(HdmiIn2, a.EventId);
|
||||
Tx.HdmiInputs[2].VideoAttributes.AttributeChange += (o, a) => ForwardVideoAttributeChange(HdmiIn2, a.EventId);
|
||||
|
||||
// Base does register and sets up comm monitoring.
|
||||
return base.CustomActivate();
|
||||
}
|
||||
|
||||
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||
{
|
||||
var joinMap = GetDmTxJoinMap(joinStart, joinMapKey);
|
||||
|
||||
if (Hdmi1VideoSyncFeedback != null)
|
||||
{
|
||||
Hdmi1VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Input1VideoSyncStatus.JoinNumber]);
|
||||
}
|
||||
if (Hdmi2VideoSyncFeedback != null)
|
||||
{
|
||||
Hdmi2VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Input2VideoSyncStatus.JoinNumber]);
|
||||
}
|
||||
|
||||
LinkDmTxToApi(this, trilist, joinMap, bridge);
|
||||
}
|
||||
|
||||
public void ExecuteNumericSwitch(ushort input, ushort output, eRoutingSignalType type)
|
||||
{
|
||||
Debug.Console(2, this, "Executing Numeric Switch to input {0}.", input);
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case eRoutingSignalType.Video:
|
||||
switch (input)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
ExecuteSwitch(eVst.Auto, null, type);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
ExecuteSwitch(HdmiIn1.Selector, null, type);
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
ExecuteSwitch(HdmiIn2.Selector, null, type);
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
ExecuteSwitch(eVst.AllDisabled, null, type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case eRoutingSignalType.Audio:
|
||||
switch (input)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
ExecuteSwitch(eAst.Auto, null, type);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
ExecuteSwitch(eAst.Hdmi1, null, type);
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
ExecuteSwitch(eAst.Hdmi2, null, type);
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
ExecuteSwitch(eAst.AllDisabled, null, type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType signalType)
|
||||
{
|
||||
if ((signalType | eRoutingSignalType.Video) == eRoutingSignalType.Video)
|
||||
Tx.VideoSource = (eVst)inputSelector;
|
||||
if ((signalType | eRoutingSignalType.Audio) == eRoutingSignalType.Audio)
|
||||
Tx.AudioSource = (eAst)inputSelector;
|
||||
}
|
||||
|
||||
void InputStreamChangeEvent(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
|
||||
{
|
||||
Debug.Console(2, "{0} event {1} stream {2}", this.Tx.ToString(), inputStream.ToString(), args.EventId.ToString());
|
||||
|
||||
switch (args.EventId)
|
||||
{
|
||||
case EndpointInputStreamEventIds.HdcpSupportOffFeedbackEventId:
|
||||
case EndpointInputStreamEventIds.HdcpSupportOnFeedbackEventId:
|
||||
case EndpointInputStreamEventIds.HdcpCapabilityFeedbackEventId:
|
||||
if (inputStream == Tx.HdmiInputs[1]) HdmiIn1HdcpCapabilityFeedback.FireUpdate();
|
||||
if (inputStream == Tx.HdmiInputs[2]) HdmiIn2HdcpCapabilityFeedback.FireUpdate();
|
||||
HdcpStateFeedback.FireUpdate();
|
||||
break;
|
||||
case EndpointInputStreamEventIds.SyncDetectedFeedbackEventId:
|
||||
if (inputStream == Tx.HdmiInputs[1]) Hdmi1VideoSyncFeedback.FireUpdate();
|
||||
if (inputStream == Tx.HdmiInputs[2]) Hdmi2VideoSyncFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
public override bool CustomActivate()
|
||||
{
|
||||
// Link up all of these damned events to the various RoutingPorts via a helper handler
|
||||
Tx.HdmiInputs[1].InputStreamChange += (o, a) => FowardInputStreamChange(HdmiIn1, a.EventId);
|
||||
Tx.HdmiInputs[1].VideoAttributes.AttributeChange += (o, a) => ForwardVideoAttributeChange(HdmiIn1, a.EventId);
|
||||
|
||||
Tx.HdmiInputs[2].InputStreamChange += (o, a) => FowardInputStreamChange(HdmiIn2, a.EventId);
|
||||
Tx.HdmiInputs[2].VideoAttributes.AttributeChange += (o, a) => ForwardVideoAttributeChange(HdmiIn2, a.EventId);
|
||||
|
||||
// Base does register and sets up comm monitoring.
|
||||
return base.CustomActivate();
|
||||
}
|
||||
|
||||
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||
{
|
||||
var joinMap = GetDmTxJoinMap(joinStart, joinMapKey);
|
||||
|
||||
if (Hdmi1VideoSyncFeedback != null)
|
||||
{
|
||||
Hdmi1VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Input1VideoSyncStatus.JoinNumber]);
|
||||
}
|
||||
if (Hdmi2VideoSyncFeedback != null)
|
||||
{
|
||||
Hdmi2VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Input2VideoSyncStatus.JoinNumber]);
|
||||
}
|
||||
|
||||
LinkDmTxToApi(this, trilist, joinMap, bridge);
|
||||
}
|
||||
|
||||
public void ExecuteNumericSwitch(ushort input, ushort output, eRoutingSignalType type)
|
||||
{
|
||||
Debug.Console(2, this, "Executing Numeric Switch to input {0}.", input);
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case eRoutingSignalType.Video:
|
||||
switch (input)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
ExecuteSwitch(eVst.Auto, null, type);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
ExecuteSwitch(HdmiIn1.Selector, null, type);
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
ExecuteSwitch(HdmiIn2.Selector, null, type);
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
ExecuteSwitch(eVst.AllDisabled, null, type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case eRoutingSignalType.Audio:
|
||||
switch (input)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
ExecuteSwitch(eAst.Auto, null, type);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
ExecuteSwitch(eAst.Hdmi1, null, type);
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
ExecuteSwitch(eAst.Hdmi2, null, type);
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
ExecuteSwitch(eAst.AllDisabled, null, type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType signalType)
|
||||
{
|
||||
if ((signalType | eRoutingSignalType.Video) == eRoutingSignalType.Video)
|
||||
Tx.VideoSource = (eVst)inputSelector;
|
||||
if ((signalType | eRoutingSignalType.Audio) == eRoutingSignalType.Audio)
|
||||
Tx.AudioSource = (eAst)inputSelector;
|
||||
}
|
||||
|
||||
void InputStreamChangeEvent(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
|
||||
{
|
||||
Debug.Console(2, "{0} event {1} stream {2}", this.Tx.ToString(), inputStream.ToString(), args.EventId.ToString());
|
||||
|
||||
switch (args.EventId)
|
||||
{
|
||||
case EndpointInputStreamEventIds.HdcpSupportOffFeedbackEventId:
|
||||
case EndpointInputStreamEventIds.HdcpSupportOnFeedbackEventId:
|
||||
case EndpointInputStreamEventIds.HdcpCapabilityFeedbackEventId:
|
||||
if (inputStream == Tx.HdmiInputs[1]) HdmiIn1HdcpCapabilityFeedback.FireUpdate();
|
||||
if (inputStream == Tx.HdmiInputs[2]) HdmiIn2HdcpCapabilityFeedback.FireUpdate();
|
||||
HdcpStateFeedback.FireUpdate();
|
||||
break;
|
||||
case EndpointInputStreamEventIds.SyncDetectedFeedbackEventId:
|
||||
if (inputStream == Tx.HdmiInputs[1]) Hdmi1VideoSyncFeedback.FireUpdate();
|
||||
if (inputStream == Tx.HdmiInputs[2]) Hdmi2VideoSyncFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Tx_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
|
||||
@@ -361,62 +356,62 @@ namespace PepperDash.Essentials.DM
|
||||
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, OutputPorts.First(), localInputAudioPort, eRoutingSignalType.Audio));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Relays the input stream change to the appropriate RoutingInputPort.
|
||||
/// </summary>
|
||||
void FowardInputStreamChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
|
||||
{
|
||||
if (eventId != EndpointInputStreamEventIds.SyncDetectedFeedbackEventId)
|
||||
{
|
||||
return;
|
||||
}
|
||||
inputPort.VideoStatus.VideoSyncFeedback.FireUpdate();
|
||||
AnyVideoInput.VideoStatus.VideoSyncFeedback.FireUpdate();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Relays the VideoAttributes change to a RoutingInputPort
|
||||
/// </summary>
|
||||
void ForwardVideoAttributeChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
|
||||
{
|
||||
//// LOCATION: Crestron.SimplSharpPro.DM.VideoAttributeEventIds
|
||||
//Debug.Console(2, this, "VideoAttributes_AttributeChange event id={0} from {1}",
|
||||
// args.EventId, (sender as VideoAttributesEnhanced).Owner.GetType());
|
||||
switch (eventId)
|
||||
{
|
||||
case VideoAttributeEventIds.HdcpActiveFeedbackEventId:
|
||||
inputPort.VideoStatus.HdcpActiveFeedback.FireUpdate();
|
||||
AnyVideoInput.VideoStatus.HdcpActiveFeedback.FireUpdate();
|
||||
break;
|
||||
case VideoAttributeEventIds.HdcpStateFeedbackEventId:
|
||||
inputPort.VideoStatus.HdcpStateFeedback.FireUpdate();
|
||||
AnyVideoInput.VideoStatus.HdcpStateFeedback.FireUpdate();
|
||||
break;
|
||||
case VideoAttributeEventIds.HorizontalResolutionFeedbackEventId:
|
||||
case VideoAttributeEventIds.VerticalResolutionFeedbackEventId:
|
||||
inputPort.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
||||
AnyVideoInput.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
||||
break;
|
||||
case VideoAttributeEventIds.FramesPerSecondFeedbackEventId:
|
||||
inputPort.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
||||
AnyVideoInput.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#region IIROutputPorts Members
|
||||
public CrestronCollection<IROutputPort> IROutputPorts { get { return Tx.IROutputPorts; } }
|
||||
public int NumberOfIROutputPorts { get { return Tx.NumberOfIROutputPorts; } }
|
||||
#endregion
|
||||
|
||||
#region IComPorts Members
|
||||
public CrestronCollection<ComPort> ComPorts { get { return Tx.ComPorts; } }
|
||||
public int NumberOfComPorts { get { return Tx.NumberOfComPorts; } }
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Relays the input stream change to the appropriate RoutingInputPort.
|
||||
/// </summary>
|
||||
void FowardInputStreamChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
|
||||
{
|
||||
if (eventId != EndpointInputStreamEventIds.SyncDetectedFeedbackEventId)
|
||||
{
|
||||
return;
|
||||
}
|
||||
inputPort.VideoStatus.VideoSyncFeedback.FireUpdate();
|
||||
AnyVideoInput.VideoStatus.VideoSyncFeedback.FireUpdate();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Relays the VideoAttributes change to a RoutingInputPort
|
||||
/// </summary>
|
||||
void ForwardVideoAttributeChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
|
||||
{
|
||||
//// LOCATION: Crestron.SimplSharpPro.DM.VideoAttributeEventIds
|
||||
//Debug.Console(2, this, "VideoAttributes_AttributeChange event id={0} from {1}",
|
||||
// args.EventId, (sender as VideoAttributesEnhanced).Owner.GetType());
|
||||
switch (eventId)
|
||||
{
|
||||
case VideoAttributeEventIds.HdcpActiveFeedbackEventId:
|
||||
inputPort.VideoStatus.HdcpActiveFeedback.FireUpdate();
|
||||
AnyVideoInput.VideoStatus.HdcpActiveFeedback.FireUpdate();
|
||||
break;
|
||||
case VideoAttributeEventIds.HdcpStateFeedbackEventId:
|
||||
inputPort.VideoStatus.HdcpStateFeedback.FireUpdate();
|
||||
AnyVideoInput.VideoStatus.HdcpStateFeedback.FireUpdate();
|
||||
break;
|
||||
case VideoAttributeEventIds.HorizontalResolutionFeedbackEventId:
|
||||
case VideoAttributeEventIds.VerticalResolutionFeedbackEventId:
|
||||
inputPort.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
||||
AnyVideoInput.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
||||
break;
|
||||
case VideoAttributeEventIds.FramesPerSecondFeedbackEventId:
|
||||
inputPort.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
||||
AnyVideoInput.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#region IIROutputPorts Members
|
||||
public CrestronCollection<IROutputPort> IROutputPorts { get { return Tx.IROutputPorts; } }
|
||||
public int NumberOfIROutputPorts { get { return Tx.NumberOfIROutputPorts; } }
|
||||
#endregion
|
||||
|
||||
#region IComPorts Members
|
||||
public CrestronCollection<ComPort> ComPorts { get { return Tx.ComPorts; } }
|
||||
public int NumberOfComPorts { get { return Tx.NumberOfComPorts; } }
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,49 +1,49 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
//using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Crestron.SimplSharpPro.DM;
|
||||
using Crestron.SimplSharpPro.DM.Endpoints;
|
||||
using Crestron.SimplSharpPro.DM.Endpoints.Transmitters;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Bridges;
|
||||
using PepperDash.Essentials.DM.Config;
|
||||
|
||||
namespace PepperDash.Essentials.DM
|
||||
{
|
||||
using eVst = Crestron.SimplSharpPro.DeviceSupport.eX02VideoSourceType;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
//using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Crestron.SimplSharpPro.DM;
|
||||
using Crestron.SimplSharpPro.DM.Endpoints;
|
||||
using Crestron.SimplSharpPro.DM.Endpoints.Transmitters;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Bridges;
|
||||
using PepperDash.Essentials.DM.Config;
|
||||
|
||||
namespace PepperDash.Essentials.DM
|
||||
{
|
||||
using eVst = Crestron.SimplSharpPro.DeviceSupport.eX02VideoSourceType;
|
||||
using eAst = Crestron.SimplSharpPro.DeviceSupport.eX02AudioSourceType;
|
||||
|
||||
[Description("Wrapper class for DM-TX-4K-302-C")]
|
||||
public class DmTx4k302CController : DmTxControllerBase, ITxRoutingWithFeedback, IHasFeedback,
|
||||
IIROutputPorts, IComPorts, IHasFreeRun, IVgaBrightnessContrastControls
|
||||
{
|
||||
public DmTx4k302C Tx { get; private set; }
|
||||
|
||||
public RoutingInputPortWithVideoStatuses HdmiIn1 { get; private set; }
|
||||
public RoutingInputPortWithVideoStatuses HdmiIn2 { get; private set; }
|
||||
public RoutingInputPortWithVideoStatuses VgaIn { get; private set; }
|
||||
public RoutingOutputPort DmOut { get; private set; }
|
||||
public RoutingOutputPort HdmiLoopOut { get; private set; }
|
||||
|
||||
public override StringFeedback ActiveVideoInputFeedback { get; protected set; }
|
||||
public IntFeedback VideoSourceNumericFeedback { get; protected set; }
|
||||
public IntFeedback AudioSourceNumericFeedback { get; protected set; }
|
||||
public IntFeedback HdmiIn1HdcpCapabilityFeedback { get; protected set; }
|
||||
public IntFeedback HdmiIn2HdcpCapabilityFeedback { get; protected set; }
|
||||
public BoolFeedback Hdmi1VideoSyncFeedback { get; protected set; }
|
||||
public BoolFeedback Hdmi2VideoSyncFeedback { get; protected set; }
|
||||
public BoolFeedback VgaVideoSyncFeedback { get; protected set; }
|
||||
|
||||
public BoolFeedback FreeRunEnabledFeedback { get; protected set; }
|
||||
|
||||
public IntFeedback VgaBrightnessFeedback { get; protected set; }
|
||||
public class DmTx4k302CController : DmTxControllerBase, ITxRoutingWithFeedback, IHasFeedback,
|
||||
IIROutputPorts, IComPorts, IHasFreeRun, IVgaBrightnessContrastControls
|
||||
{
|
||||
public DmTx4k302C Tx { get; private set; }
|
||||
|
||||
public RoutingInputPortWithVideoStatuses HdmiIn1 { get; private set; }
|
||||
public RoutingInputPortWithVideoStatuses HdmiIn2 { get; private set; }
|
||||
public RoutingInputPortWithVideoStatuses VgaIn { get; private set; }
|
||||
public RoutingOutputPort DmOut { get; private set; }
|
||||
public RoutingOutputPort HdmiLoopOut { get; private set; }
|
||||
|
||||
public override StringFeedback ActiveVideoInputFeedback { get; protected set; }
|
||||
public IntFeedback VideoSourceNumericFeedback { get; protected set; }
|
||||
public IntFeedback AudioSourceNumericFeedback { get; protected set; }
|
||||
public IntFeedback HdmiIn1HdcpCapabilityFeedback { get; protected set; }
|
||||
public IntFeedback HdmiIn2HdcpCapabilityFeedback { get; protected set; }
|
||||
public BoolFeedback Hdmi1VideoSyncFeedback { get; protected set; }
|
||||
public BoolFeedback Hdmi2VideoSyncFeedback { get; protected set; }
|
||||
public BoolFeedback VgaVideoSyncFeedback { get; protected set; }
|
||||
|
||||
public BoolFeedback FreeRunEnabledFeedback { get; protected set; }
|
||||
|
||||
public IntFeedback VgaBrightnessFeedback { get; protected set; }
|
||||
public IntFeedback VgaContrastFeedback { get; protected set; }
|
||||
|
||||
//IroutingNumericEvent
|
||||
@@ -57,171 +57,166 @@ namespace PepperDash.Essentials.DM
|
||||
{
|
||||
var newEvent = NumericSwitchChange;
|
||||
if (newEvent != null) newEvent(this, e);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Helps get the "real" inputs, including when in Auto
|
||||
/// </summary>
|
||||
public Crestron.SimplSharpPro.DeviceSupport.eX02VideoSourceType ActualActiveVideoInput
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Tx.VideoSourceFeedback != eVst.Auto)
|
||||
return Tx.VideoSourceFeedback;
|
||||
else // auto
|
||||
{
|
||||
if (Tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue)
|
||||
return eVst.Hdmi1;
|
||||
else if (Tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue)
|
||||
return eVst.Hdmi2;
|
||||
else if (Tx.VgaInput.SyncDetectedFeedback.BoolValue)
|
||||
return eVst.Vga;
|
||||
else
|
||||
return eVst.AllDisabled;
|
||||
}
|
||||
}
|
||||
}
|
||||
public RoutingPortCollection<RoutingInputPort> InputPorts
|
||||
{
|
||||
get
|
||||
{
|
||||
return new RoutingPortCollection<RoutingInputPort>
|
||||
{
|
||||
HdmiIn1,
|
||||
HdmiIn2,
|
||||
VgaIn,
|
||||
AnyVideoInput
|
||||
};
|
||||
}
|
||||
}
|
||||
public RoutingPortCollection<RoutingOutputPort> OutputPorts
|
||||
{
|
||||
get
|
||||
{
|
||||
return new RoutingPortCollection<RoutingOutputPort> { DmOut, HdmiLoopOut };
|
||||
}
|
||||
}
|
||||
public DmTx4k302CController(string key, string name, DmTx4k302C tx, bool preventRegistration)
|
||||
: base(key, name, tx)
|
||||
{
|
||||
Tx = tx;
|
||||
PreventRegistration = preventRegistration;
|
||||
|
||||
HdmiIn1 = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn1,
|
||||
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.Hdmi1, this,
|
||||
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInputs[1]))
|
||||
{
|
||||
FeedbackMatchObject = eVst.Hdmi1
|
||||
};
|
||||
HdmiIn2 = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn2,
|
||||
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.Hdmi2, this,
|
||||
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInputs[2]))
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Helps get the "real" inputs, including when in Auto
|
||||
/// </summary>
|
||||
public Crestron.SimplSharpPro.DeviceSupport.eX02VideoSourceType ActualActiveVideoInput
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Tx.VideoSourceFeedback != eVst.Auto)
|
||||
return Tx.VideoSourceFeedback;
|
||||
else // auto
|
||||
{
|
||||
if (Tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue)
|
||||
return eVst.Hdmi1;
|
||||
else if (Tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue)
|
||||
return eVst.Hdmi2;
|
||||
else if (Tx.VgaInput.SyncDetectedFeedback.BoolValue)
|
||||
return eVst.Vga;
|
||||
else
|
||||
return eVst.AllDisabled;
|
||||
}
|
||||
}
|
||||
}
|
||||
public RoutingPortCollection<RoutingInputPort> InputPorts
|
||||
{
|
||||
get
|
||||
{
|
||||
return new RoutingPortCollection<RoutingInputPort>
|
||||
{
|
||||
HdmiIn1,
|
||||
HdmiIn2,
|
||||
VgaIn,
|
||||
AnyVideoInput
|
||||
};
|
||||
}
|
||||
}
|
||||
public RoutingPortCollection<RoutingOutputPort> OutputPorts
|
||||
{
|
||||
get
|
||||
{
|
||||
return new RoutingPortCollection<RoutingOutputPort> { DmOut, HdmiLoopOut };
|
||||
}
|
||||
}
|
||||
public DmTx4k302CController(string key, string name, DmTx4k302C tx, bool preventRegistration)
|
||||
: base(key, name, tx)
|
||||
{
|
||||
Tx = tx;
|
||||
PreventRegistration = preventRegistration;
|
||||
|
||||
HdmiIn1 = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn1,
|
||||
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.Hdmi1, this,
|
||||
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInputs[1]))
|
||||
{
|
||||
FeedbackMatchObject = eVst.Hdmi1
|
||||
};
|
||||
HdmiIn2 = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn2,
|
||||
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.Hdmi2, this,
|
||||
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInputs[2]))
|
||||
{
|
||||
FeedbackMatchObject = eVst.Hdmi2
|
||||
};
|
||||
|
||||
VgaIn = new RoutingInputPortWithVideoStatuses(DmPortName.VgaIn,
|
||||
eRoutingSignalType.Video, eRoutingPortConnectionType.Vga, eVst.Vga, this,
|
||||
VideoStatusHelper.GetVgaInputStatusFuncs(tx.VgaInput))
|
||||
|
||||
VgaIn = new RoutingInputPortWithVideoStatuses(DmPortName.VgaIn,
|
||||
eRoutingSignalType.Video, eRoutingPortConnectionType.Vga, eVst.Vga, this,
|
||||
VideoStatusHelper.GetVgaInputStatusFuncs(tx.VgaInput))
|
||||
{
|
||||
FeedbackMatchObject = eVst.Vga
|
||||
};
|
||||
|
||||
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
||||
() => ActualActiveVideoInput.ToString());
|
||||
|
||||
Tx.HdmiInputs[1].InputStreamChange += InputStreamChangeEvent;
|
||||
|
||||
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
|
||||
() => ActualActiveVideoInput.ToString());
|
||||
|
||||
Tx.HdmiInputs[1].InputStreamChange += InputStreamChangeEvent;
|
||||
Tx.HdmiInputs[2].InputStreamChange += InputStreamChangeEvent;
|
||||
Tx.VgaInput.InputStreamChange += VgaInputOnInputStreamChange;
|
||||
Tx.BaseEvent += Tx_BaseEvent;
|
||||
|
||||
Tx.OnlineStatusChange += Tx_OnlineStatusChange;
|
||||
|
||||
VideoSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback);
|
||||
AudioSourceNumericFeedback = new IntFeedback(() => (int)Tx.AudioSourceFeedback);
|
||||
|
||||
HdmiIn1HdcpCapabilityFeedback = new IntFeedback("HdmiIn1HdcpCapability", () => (int)tx.HdmiInputs[1].HdcpCapabilityFeedback);
|
||||
|
||||
Tx.VgaInput.InputStreamChange += VgaInputOnInputStreamChange;
|
||||
Tx.BaseEvent += Tx_BaseEvent;
|
||||
|
||||
Tx.OnlineStatusChange += Tx_OnlineStatusChange;
|
||||
|
||||
VideoSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback);
|
||||
AudioSourceNumericFeedback = new IntFeedback(() => (int)Tx.AudioSourceFeedback);
|
||||
|
||||
HdmiIn1HdcpCapabilityFeedback = new IntFeedback("HdmiIn1HdcpCapability", () => (int)tx.HdmiInputs[1].HdcpCapabilityFeedback);
|
||||
|
||||
HdmiIn2HdcpCapabilityFeedback = new IntFeedback("HdmiIn2HdcpCapability", () => (int)tx.HdmiInputs[2].HdcpCapabilityFeedback);
|
||||
|
||||
HdcpStateFeedback =
|
||||
new IntFeedback(
|
||||
() =>
|
||||
tx.HdmiInputs[1].HdcpCapabilityFeedback > tx.HdmiInputs[2].HdcpCapabilityFeedback
|
||||
? (int)tx.HdmiInputs[1].HdcpCapabilityFeedback
|
||||
: (int)tx.HdmiInputs[2].HdcpCapabilityFeedback);
|
||||
|
||||
HdcpSupportCapability = eHdcpCapabilityType.Hdcp2_2Support;
|
||||
|
||||
Hdmi1VideoSyncFeedback = new BoolFeedback(() => (bool)tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue);
|
||||
|
||||
Hdmi2VideoSyncFeedback = new BoolFeedback(() => (bool)tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue);
|
||||
|
||||
VgaVideoSyncFeedback = new BoolFeedback(() => (bool)tx.VgaInput.SyncDetectedFeedback.BoolValue);
|
||||
|
||||
FreeRunEnabledFeedback = new BoolFeedback(() => tx.VgaInput.FreeRunFeedback == eDmFreeRunSetting.Enabled);
|
||||
|
||||
VgaBrightnessFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.BrightnessFeedback.UShortValue);
|
||||
VgaContrastFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.ContrastFeedback.UShortValue);
|
||||
|
||||
tx.VgaInput.VideoControls.ControlChange += new Crestron.SimplSharpPro.DeviceSupport.GenericEventHandler(VideoControls_ControlChange);
|
||||
|
||||
|
||||
var combinedFuncs = new VideoStatusFuncsWrapper
|
||||
{
|
||||
HdcpActiveFeedbackFunc = () =>
|
||||
(ActualActiveVideoInput == eVst.Hdmi1
|
||||
&& tx.HdmiInputs[1].VideoAttributes.HdcpActiveFeedback.BoolValue)
|
||||
|| (ActualActiveVideoInput == eVst.Hdmi2
|
||||
&& tx.HdmiInputs[2].VideoAttributes.HdcpActiveFeedback.BoolValue),
|
||||
|
||||
HdcpStateFeedbackFunc = () =>
|
||||
{
|
||||
if (ActualActiveVideoInput == eVst.Hdmi1)
|
||||
return tx.HdmiInputs[1].VideoAttributes.HdcpStateFeedback.ToString();
|
||||
return ActualActiveVideoInput == eVst.Hdmi2 ? tx.HdmiInputs[2].VideoAttributes.HdcpStateFeedback.ToString() : "";
|
||||
},
|
||||
|
||||
VideoResolutionFeedbackFunc = () =>
|
||||
{
|
||||
if (ActualActiveVideoInput == eVst.Hdmi1)
|
||||
return tx.HdmiInputs[1].VideoAttributes.GetVideoResolutionString();
|
||||
if (ActualActiveVideoInput == eVst.Hdmi2)
|
||||
return tx.HdmiInputs[2].VideoAttributes.GetVideoResolutionString();
|
||||
return ActualActiveVideoInput == eVst.Vga ? tx.VgaInput.VideoAttributes.GetVideoResolutionString() : "";
|
||||
},
|
||||
VideoSyncFeedbackFunc = () =>
|
||||
(ActualActiveVideoInput == eVst.Hdmi1
|
||||
&& tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue)
|
||||
|| (ActualActiveVideoInput == eVst.Hdmi2
|
||||
&& tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue)
|
||||
|| (ActualActiveVideoInput == eVst.Vga
|
||||
&& tx.VgaInput.SyncDetectedFeedback.BoolValue)
|
||||
|
||||
};
|
||||
|
||||
AnyVideoInput = new RoutingInputPortWithVideoStatuses(DmPortName.AnyVideoIn,
|
||||
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.None, 0, this, combinedFuncs);
|
||||
|
||||
DmOut = new RoutingOutputPort(DmPortName.DmOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
||||
eRoutingPortConnectionType.DmCat, null, this);
|
||||
HdmiLoopOut = new RoutingOutputPort(DmPortName.HdmiLoopOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
||||
eRoutingPortConnectionType.Hdmi, null, this);
|
||||
|
||||
|
||||
AddToFeedbackList(ActiveVideoInputFeedback, VideoSourceNumericFeedback, AudioSourceNumericFeedback,
|
||||
AnyVideoInput.VideoStatus.HasVideoStatusFeedback, AnyVideoInput.VideoStatus.HdcpActiveFeedback,
|
||||
AnyVideoInput.VideoStatus.HdcpStateFeedback, AnyVideoInput.VideoStatus.VideoResolutionFeedback,
|
||||
AnyVideoInput.VideoStatus.VideoSyncFeedback, HdmiIn1HdcpCapabilityFeedback, HdmiIn2HdcpCapabilityFeedback,
|
||||
Hdmi1VideoSyncFeedback, Hdmi2VideoSyncFeedback, VgaVideoSyncFeedback);
|
||||
|
||||
// Set Ports for CEC
|
||||
HdmiIn1.Port = Tx.HdmiInputs[1];
|
||||
HdmiIn2.Port = Tx.HdmiInputs[2];
|
||||
HdmiLoopOut.Port = Tx.HdmiOutput;
|
||||
DmOut.Port = Tx.DmOutput;
|
||||
}
|
||||
HdcpSupportCapability = eHdcpCapabilityType.Hdcp2_2Support;
|
||||
|
||||
HdcpStateFeedback = new IntFeedback(() => (int)HdcpSupportCapability);
|
||||
|
||||
Hdmi1VideoSyncFeedback = new BoolFeedback(() => (bool)tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue);
|
||||
|
||||
Hdmi2VideoSyncFeedback = new BoolFeedback(() => (bool)tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue);
|
||||
|
||||
VgaVideoSyncFeedback = new BoolFeedback(() => (bool)tx.VgaInput.SyncDetectedFeedback.BoolValue);
|
||||
|
||||
FreeRunEnabledFeedback = new BoolFeedback(() => tx.VgaInput.FreeRunFeedback == eDmFreeRunSetting.Enabled);
|
||||
|
||||
VgaBrightnessFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.BrightnessFeedback.UShortValue);
|
||||
VgaContrastFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.ContrastFeedback.UShortValue);
|
||||
|
||||
tx.VgaInput.VideoControls.ControlChange += new Crestron.SimplSharpPro.DeviceSupport.GenericEventHandler(VideoControls_ControlChange);
|
||||
|
||||
|
||||
var combinedFuncs = new VideoStatusFuncsWrapper
|
||||
{
|
||||
HdcpActiveFeedbackFunc = () =>
|
||||
(ActualActiveVideoInput == eVst.Hdmi1
|
||||
&& tx.HdmiInputs[1].VideoAttributes.HdcpActiveFeedback.BoolValue)
|
||||
|| (ActualActiveVideoInput == eVst.Hdmi2
|
||||
&& tx.HdmiInputs[2].VideoAttributes.HdcpActiveFeedback.BoolValue),
|
||||
|
||||
HdcpStateFeedbackFunc = () =>
|
||||
{
|
||||
if (ActualActiveVideoInput == eVst.Hdmi1)
|
||||
return tx.HdmiInputs[1].VideoAttributes.HdcpStateFeedback.ToString();
|
||||
return ActualActiveVideoInput == eVst.Hdmi2 ? tx.HdmiInputs[2].VideoAttributes.HdcpStateFeedback.ToString() : "";
|
||||
},
|
||||
|
||||
VideoResolutionFeedbackFunc = () =>
|
||||
{
|
||||
if (ActualActiveVideoInput == eVst.Hdmi1)
|
||||
return tx.HdmiInputs[1].VideoAttributes.GetVideoResolutionString();
|
||||
if (ActualActiveVideoInput == eVst.Hdmi2)
|
||||
return tx.HdmiInputs[2].VideoAttributes.GetVideoResolutionString();
|
||||
return ActualActiveVideoInput == eVst.Vga ? tx.VgaInput.VideoAttributes.GetVideoResolutionString() : "";
|
||||
},
|
||||
VideoSyncFeedbackFunc = () =>
|
||||
(ActualActiveVideoInput == eVst.Hdmi1
|
||||
&& tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue)
|
||||
|| (ActualActiveVideoInput == eVst.Hdmi2
|
||||
&& tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue)
|
||||
|| (ActualActiveVideoInput == eVst.Vga
|
||||
&& tx.VgaInput.SyncDetectedFeedback.BoolValue)
|
||||
|
||||
};
|
||||
|
||||
AnyVideoInput = new RoutingInputPortWithVideoStatuses(DmPortName.AnyVideoIn,
|
||||
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.None, 0, this, combinedFuncs);
|
||||
|
||||
DmOut = new RoutingOutputPort(DmPortName.DmOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
||||
eRoutingPortConnectionType.DmCat, null, this);
|
||||
HdmiLoopOut = new RoutingOutputPort(DmPortName.HdmiLoopOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
||||
eRoutingPortConnectionType.Hdmi, null, this);
|
||||
|
||||
|
||||
AddToFeedbackList(ActiveVideoInputFeedback, VideoSourceNumericFeedback, AudioSourceNumericFeedback,
|
||||
AnyVideoInput.VideoStatus.HasVideoStatusFeedback, AnyVideoInput.VideoStatus.HdcpActiveFeedback,
|
||||
AnyVideoInput.VideoStatus.HdcpStateFeedback, AnyVideoInput.VideoStatus.VideoResolutionFeedback,
|
||||
AnyVideoInput.VideoStatus.VideoSyncFeedback, HdmiIn1HdcpCapabilityFeedback, HdmiIn2HdcpCapabilityFeedback,
|
||||
Hdmi1VideoSyncFeedback, Hdmi2VideoSyncFeedback, VgaVideoSyncFeedback);
|
||||
|
||||
// Set Ports for CEC
|
||||
HdmiIn1.Port = Tx.HdmiInputs[1];
|
||||
HdmiIn2.Port = Tx.HdmiInputs[2];
|
||||
HdmiLoopOut.Port = Tx.HdmiOutput;
|
||||
DmOut.Port = Tx.DmOutput;
|
||||
}
|
||||
|
||||
void VgaInputOnInputStreamChange(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
|
||||
{
|
||||
@@ -234,13 +229,13 @@ namespace PepperDash.Essentials.DM
|
||||
VgaVideoSyncFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void VideoControls_ControlChange(object sender, Crestron.SimplSharpPro.DeviceSupport.GenericEventArgs args)
|
||||
{
|
||||
var id = args.EventId;
|
||||
Debug.Console(2, this, "EventId {0}", args.EventId);
|
||||
|
||||
}
|
||||
|
||||
void VideoControls_ControlChange(object sender, Crestron.SimplSharpPro.DeviceSupport.GenericEventArgs args)
|
||||
{
|
||||
var id = args.EventId;
|
||||
Debug.Console(2, this, "EventId {0}", args.EventId);
|
||||
|
||||
switch (id)
|
||||
{
|
||||
case VideoControlsEventIds.BrightnessFeedbackEventId:
|
||||
@@ -249,76 +244,76 @@ namespace PepperDash.Essentials.DM
|
||||
case VideoControlsEventIds.ContrastFeedbackEventId:
|
||||
VgaContrastFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public override bool CustomActivate()
|
||||
{
|
||||
// Link up all of these damned events to the various RoutingPorts via a helper handler
|
||||
Tx.HdmiInputs[1].InputStreamChange += (o, a) => FowardInputStreamChange(HdmiIn1, a.EventId);
|
||||
Tx.HdmiInputs[1].VideoAttributes.AttributeChange += (o, a) => ForwardVideoAttributeChange(HdmiIn1, a.EventId);
|
||||
|
||||
Tx.HdmiInputs[2].InputStreamChange += (o, a) => FowardInputStreamChange(HdmiIn2, a.EventId);
|
||||
Tx.HdmiInputs[2].VideoAttributes.AttributeChange += (o, a) => ForwardVideoAttributeChange(HdmiIn2, a.EventId);
|
||||
|
||||
Tx.VgaInput.InputStreamChange += (o, a) => FowardInputStreamChange(VgaIn, a.EventId);
|
||||
Tx.VgaInput.VideoAttributes.AttributeChange += (o, a) => ForwardVideoAttributeChange(VgaIn, a.EventId);
|
||||
|
||||
// Base does register and sets up comm monitoring.
|
||||
return base.CustomActivate();
|
||||
}
|
||||
|
||||
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||
{
|
||||
var joinMap = GetDmTxJoinMap(joinStart, joinMapKey);
|
||||
|
||||
if (Hdmi1VideoSyncFeedback != null)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public override bool CustomActivate()
|
||||
{
|
||||
// Link up all of these damned events to the various RoutingPorts via a helper handler
|
||||
Tx.HdmiInputs[1].InputStreamChange += (o, a) => FowardInputStreamChange(HdmiIn1, a.EventId);
|
||||
Tx.HdmiInputs[1].VideoAttributes.AttributeChange += (o, a) => ForwardVideoAttributeChange(HdmiIn1, a.EventId);
|
||||
|
||||
Tx.HdmiInputs[2].InputStreamChange += (o, a) => FowardInputStreamChange(HdmiIn2, a.EventId);
|
||||
Tx.HdmiInputs[2].VideoAttributes.AttributeChange += (o, a) => ForwardVideoAttributeChange(HdmiIn2, a.EventId);
|
||||
|
||||
Tx.VgaInput.InputStreamChange += (o, a) => FowardInputStreamChange(VgaIn, a.EventId);
|
||||
Tx.VgaInput.VideoAttributes.AttributeChange += (o, a) => ForwardVideoAttributeChange(VgaIn, a.EventId);
|
||||
|
||||
// Base does register and sets up comm monitoring.
|
||||
return base.CustomActivate();
|
||||
}
|
||||
|
||||
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||
{
|
||||
var joinMap = GetDmTxJoinMap(joinStart, joinMapKey);
|
||||
|
||||
if (Hdmi1VideoSyncFeedback != null)
|
||||
{
|
||||
Hdmi1VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Input1VideoSyncStatus.JoinNumber]);
|
||||
}
|
||||
if (Hdmi2VideoSyncFeedback != null)
|
||||
Hdmi1VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Input1VideoSyncStatus.JoinNumber]);
|
||||
}
|
||||
if (Hdmi2VideoSyncFeedback != null)
|
||||
{
|
||||
Hdmi2VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Input2VideoSyncStatus.JoinNumber]);
|
||||
}
|
||||
if (VgaVideoSyncFeedback != null)
|
||||
Hdmi2VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Input2VideoSyncStatus.JoinNumber]);
|
||||
}
|
||||
if (VgaVideoSyncFeedback != null)
|
||||
{
|
||||
VgaVideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Input3VideoSyncStatus.JoinNumber]);
|
||||
}
|
||||
|
||||
LinkDmTxToApi(this, trilist, joinMap, bridge);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Enables or disables free run
|
||||
/// </summary>
|
||||
/// <param name="enable"></param>
|
||||
VgaVideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Input3VideoSyncStatus.JoinNumber]);
|
||||
}
|
||||
|
||||
LinkDmTxToApi(this, trilist, joinMap, bridge);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Enables or disables free run
|
||||
/// </summary>
|
||||
/// <param name="enable"></param>
|
||||
public void SetFreeRunEnabled(bool enable)
|
||||
{
|
||||
Tx.VgaInput.FreeRun = enable ? eDmFreeRunSetting.Enabled : eDmFreeRunSetting.Disabled;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the VGA brightness level
|
||||
/// </summary>
|
||||
/// <param name="level"></param>
|
||||
public void SetVgaBrightness(ushort level)
|
||||
{
|
||||
Tx.VgaInput.VideoControls.Brightness.UShortValue = level;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the VGA contrast level
|
||||
/// </summary>
|
||||
/// <param name="level"></param>
|
||||
public void SetVgaContrast(ushort level)
|
||||
{
|
||||
Tx.VgaInput.VideoControls.Contrast.UShortValue = level;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Sets the VGA brightness level
|
||||
/// </summary>
|
||||
/// <param name="level"></param>
|
||||
public void SetVgaBrightness(ushort level)
|
||||
{
|
||||
Tx.VgaInput.VideoControls.Brightness.UShortValue = level;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the VGA contrast level
|
||||
/// </summary>
|
||||
/// <param name="level"></param>
|
||||
public void SetVgaContrast(ushort level)
|
||||
{
|
||||
Tx.VgaInput.VideoControls.Contrast.UShortValue = level;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void ExecuteNumericSwitch(ushort input, ushort output, eRoutingSignalType type)
|
||||
{
|
||||
Debug.Console(2, this, "Executing Numeric Switch to input {0}.", input);
|
||||
@@ -326,76 +321,76 @@ namespace PepperDash.Essentials.DM
|
||||
switch (type)
|
||||
{
|
||||
case eRoutingSignalType.Video:
|
||||
switch (input)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
ExecuteSwitch(eVst.Auto, null, type);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
ExecuteSwitch(HdmiIn1.Selector, null, type);
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
ExecuteSwitch(HdmiIn2.Selector, null, type);
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
ExecuteSwitch(VgaIn.Selector, null, type);
|
||||
break;
|
||||
}
|
||||
case 4:
|
||||
{
|
||||
ExecuteSwitch(eVst.AllDisabled, null, type);
|
||||
break;
|
||||
}
|
||||
switch (input)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
ExecuteSwitch(eVst.Auto, null, type);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
ExecuteSwitch(HdmiIn1.Selector, null, type);
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
ExecuteSwitch(HdmiIn2.Selector, null, type);
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
ExecuteSwitch(VgaIn.Selector, null, type);
|
||||
break;
|
||||
}
|
||||
case 4:
|
||||
{
|
||||
ExecuteSwitch(eVst.AllDisabled, null, type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case eRoutingSignalType.Audio:
|
||||
switch (input)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
ExecuteSwitch(eAst.Auto, null, type);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
ExecuteSwitch(eAst.Hdmi1, null, type);
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
ExecuteSwitch(eAst.Hdmi2, null, type);
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
ExecuteSwitch(eAst.AudioIn, null, type);
|
||||
break;
|
||||
}
|
||||
case 4:
|
||||
{
|
||||
ExecuteSwitch(eAst.AllDisabled, null, type);
|
||||
break;
|
||||
}
|
||||
switch (input)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
ExecuteSwitch(eAst.Auto, null, type);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
ExecuteSwitch(eAst.Hdmi1, null, type);
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
ExecuteSwitch(eAst.Hdmi2, null, type);
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
ExecuteSwitch(eAst.AudioIn, null, type);
|
||||
break;
|
||||
}
|
||||
case 4:
|
||||
{
|
||||
ExecuteSwitch(eAst.AllDisabled, null, type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType signalType)
|
||||
{
|
||||
if ((signalType | eRoutingSignalType.Video) == eRoutingSignalType.Video)
|
||||
Tx.VideoSource = (eVst)inputSelector;
|
||||
if ((signalType | eRoutingSignalType.Audio) == eRoutingSignalType.Audio)
|
||||
Tx.AudioSource = (eAst)inputSelector;
|
||||
}
|
||||
|
||||
public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType signalType)
|
||||
{
|
||||
if ((signalType | eRoutingSignalType.Video) == eRoutingSignalType.Video)
|
||||
Tx.VideoSource = (eVst)inputSelector;
|
||||
if ((signalType | eRoutingSignalType.Audio) == eRoutingSignalType.Audio)
|
||||
Tx.AudioSource = (eAst)inputSelector;
|
||||
}
|
||||
|
||||
void InputStreamChangeEvent(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
|
||||
{
|
||||
Debug.Console(2, "{0} event {1} stream {2}", this.Tx.ToString(), inputStream.ToString(), args.EventId.ToString());
|
||||
@@ -405,7 +400,7 @@ namespace PepperDash.Essentials.DM
|
||||
case EndpointInputStreamEventIds.HdcpSupportOffFeedbackEventId:
|
||||
case EndpointInputStreamEventIds.HdcpSupportOnFeedbackEventId:
|
||||
case EndpointInputStreamEventIds.HdcpCapabilityFeedbackEventId:
|
||||
if (inputStream == Tx.HdmiInputs[1]) HdmiIn1HdcpCapabilityFeedback.FireUpdate();
|
||||
if (inputStream == Tx.HdmiInputs[1]) HdmiIn1HdcpCapabilityFeedback.FireUpdate();
|
||||
if (inputStream == Tx.HdmiInputs[2]) HdmiIn2HdcpCapabilityFeedback.FireUpdate();
|
||||
HdcpStateFeedback.FireUpdate();
|
||||
break;
|
||||
@@ -450,57 +445,57 @@ namespace PepperDash.Essentials.DM
|
||||
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, OutputPorts.First(), localInputAudioPort, eRoutingSignalType.Audio));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Relays the input stream change to the appropriate RoutingInputPort.
|
||||
/// </summary>
|
||||
void FowardInputStreamChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
|
||||
{
|
||||
/// <summary>
|
||||
/// Relays the input stream change to the appropriate RoutingInputPort.
|
||||
/// </summary>
|
||||
void FowardInputStreamChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
|
||||
{
|
||||
if (eventId != EndpointInputStreamEventIds.SyncDetectedFeedbackEventId) return;
|
||||
inputPort.VideoStatus.VideoSyncFeedback.FireUpdate();
|
||||
inputPort.VideoStatus.VideoSyncFeedback.FireUpdate();
|
||||
AnyVideoInput.VideoStatus.VideoSyncFeedback.FireUpdate();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Relays the VideoAttributes change to a RoutingInputPort
|
||||
/// </summary>
|
||||
void ForwardVideoAttributeChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
|
||||
{
|
||||
//// LOCATION: Crestron.SimplSharpPro.DM.VideoAttributeEventIds
|
||||
//Debug.Console(2, this, "VideoAttributes_AttributeChange event id={0} from {1}",
|
||||
// args.EventId, (sender as VideoAttributesEnhanced).Owner.GetType());
|
||||
switch (eventId)
|
||||
{
|
||||
case VideoAttributeEventIds.HdcpActiveFeedbackEventId:
|
||||
inputPort.VideoStatus.HdcpActiveFeedback.FireUpdate();
|
||||
AnyVideoInput.VideoStatus.HdcpActiveFeedback.FireUpdate();
|
||||
break;
|
||||
case VideoAttributeEventIds.HdcpStateFeedbackEventId:
|
||||
inputPort.VideoStatus.HdcpStateFeedback.FireUpdate();
|
||||
AnyVideoInput.VideoStatus.HdcpStateFeedback.FireUpdate();
|
||||
break;
|
||||
case VideoAttributeEventIds.HorizontalResolutionFeedbackEventId:
|
||||
case VideoAttributeEventIds.VerticalResolutionFeedbackEventId:
|
||||
inputPort.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
||||
AnyVideoInput.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
||||
break;
|
||||
case VideoAttributeEventIds.FramesPerSecondFeedbackEventId:
|
||||
inputPort.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
||||
AnyVideoInput.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#region IIROutputPorts Members
|
||||
public CrestronCollection<IROutputPort> IROutputPorts { get { return Tx.IROutputPorts; } }
|
||||
public int NumberOfIROutputPorts { get { return Tx.NumberOfIROutputPorts; } }
|
||||
#endregion
|
||||
|
||||
#region IComPorts Members
|
||||
public CrestronCollection<ComPort> ComPorts { get { return Tx.ComPorts; } }
|
||||
public int NumberOfComPorts { get { return Tx.NumberOfComPorts; } }
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Relays the VideoAttributes change to a RoutingInputPort
|
||||
/// </summary>
|
||||
void ForwardVideoAttributeChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
|
||||
{
|
||||
//// LOCATION: Crestron.SimplSharpPro.DM.VideoAttributeEventIds
|
||||
//Debug.Console(2, this, "VideoAttributes_AttributeChange event id={0} from {1}",
|
||||
// args.EventId, (sender as VideoAttributesEnhanced).Owner.GetType());
|
||||
switch (eventId)
|
||||
{
|
||||
case VideoAttributeEventIds.HdcpActiveFeedbackEventId:
|
||||
inputPort.VideoStatus.HdcpActiveFeedback.FireUpdate();
|
||||
AnyVideoInput.VideoStatus.HdcpActiveFeedback.FireUpdate();
|
||||
break;
|
||||
case VideoAttributeEventIds.HdcpStateFeedbackEventId:
|
||||
inputPort.VideoStatus.HdcpStateFeedback.FireUpdate();
|
||||
AnyVideoInput.VideoStatus.HdcpStateFeedback.FireUpdate();
|
||||
break;
|
||||
case VideoAttributeEventIds.HorizontalResolutionFeedbackEventId:
|
||||
case VideoAttributeEventIds.VerticalResolutionFeedbackEventId:
|
||||
inputPort.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
||||
AnyVideoInput.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
||||
break;
|
||||
case VideoAttributeEventIds.FramesPerSecondFeedbackEventId:
|
||||
inputPort.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
||||
AnyVideoInput.VideoStatus.VideoResolutionFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#region IIROutputPorts Members
|
||||
public CrestronCollection<IROutputPort> IROutputPorts { get { return Tx.IROutputPorts; } }
|
||||
public int NumberOfIROutputPorts { get { return Tx.NumberOfIROutputPorts; } }
|
||||
#endregion
|
||||
|
||||
#region IComPorts Members
|
||||
public CrestronCollection<ComPort> ComPorts { get { return Tx.ComPorts; } }
|
||||
public int NumberOfComPorts { get { return Tx.NumberOfComPorts; } }
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -72,6 +72,7 @@ namespace PepperDash.Essentials.DM
|
||||
HdmiIn.Port = Tx;
|
||||
|
||||
PreventRegistration = true;
|
||||
tx.Register();
|
||||
}
|
||||
|
||||
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace PepperDash.Essentials.DM
|
||||
|
||||
|
||||
[Description("Wrapper class for DM-TX-4K-Z-302-C")]
|
||||
public class DmTx4kz302CController : DmTxControllerBase, ITxRoutingWithFeedback, IHasFeedback,
|
||||
public class DmTx4kz302CController : DmTxControllerBase, ITxRoutingWithFeedback,
|
||||
IIROutputPorts, IComPorts
|
||||
{
|
||||
public DmTx4kz302C Tx { get; private set; }
|
||||
@@ -34,6 +34,7 @@ namespace PepperDash.Essentials.DM
|
||||
public IntFeedback AudioSourceNumericFeedback { get; protected set; }
|
||||
public IntFeedback HdmiIn1HdcpCapabilityFeedback { get; protected set; }
|
||||
public IntFeedback HdmiIn2HdcpCapabilityFeedback { get; protected set; }
|
||||
public IntFeedback DisplayPortInHdcpCapabilityFeedback { get; protected set; }
|
||||
public BoolFeedback Hdmi1VideoSyncFeedback { get; protected set; }
|
||||
public BoolFeedback Hdmi2VideoSyncFeedback { get; protected set; }
|
||||
public BoolFeedback DisplayPortVideoSyncFeedback { get; protected set; }
|
||||
@@ -120,7 +121,7 @@ namespace PepperDash.Essentials.DM
|
||||
|
||||
Tx.HdmiInputs[1].InputStreamChange += InputStreamChangeEvent;
|
||||
Tx.HdmiInputs[2].InputStreamChange += InputStreamChangeEvent;
|
||||
Tx.DisplayPortInput.InputStreamChange += DisplayPortInputStreamChange;
|
||||
Tx.DisplayPortInput.InputStreamChange += InputStreamChangeEvent;
|
||||
Tx.BaseEvent += Tx_BaseEvent;
|
||||
Tx.OnlineStatusChange += Tx_OnlineStatusChange;
|
||||
|
||||
@@ -130,15 +131,32 @@ namespace PepperDash.Essentials.DM
|
||||
HdmiIn1HdcpCapabilityFeedback = new IntFeedback("HdmiIn1HdcpCapability", () => (int)tx.HdmiInputs[1].HdcpCapabilityFeedback);
|
||||
|
||||
HdmiIn2HdcpCapabilityFeedback = new IntFeedback("HdmiIn2HdcpCapability", () => (int)tx.HdmiInputs[2].HdcpCapabilityFeedback);
|
||||
DisplayPortInHdcpCapabilityFeedback = new IntFeedback("DisplayPortInHdcpCapability",
|
||||
() => (int)tx.DisplayPortInput.HdcpCapabilityFeedback);
|
||||
|
||||
|
||||
/*
|
||||
HdcpStateFeedback =
|
||||
new IntFeedback(
|
||||
() =>
|
||||
tx.HdmiInputs[1].HdcpCapabilityFeedback > tx.HdmiInputs[2].HdcpCapabilityFeedback
|
||||
? (int)tx.HdmiInputs[1].HdcpCapabilityFeedback
|
||||
: (int)tx.HdmiInputs[2].HdcpCapabilityFeedback);
|
||||
*/
|
||||
|
||||
//yeah this is gross - but it's the quickest way to do this...
|
||||
/*
|
||||
HdcpStateFeedback = new IntFeedback(() => {
|
||||
var states = new[] {(int) tx.DisplayPortInput.HdcpCapabilityFeedback, (int) tx.HdmiInputs[1].HdcpCapabilityFeedback, (int) tx.HdmiInputs[2].HdcpCapabilityFeedback};
|
||||
|
||||
return states.Max();
|
||||
});
|
||||
*/
|
||||
|
||||
HdcpSupportCapability = eHdcpCapabilityType.Hdcp2_2Support;
|
||||
// I feel like we have had this as a misnomer for so long, that it really needed to be fixed
|
||||
// All we were doing was reporting the best of the current statuses - not the actual capability of the device.
|
||||
HdcpStateFeedback = new IntFeedback(() => (int)HdcpSupportCapability);
|
||||
|
||||
Hdmi1VideoSyncFeedback = new BoolFeedback(() => (bool)tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue);
|
||||
|
||||
@@ -146,20 +164,25 @@ namespace PepperDash.Essentials.DM
|
||||
|
||||
DisplayPortVideoSyncFeedback = new BoolFeedback(() => (bool)tx.DisplayPortInput.SyncDetectedFeedback.BoolValue);
|
||||
|
||||
|
||||
var combinedFuncs = new VideoStatusFuncsWrapper
|
||||
{
|
||||
HdcpActiveFeedbackFunc = () =>
|
||||
(ActualActiveVideoInput == eVst.Hdmi1
|
||||
&& tx.HdmiInputs[1].VideoAttributes.HdcpActiveFeedback.BoolValue)
|
||||
|| (ActualActiveVideoInput == eVst.Hdmi2
|
||||
&& tx.HdmiInputs[2].VideoAttributes.HdcpActiveFeedback.BoolValue),
|
||||
&& tx.HdmiInputs[2].VideoAttributes.HdcpActiveFeedback.BoolValue)
|
||||
|| (ActualActiveVideoInput == eVst.DisplayPort
|
||||
&& tx.DisplayPortInput.VideoAttributes.HdcpActiveFeedback.BoolValue),
|
||||
|
||||
HdcpStateFeedbackFunc = () =>
|
||||
{
|
||||
if (ActualActiveVideoInput == eVst.Hdmi1)
|
||||
return tx.HdmiInputs[1].VideoAttributes.HdcpStateFeedback.ToString();
|
||||
return ActualActiveVideoInput == eVst.Hdmi2 ? tx.HdmiInputs[2].VideoAttributes.HdcpStateFeedback.ToString() : "";
|
||||
return tx.HdmiInputs[1].VideoAttributes.HdcpStateFeedback.ToString();
|
||||
if (ActualActiveVideoInput == eVst.Hdmi2)
|
||||
return tx.HdmiInputs[2].VideoAttributes.HdcpStateFeedback.ToString();
|
||||
return ActualActiveVideoInput == eVst.DisplayPort
|
||||
? tx.DisplayPortInput.VideoAttributes.HdcpStateFeedback.ToString()
|
||||
: "";
|
||||
},
|
||||
|
||||
VideoResolutionFeedbackFunc = () =>
|
||||
@@ -168,6 +191,8 @@ namespace PepperDash.Essentials.DM
|
||||
return tx.HdmiInputs[1].VideoAttributes.GetVideoResolutionString();
|
||||
if (ActualActiveVideoInput == eVst.Hdmi2)
|
||||
return tx.HdmiInputs[2].VideoAttributes.GetVideoResolutionString();
|
||||
if (ActualActiveVideoInput == eVst.DisplayPort)
|
||||
return tx.DisplayPortInput.VideoAttributes.GetVideoResolutionString();
|
||||
return ActualActiveVideoInput == eVst.Vga ? tx.DisplayPortInput.VideoAttributes.GetVideoResolutionString() : "";
|
||||
},
|
||||
VideoSyncFeedbackFunc = () =>
|
||||
@@ -175,6 +200,8 @@ namespace PepperDash.Essentials.DM
|
||||
&& tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue)
|
||||
|| (ActualActiveVideoInput == eVst.Hdmi2
|
||||
&& tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue)
|
||||
|| (ActualActiveVideoInput == eVst.DisplayPort
|
||||
&& tx.DisplayPortInput.SyncDetectedFeedback.BoolValue)
|
||||
|| (ActualActiveVideoInput == eVst.Vga
|
||||
&& tx.DisplayPortInput.SyncDetectedFeedback.BoolValue)
|
||||
|
||||
@@ -193,28 +220,15 @@ namespace PepperDash.Essentials.DM
|
||||
AnyVideoInput.VideoStatus.HasVideoStatusFeedback, AnyVideoInput.VideoStatus.HdcpActiveFeedback,
|
||||
AnyVideoInput.VideoStatus.HdcpStateFeedback, AnyVideoInput.VideoStatus.VideoResolutionFeedback,
|
||||
AnyVideoInput.VideoStatus.VideoSyncFeedback, HdmiIn1HdcpCapabilityFeedback, HdmiIn2HdcpCapabilityFeedback,
|
||||
Hdmi1VideoSyncFeedback, Hdmi2VideoSyncFeedback, DisplayPortVideoSyncFeedback);
|
||||
Hdmi1VideoSyncFeedback, Hdmi2VideoSyncFeedback, DisplayPortVideoSyncFeedback, DisplayPortInHdcpCapabilityFeedback);
|
||||
|
||||
// Set Ports for CEC
|
||||
HdmiIn1.Port = Tx.HdmiInputs[1];
|
||||
HdmiIn2.Port = Tx.HdmiInputs[2];
|
||||
DisplayPortIn.Port = Tx.DisplayPortInput;
|
||||
HdmiLoopOut.Port = Tx.HdmiOutput;
|
||||
DmOut.Port = Tx.DmOutput;
|
||||
}
|
||||
|
||||
void DisplayPortInputStreamChange(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
|
||||
{
|
||||
Debug.Console(2, "{0} event {1} stream {2}", Tx.ToString(), inputStream.ToString(), args.EventId.ToString());
|
||||
|
||||
switch (args.EventId)
|
||||
{
|
||||
case EndpointInputStreamEventIds.SyncDetectedFeedbackEventId:
|
||||
DisplayPortVideoSyncFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public override bool CustomActivate()
|
||||
{
|
||||
@@ -256,41 +270,41 @@ namespace PepperDash.Essentials.DM
|
||||
{
|
||||
Debug.Console(2, this, "Executing Numeric Switch to input {0}.", input);
|
||||
|
||||
switch (input)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
ExecuteSwitch(eVst.Auto, null, type);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
ExecuteSwitch(HdmiIn1.Selector, null, type);
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
ExecuteSwitch(HdmiIn2.Selector, null, type);
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
ExecuteSwitch(DisplayPortIn.Selector, null, type);
|
||||
break;
|
||||
}
|
||||
case 4:
|
||||
{
|
||||
ExecuteSwitch(eVst.AllDisabled, null, type);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
switch (input)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
ExecuteSwitch(eVst.Auto, null, type);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
ExecuteSwitch(HdmiIn1.Selector, null, type);
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
ExecuteSwitch(HdmiIn2.Selector, null, type);
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
ExecuteSwitch(DisplayPortIn.Selector, null, type);
|
||||
break;
|
||||
}
|
||||
case 4:
|
||||
{
|
||||
ExecuteSwitch(eVst.AllDisabled, null, type);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
Debug.Console(2, this, "Unable to execute numeric switch to input {0}", input);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -326,11 +340,17 @@ namespace PepperDash.Essentials.DM
|
||||
case EndpointInputStreamEventIds.HdcpCapabilityFeedbackEventId:
|
||||
if (inputStream == Tx.HdmiInputs[1]) HdmiIn1HdcpCapabilityFeedback.FireUpdate();
|
||||
if (inputStream == Tx.HdmiInputs[2]) HdmiIn2HdcpCapabilityFeedback.FireUpdate();
|
||||
if (inputStream == Tx.DisplayPortInput) DisplayPortInHdcpCapabilityFeedback.FireUpdate();
|
||||
|
||||
Debug.Console(2, this, "DisplayPortHDCP Mode Trigger = {0}",
|
||||
DisplayPortInHdcpCapabilityFeedback.IntValue);
|
||||
|
||||
HdcpStateFeedback.FireUpdate();
|
||||
break;
|
||||
case EndpointInputStreamEventIds.SyncDetectedFeedbackEventId:
|
||||
if (inputStream == Tx.HdmiInputs[1]) Hdmi1VideoSyncFeedback.FireUpdate();
|
||||
if (inputStream == Tx.HdmiInputs[2]) Hdmi2VideoSyncFeedback.FireUpdate();
|
||||
if (inputStream == Tx.DisplayPortInput) DisplayPortVideoSyncFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -413,7 +433,6 @@ namespace PepperDash.Essentials.DM
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#region IIROutputPorts Members
|
||||
public CrestronCollection<IROutputPort> IROutputPorts { get { return Tx.IROutputPorts; } }
|
||||
public int NumberOfIROutputPorts { get { return Tx.NumberOfIROutputPorts; } }
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Crestron.SimplSharpPro.DM;
|
||||
@@ -18,8 +16,8 @@ using PepperDash.Essentials.Core.Config;
|
||||
|
||||
namespace PepperDash.Essentials.DM
|
||||
{
|
||||
public class DmTxHelper
|
||||
{
|
||||
public class DmTxHelper
|
||||
{
|
||||
|
||||
public static BasicDmTxControllerBase GetDmTxForChassisWithoutIpId(string key, string name, string typeName, DMInput dmInput)
|
||||
{
|
||||
@@ -44,7 +42,7 @@ namespace PepperDash.Essentials.DM
|
||||
if (typeName.StartsWith("dmtx401"))
|
||||
return new DmTx401CController(key, name, new DmTx401C(dmInput), true);
|
||||
if (typeName.StartsWith("hdbasettx"))
|
||||
new HDBaseTTxController(key, name, new HDTx3CB(dmInput));
|
||||
return new HDBaseTTxController(key, name, new HDTx3CB(dmInput));
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -77,31 +75,32 @@ namespace PepperDash.Essentials.DM
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A factory method for various DmTxControllers
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <param name="name"></param>
|
||||
/// <param name="props"></param>
|
||||
/// <returns></returns>
|
||||
/// <summary>
|
||||
/// A factory method for various DmTxControllers
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <param name="name"></param>
|
||||
/// <param name="props"></param>
|
||||
/// <param name="typeName"></param>
|
||||
/// <returns></returns>
|
||||
public static BasicDmTxControllerBase GetDmTxController(string key, string name, string typeName, DmTxPropertiesConfig props)
|
||||
{
|
||||
// switch on type name... later...
|
||||
{
|
||||
// switch on type name... later...
|
||||
|
||||
typeName = typeName.ToLower();
|
||||
//uint ipid = Convert.ToUInt16(props.Id, 16);
|
||||
var ipid = props.Control.IpIdInt;
|
||||
var pKey = props.ParentDeviceKey.ToLower();
|
||||
typeName = typeName.ToLower();
|
||||
//uint ipid = Convert.ToUInt16(props.Id, 16);
|
||||
var ipid = props.Control.IpIdInt;
|
||||
var pKey = props.ParentDeviceKey.ToLower();
|
||||
|
||||
if (pKey == "processor")
|
||||
{
|
||||
// Catch constructor failures, mainly dues to IPID
|
||||
try
|
||||
{
|
||||
if(typeName.StartsWith("dmtx200"))
|
||||
{
|
||||
// Catch constructor failures, mainly dues to IPID
|
||||
try
|
||||
{
|
||||
if (typeName.StartsWith("dmtx200"))
|
||||
return new DmTx200Controller(key, name, new DmTx200C2G(ipid, Global.ControlSystem), false);
|
||||
if (typeName.StartsWith("dmtx201c"))
|
||||
return new DmTx201CController(key, name, new DmTx201C(ipid, Global.ControlSystem), false);
|
||||
if (typeName.StartsWith("dmtx201c"))
|
||||
return new DmTx201CController(key, name, new DmTx201C(ipid, Global.ControlSystem), false);
|
||||
if (typeName.StartsWith("dmtx201s"))
|
||||
return new DmTx201SController(key, name, new DmTx201S(ipid, Global.ControlSystem), false);
|
||||
if (typeName.StartsWith("dmtx4k202"))
|
||||
@@ -112,35 +111,36 @@ namespace PepperDash.Essentials.DM
|
||||
return new DmTx4k302CController(key, name, new DmTx4k302C(ipid, Global.ControlSystem), false);
|
||||
if (typeName.StartsWith("dmtx4kz302"))
|
||||
return new DmTx4kz302CController(key, name, new DmTx4kz302C(ipid, Global.ControlSystem), false);
|
||||
if (typeName.StartsWith("dmtx401"))
|
||||
if (typeName.StartsWith("dmtx401"))
|
||||
return new DmTx401CController(key, name, new DmTx401C(ipid, Global.ControlSystem), false);
|
||||
Debug.Console(0, "{1} WARNING: Cannot create DM-TX of type: '{0}'", typeName, key);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(0, "[{0}] WARNING: Cannot create DM-TX device: {1}", key, e);
|
||||
}
|
||||
Debug.Console(0, "{1} WARNING: Cannot create DM-TX of type: '{0}'", typeName, key);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(0, "[{0}] WARNING: Cannot create DM-TX device: {1}", key, e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
var parentDev = DeviceManager.GetDeviceForKey(pKey);
|
||||
DMInput dmInput;
|
||||
BasicDmTxControllerBase tx;
|
||||
bool useChassisForOfflineFeedback = false;
|
||||
|
||||
if (parentDev is DmChassisController)
|
||||
if (parentDev is IDmSwitchWithEndpointOnlineFeedback)
|
||||
{
|
||||
// Get the Crestron chassis and link stuff up
|
||||
var switchDev = (parentDev as DmChassisController);
|
||||
var chassis = switchDev.Chassis;
|
||||
var switchDev = (parentDev as IDmSwitchWithEndpointOnlineFeedback);
|
||||
var chassis = switchDev.Chassis;
|
||||
|
||||
//Check that the input is within range of this chassis' possible inputs
|
||||
var num = props.ParentInputNumber;
|
||||
if (num <= 0 || num > chassis.NumberOfInputs)
|
||||
{
|
||||
Debug.Console(0, "Cannot create DM device '{0}'. Input number '{1}' is out of range",
|
||||
key, num);
|
||||
return null;
|
||||
}
|
||||
var num = props.ParentInputNumber;
|
||||
if (num <= 0 || num > chassis.NumberOfInputs)
|
||||
{
|
||||
Debug.Console(0, "Cannot create DM device '{0}'. Input number '{1}' is out of range",
|
||||
key, num);
|
||||
return null;
|
||||
}
|
||||
|
||||
switchDev.TxDictionary.Add(num, key);
|
||||
dmInput = chassis.Inputs[num];
|
||||
@@ -155,15 +155,23 @@ namespace PepperDash.Essentials.DM
|
||||
chassis is DmMd128x128 || chassis is DmMd64x64)
|
||||
{
|
||||
tx = GetDmTxForChassisWithoutIpId(key, name, typeName, dmInput);
|
||||
Debug.Console(0, "DM endpoint output {0} is for Cpu3, changing online feedback to chassis", num);
|
||||
tx.IsOnline.SetValueFunc(() => switchDev.InputEndpointOnlineFeedbacks[num].BoolValue);
|
||||
switchDev.InputEndpointOnlineFeedbacks[num].OutputChange += (o, a) => tx.IsOnline.FireUpdate();
|
||||
return tx;
|
||||
useChassisForOfflineFeedback = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return GetDmTxForChassisWithIpId(key, name, typeName, ipid, dmInput);
|
||||
tx = GetDmTxForChassisWithIpId(key, name, typeName, ipid, dmInput);
|
||||
if (typeName == "hdbasettx" || typeName == "dmtx4k100c1g")
|
||||
{
|
||||
useChassisForOfflineFeedback = true;
|
||||
}
|
||||
}
|
||||
if (useChassisForOfflineFeedback)
|
||||
{
|
||||
Debug.Console(0, "DM endpoint output {0} does not have direct online feedback, changing online feedback to chassis", num);
|
||||
tx.IsOnline.SetValueFunc(() => switchDev.InputEndpointOnlineFeedbacks[num].BoolValue);
|
||||
switchDev.InputEndpointOnlineFeedbacks[num].OutputChange += (o, a) => tx.IsOnline.FireUpdate();
|
||||
}
|
||||
return tx;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -171,7 +179,8 @@ namespace PepperDash.Essentials.DM
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if(parentDev is DmpsRoutingController)
|
||||
|
||||
if (parentDev is DmpsRoutingController)
|
||||
{
|
||||
// Get the DMPS chassis and link stuff up
|
||||
var dmpsDev = (parentDev as DmpsRoutingController);
|
||||
@@ -200,33 +209,38 @@ namespace PepperDash.Essentials.DM
|
||||
|
||||
try
|
||||
{
|
||||
if(Global.ControlSystemIsDmps4kType)
|
||||
if (Global.ControlSystemIsDmps4kType)
|
||||
{
|
||||
tx = GetDmTxForChassisWithoutIpId(key, name, typeName, dmInput);
|
||||
Debug.Console(0, "DM endpoint output {0} is for DMPS3-4K, changing online feedback to chassis", num);
|
||||
tx.IsOnline.SetValueFunc(() => dmpsDev.InputEndpointOnlineFeedbacks[num].BoolValue);
|
||||
dmpsDev.InputEndpointOnlineFeedbacks[num].OutputChange += (o, a) => tx.IsOnline.FireUpdate();
|
||||
return tx;
|
||||
useChassisForOfflineFeedback = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return GetDmTxForChassisWithIpId(key, name, typeName, ipid, dmInput);
|
||||
tx = GetDmTxForChassisWithIpId(key, name, typeName, ipid, dmInput);
|
||||
if (typeName == "hdbasettx" || typeName == "dmtx4k100c1g")
|
||||
{
|
||||
useChassisForOfflineFeedback = true;
|
||||
}
|
||||
}
|
||||
if (useChassisForOfflineFeedback)
|
||||
{
|
||||
Debug.Console(0, "DM endpoint output {0} does not have direct online feedback, changing online feedback to chassis", num);
|
||||
tx.IsOnline.SetValueFunc(() => dmpsDev.InputEndpointOnlineFeedbacks[num].BoolValue);
|
||||
dmpsDev.InputEndpointOnlineFeedbacks[num].OutputChange += (o, a) => tx.IsOnline.FireUpdate();
|
||||
}
|
||||
return tx;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(0, "[{0}] WARNING: Cannot create DM-TX device for dmps: {1}", key, e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
Debug.Console(0, "Cannot create DM device '{0}'. '{1}' is not a processor, DM Chassis or DMPS.", key, pKey);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
Debug.Console(0, "Cannot create DM device '{0}'. '{1}' is not a processor, DM Chassis or DMPS.", key, pKey);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public abstract class BasicDmTxControllerBase : CrestronGenericBridgeableBaseDevice
|
||||
{
|
||||
@@ -237,21 +251,21 @@ namespace PepperDash.Essentials.DM
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[Description("Wrapper class for all DM-TX variants")]
|
||||
public abstract class DmTxControllerBase : BasicDmTxControllerBase
|
||||
{
|
||||
public abstract class DmTxControllerBase : BasicDmTxControllerBase
|
||||
{
|
||||
public virtual void SetPortHdcpCapability(eHdcpCapabilityType hdcpMode, uint port) { }
|
||||
public virtual eHdcpCapabilityType HdcpSupportCapability { get; protected set; }
|
||||
public abstract StringFeedback ActiveVideoInputFeedback { get; protected set; }
|
||||
public RoutingInputPortWithVideoStatuses AnyVideoInput { get; protected set; }
|
||||
public IntFeedback HdcpStateFeedback { get; protected set; }
|
||||
|
||||
protected DmTxControllerBase(string key, string name, EndpointTransmitterBase hardware)
|
||||
: base(key, name, hardware)
|
||||
{
|
||||
protected DmTxControllerBase(string key, string name, EndpointTransmitterBase hardware)
|
||||
: base(key, name, hardware)
|
||||
{
|
||||
AddToFeedbackList(ActiveVideoInputFeedback);
|
||||
|
||||
IsOnline.OutputChange += (currentDevice, args) =>
|
||||
@@ -262,11 +276,12 @@ namespace PepperDash.Essentials.DM
|
||||
feedback.FireUpdate();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
protected DmTxControllerBase(string key, string name, DmHDBasedTEndPoint hardware) : base(key, name, hardware)
|
||||
{
|
||||
}
|
||||
protected DmTxControllerBase(string key, string name, DmHDBasedTEndPoint hardware)
|
||||
: base(key, name, hardware)
|
||||
{
|
||||
}
|
||||
|
||||
protected DmTxControllerJoinMap GetDmTxJoinMap(uint joinStart, string joinMapKey)
|
||||
{
|
||||
@@ -280,8 +295,8 @@ namespace PepperDash.Essentials.DM
|
||||
return joinMap;
|
||||
}
|
||||
|
||||
protected void LinkDmTxToApi(DmTxControllerBase tx, BasicTriList trilist, DmTxControllerJoinMap joinMap, EiscApiAdvanced bridge)
|
||||
{
|
||||
protected void LinkDmTxToApi(DmTxControllerBase tx, BasicTriList trilist, DmTxControllerJoinMap joinMap, EiscApiAdvanced bridge)
|
||||
{
|
||||
if (bridge != null)
|
||||
{
|
||||
bridge.AddJoinMap(Key, joinMap);
|
||||
@@ -291,7 +306,7 @@ namespace PepperDash.Essentials.DM
|
||||
Debug.Console(0, this, "Please update config to use 'eiscapiadvanced' to get all join map features for this device.");
|
||||
}
|
||||
|
||||
Debug.Console(1, tx, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||
Debug.Console(1, tx, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||
|
||||
tx.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]);
|
||||
tx.AnyVideoInput.VideoStatus.VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus.JoinNumber]);
|
||||
@@ -318,8 +333,6 @@ namespace PepperDash.Essentials.DM
|
||||
txR.VideoSourceNumericFeedback.LinkInputSig(trilist.UShortInput[joinMap.VideoInput.JoinNumber]);
|
||||
txR.AudioSourceNumericFeedback.LinkInputSig(trilist.UShortInput[joinMap.AudioInput.JoinNumber]);
|
||||
|
||||
trilist.UShortInput[joinMap.HdcpSupportCapability.JoinNumber].UShortValue = (ushort)tx.HdcpSupportCapability;
|
||||
|
||||
if (txR.InputPorts[DmPortName.HdmiIn] != null)
|
||||
{
|
||||
var inputPort = txR.InputPorts[DmPortName.HdmiIn];
|
||||
@@ -366,7 +379,7 @@ namespace PepperDash.Essentials.DM
|
||||
{
|
||||
var intFeedback = tx.Feedbacks["HdmiIn2HdcpCapability"] as IntFeedback;
|
||||
if (intFeedback != null)
|
||||
intFeedback.LinkInputSig(trilist.UShortInput[joinMap.Port1HdcpState.JoinNumber]);
|
||||
intFeedback.LinkInputSig(trilist.UShortInput[joinMap.Port2HdcpState.JoinNumber]);
|
||||
}
|
||||
|
||||
if (inputPort.ConnectionType == eRoutingPortConnectionType.Hdmi && inputPort.Port != null)
|
||||
@@ -377,6 +390,40 @@ namespace PepperDash.Essentials.DM
|
||||
}
|
||||
}
|
||||
|
||||
if (txR.InputPorts[DmPortName.DisplayPortIn] != null)
|
||||
{
|
||||
var inputPort = txR.InputPorts[DmPortName.DisplayPortIn];
|
||||
|
||||
if (tx.Feedbacks["DisplayPortInHdcpCapability"] != null)
|
||||
{
|
||||
|
||||
var intFeedback = tx.Feedbacks["DisplayPortInHdcpCapability"] as IntFeedback;
|
||||
if (intFeedback != null)
|
||||
|
||||
intFeedback.LinkInputSig(trilist.UShortInput[joinMap.Port3HdcpState.JoinNumber]);
|
||||
|
||||
if (inputPort.ConnectionType == eRoutingPortConnectionType.DisplayPort && inputPort.Port != null)
|
||||
{
|
||||
var port = inputPort.Port as EndpointDisplayPortInput;
|
||||
SetHdcpCapabilityAction(port, joinMap.Port3HdcpState.JoinNumber, trilist);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var hdcpInputPortCount =
|
||||
(ushort)
|
||||
txR.InputPorts.Where(
|
||||
x => (x.Type == eRoutingSignalType.Video) || (x.Type == eRoutingSignalType.AudioVideo))
|
||||
.Where(
|
||||
x =>
|
||||
(x.ConnectionType == eRoutingPortConnectionType.DmCat) ||
|
||||
(x.ConnectionType == eRoutingPortConnectionType.Hdmi) ||
|
||||
(x.ConnectionType == eRoutingPortConnectionType.DisplayPort))
|
||||
.ToList().Count();
|
||||
|
||||
trilist.SetUshort(joinMap.HdcpInputPortCount.JoinNumber, hdcpInputPortCount);
|
||||
|
||||
}
|
||||
|
||||
var txFreeRun = tx as IHasFreeRun;
|
||||
@@ -416,7 +463,7 @@ namespace PepperDash.Essentials.DM
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
trilist.SetUShortSigAction(join,
|
||||
s =>
|
||||
{
|
||||
@@ -424,14 +471,40 @@ namespace PepperDash.Essentials.DM
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void SetHdcpCapabilityAction(EndpointDisplayPortInput port, uint join,
|
||||
BasicTriList trilist)
|
||||
{
|
||||
trilist.SetUShortSigAction(join,
|
||||
s =>
|
||||
{
|
||||
Debug.Console(0, this, "Trying to set HDCP to {0} on port {1}", s, port.ToString());
|
||||
port.HdcpCapability = (eHdcpCapabilityType) s;
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class DmTxControllerFactory : EssentialsDeviceFactory<DmTxControllerBase>
|
||||
{
|
||||
public DmTxControllerFactory()
|
||||
{
|
||||
TypeNames = new List<string>() { "dmtx200c", "dmtx201c", "dmtx201s", "dmtx4k100c", "dmtx4k202c", "dmtx4kz202c", "dmtx4k302c", "dmtx4kz302c",
|
||||
"dmtx401c", "dmtx401s", "dmtx4k100c1g", "dmtx4kz100c1g", "hdbasettx" };
|
||||
TypeNames = new List<string>
|
||||
{
|
||||
"dmtx200c",
|
||||
"dmtx201c",
|
||||
"dmtx201s",
|
||||
"dmtx4k100c",
|
||||
"dmtx4k202c",
|
||||
"dmtx4kz202c",
|
||||
"dmtx4k302c",
|
||||
"dmtx4kz302c",
|
||||
"dmtx401c",
|
||||
"dmtx401s",
|
||||
"dmtx4k100c1g",
|
||||
"dmtx4kz100c1g",
|
||||
"hdbasettx"
|
||||
};
|
||||
}
|
||||
|
||||
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||
@@ -441,8 +514,8 @@ namespace PepperDash.Essentials.DM
|
||||
Debug.Console(1, "Factory Attempting to create new DM-TX Device");
|
||||
|
||||
var props = JsonConvert.DeserializeObject
|
||||
<PepperDash.Essentials.DM.Config.DmTxPropertiesConfig>(dc.Properties.ToString());
|
||||
return PepperDash.Essentials.DM.DmTxHelper.GetDmTxController(dc.Key, dc.Name, type, props);
|
||||
<DmTxPropertiesConfig>(dc.Properties.ToString());
|
||||
return DmTxHelper.GetDmTxController(dc.Key, dc.Name, type, props);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -52,6 +52,9 @@ namespace PepperDash.Essentials.DM
|
||||
IsOnline.SetValueFunc(() => controller.InputEndpointOnlineFeedbacks[num].BoolValue);
|
||||
controller.InputEndpointOnlineFeedbacks[num].OutputChange += (o, a) => IsOnline.FireUpdate();
|
||||
}
|
||||
|
||||
PreventRegistration = true;
|
||||
tx.Register();
|
||||
}
|
||||
|
||||
#region IRoutingInputs Members
|
||||
|
||||
@@ -16,10 +16,17 @@ using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.DM.Config;
|
||||
|
||||
namespace PepperDash.Essentials.DM {
|
||||
public interface IDmSwitch {
|
||||
public interface IDmSwitch
|
||||
{
|
||||
Switch Chassis { get; }
|
||||
|
||||
Dictionary<uint, string> TxDictionary { get; }
|
||||
Dictionary<uint, string> RxDictionary { get; }
|
||||
}
|
||||
|
||||
public interface IDmSwitchWithEndpointOnlineFeedback : IDmSwitch
|
||||
{
|
||||
Dictionary<uint, BoolFeedback> InputEndpointOnlineFeedbacks { get; }
|
||||
Dictionary<uint, BoolFeedback> OutputEndpointOnlineFeedbacks { get; }
|
||||
}
|
||||
}
|
||||
@@ -105,6 +105,8 @@
|
||||
<Compile Include="Chassis\HdMdNxM4kEBridgeableController.cs" />
|
||||
<Compile Include="Chassis\HdMdNxM4kEController.cs" />
|
||||
<Compile Include="Config\InputPropertiesConfig.cs" />
|
||||
<Compile Include="Endpoints\EndpointInterfaces.cs" />
|
||||
<Compile Include="Endpoints\DGEs\DgeJoinMap.cs" />
|
||||
<Compile Include="Endpoints\DGEs\DmDge200CController.cs" />
|
||||
<Compile Include="Endpoints\Receivers\DmRmc4kZ100CController.cs" />
|
||||
<Compile Include="Endpoints\Receivers\DmRmc4kZScalerCController.cs" />
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
<packages>
|
||||
<package id="PepperDashCore" version="1.2.0" targetFramework="net35" allowedVersions="[1.0,2.0)"/>
|
||||
</packages>
|
||||
<package id="PepperDashCore" version="1.2.1" targetFramework="net35" allowedVersions="[1.0,2.0)"/>
|
||||
</packages>
|
||||
|
||||
Reference in New Issue
Block a user