From 1df8d3f6177efb7d5eecad054e1b0b8f6f86768e Mon Sep 17 00:00:00 2001 From: jkdevito Date: Thu, 2 Nov 2023 11:54:44 -0500 Subject: [PATCH] feat: create branch to add volume control --- .../Chassis/HdPsXxxController.cs | 35 +++++++++++++++++-- .../Config/HdPsXxxPropertiesConfig.cs | 3 ++ 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/essentials-framework/Essentials DM/Essentials_DM/Chassis/HdPsXxxController.cs b/essentials-framework/Essentials DM/Essentials_DM/Chassis/HdPsXxxController.cs index 36e99bc6..f676c80c 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/Chassis/HdPsXxxController.cs +++ b/essentials-framework/Essentials DM/Essentials_DM/Chassis/HdPsXxxController.cs @@ -16,9 +16,11 @@ using PepperDash_Essentials_DM.Config; namespace PepperDash_Essentials_DM.Chassis { [Description("Wrapper class for all HdPsXxx switchers")] - public class HdPsXxxController : CrestronGenericBridgeableBaseDevice, IRoutingNumericWithFeedback, IRoutingHasVideoInputSyncFeedbacks + public class HdPsXxxController : CrestronGenericBridgeableBaseDevice, IRoutingNumericWithFeedback, IRoutingHasVideoInputSyncFeedbacks, IHasVolumeControlWithFeedback { private readonly HdPsXxx _chassis; + private readonly string _defaultAudioKey = ""; + public RoutingPortCollection InputPorts { get; private set; } public RoutingPortCollection OutputPorts { get; private set; } @@ -82,6 +84,9 @@ namespace PepperDash_Essentials_DM.Chassis OutputNames = props.Outputs; SetupOutputs(OutputNames); + + if (!string.IsNullOrEmpty(props.DefaultAudioKey)) + _defaultAudioKey = props.DefaultAudioKey; } // get input priorities @@ -413,6 +418,31 @@ Selector: {4} _chassis.AutoRouteOff(); } + #region IHasVolumeWithFeedback Members + + public void VolumeUp(bool pressRelease) + { + + } + + public void VolumeDown(bool pressRelease) + { + throw new NotImplementedException(); + } + + public void SetVolume(ushort level) + { + throw new NotImplementedException(); + } + + public IntFeedback VolumeLevelFeedback { get; private set; } + + + + #endregion + + + #region Events @@ -517,6 +547,7 @@ Selector: {4} #endregion + #region Factory @@ -571,7 +602,7 @@ Selector: {4} } - #endregion + #endregion } diff --git a/essentials-framework/Essentials DM/Essentials_DM/Config/HdPsXxxPropertiesConfig.cs b/essentials-framework/Essentials DM/Essentials_DM/Config/HdPsXxxPropertiesConfig.cs index 576b74f0..9b988dd1 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/Config/HdPsXxxPropertiesConfig.cs +++ b/essentials-framework/Essentials DM/Essentials_DM/Config/HdPsXxxPropertiesConfig.cs @@ -15,6 +15,9 @@ namespace PepperDash_Essentials_DM.Config [JsonProperty("outputs")] public Dictionary Outputs { get; set; } + [JsonProperty("defaultAudioKey")] + public string DefaultAudioKey { get; set; } + // "inputPriorities": "1,4,3,2" [JsonProperty("inputPriorities")] public string InputPriorities { get; set; }