Adds configuratble property for current audio/video output text. Defaults to "".

This commit is contained in:
Neil Dorin
2020-01-13 21:55:59 -07:00
parent 45788a4d6b
commit c3dbd41942
4 changed files with 27 additions and 4 deletions

View File

@@ -66,6 +66,11 @@ namespace PepperDash.Essentials.DM
public const int RouteOffTime = 500;
Dictionary<PortNumberType, CTimer> RouteOffTimers = new Dictionary<PortNumberType, CTimer>();
/// <summary>
/// Text that represents when an output has no source routed to it
/// </summary>
public string NoRouteText = "";
/// <summary>
/// Factory method to create a new chassis controller from config data. Limited to 8x8 right now
/// </summary>
@@ -128,6 +133,10 @@ namespace PepperDash.Essentials.DM
controller.InputNames = properties.InputNames;
controller.OutputNames = properties.OutputNames;
if (!string.IsNullOrEmpty(properties.NoRouteText))
controller.NoRouteText = properties.NoRouteText;
controller.PropertiesConfig = properties;
return controller;
}
@@ -217,7 +226,7 @@ namespace PepperDash.Essentials.DM
}
else
{
return "";
return NoRouteText;
}
});
OutputAudioRouteNameFeedbacks[tempX] = new StringFeedback(() =>
@@ -228,7 +237,7 @@ namespace PepperDash.Essentials.DM
}
else
{
return "";
return NoRouteText;
}
});

View File

@@ -48,6 +48,11 @@ namespace PepperDash.Essentials.DM
public const int RouteOffTime = 500;
Dictionary<PortNumberType, CTimer> RouteOffTimers = new Dictionary<PortNumberType, CTimer>();
/// <summary>
/// Text that represents when an output has no source routed to it
/// </summary>
public string NoRouteText = "";
public static DmpsRoutingController GetDmpsRoutingController(string key, string name,
DmpsRoutingPropertiesConfig properties)
{
@@ -67,6 +72,9 @@ namespace PepperDash.Essentials.DM
controller.InputNames = properties.InputNames;
controller.OutputNames = properties.OutputNames;
if (!string.IsNullOrEmpty(properties.NoRouteText))
controller.NoRouteText = properties.NoRouteText;
return controller;
}
@@ -191,7 +199,7 @@ namespace PepperDash.Essentials.DM
}
else
{
return "";
return NoRouteText;
}
});
OutputAudioRouteNameFeedbacks[outputCard.Number] = new StringFeedback(() =>
@@ -202,7 +210,7 @@ namespace PepperDash.Essentials.DM
}
else
{
return "";
return NoRouteText;
}
});

View File

@@ -32,6 +32,9 @@ namespace PepperDash.Essentials.DM.Config
[JsonProperty("outputNames")]
public Dictionary<uint, string> OutputNames { get; set; }
[JsonProperty("noRouteText")]
public string NoRouteText { get; set; }
[JsonProperty("inputSlotSupportsHdcp2")]
public Dictionary<uint, bool> InputSlotSupportsHdcp2 { get; set; }

View File

@@ -20,6 +20,9 @@ namespace PepperDash.Essentials.DM.Config
[JsonProperty("outputNames")]
public Dictionary<uint, string> OutputNames { get; set; }
[JsonProperty("noRouteText")]
public string NoRouteText { get; set; }
public DmpsRoutingPropertiesConfig()
{
InputNames = new Dictionary<uint, string>();