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

View File

@@ -48,6 +48,11 @@ namespace PepperDash.Essentials.DM
public const int RouteOffTime = 500; public const int RouteOffTime = 500;
Dictionary<PortNumberType, CTimer> RouteOffTimers = new Dictionary<PortNumberType, CTimer>(); 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, public static DmpsRoutingController GetDmpsRoutingController(string key, string name,
DmpsRoutingPropertiesConfig properties) DmpsRoutingPropertiesConfig properties)
{ {
@@ -67,6 +72,9 @@ namespace PepperDash.Essentials.DM
controller.InputNames = properties.InputNames; controller.InputNames = properties.InputNames;
controller.OutputNames = properties.OutputNames; controller.OutputNames = properties.OutputNames;
if (!string.IsNullOrEmpty(properties.NoRouteText))
controller.NoRouteText = properties.NoRouteText;
return controller; return controller;
} }
@@ -191,7 +199,7 @@ namespace PepperDash.Essentials.DM
} }
else else
{ {
return ""; return NoRouteText;
} }
}); });
OutputAudioRouteNameFeedbacks[outputCard.Number] = new StringFeedback(() => OutputAudioRouteNameFeedbacks[outputCard.Number] = new StringFeedback(() =>
@@ -202,7 +210,7 @@ namespace PepperDash.Essentials.DM
} }
else else
{ {
return ""; return NoRouteText;
} }
}); });

View File

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

View File

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