From 3cd8a1f310ad635c94aba3c2c06deac82ffec3f8 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Tue, 3 Nov 2020 08:30:13 -0700 Subject: [PATCH] update output change event & feedbacks --- .../Chassis/DmpsRoutingController.cs | 51 ++++++++++++++----- 1 file changed, 38 insertions(+), 13 deletions(-) diff --git a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmpsRoutingController.cs b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmpsRoutingController.cs index 9970be5c..06d9d7b6 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmpsRoutingController.cs +++ b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmpsRoutingController.cs @@ -351,10 +351,19 @@ namespace PepperDash.Essentials.DM ; }); AudioOutputFeedbacks[outputCard.Number] = new IntFeedback(() => - { - if (outputCard.AudioOutFeedback != null) { return (ushort)outputCard.AudioOutFeedback.Number; } - return 0; - ; + { + try + { + if (outputCard.AudioOutFeedback != null) + { + return (ushort) outputCard.AudioOutFeedback.Number; + } + return 0; + } + catch (NotSupportedException) + { + return (ushort) outputCard.AudioOutSourceFeedback; + } }); OutputNameFeedbacks[outputCard.Number] = new StringFeedback(() => @@ -753,15 +762,31 @@ namespace PepperDash.Essentials.DM } } else if (args.EventId == DMOutputEventIds.AudioOutEventId) - { - if (outputCard != null && outputCard.AudioOutFeedback != null) - { - Debug.Console(2, this, "DMSwitchAudio:{0} Routed Input:{1} Output:{2}'", this.Name, outputCard.AudioOutFeedback.Number, output); - } - if (AudioOutputFeedbacks.ContainsKey(output)) - { - AudioOutputFeedbacks[output].FireUpdate(); - } + { + try + { + if (outputCard != null && outputCard.AudioOutFeedback != null) + { + Debug.Console(2, this, "DMSwitchAudio:{0} Routed Input:{1} Output:{2}'", this.Name, + outputCard.AudioOutFeedback.Number, output); + } + if (AudioOutputFeedbacks.ContainsKey(output)) + { + AudioOutputFeedbacks[output].FireUpdate(); + } + } + catch (NotSupportedException) + { + if (outputCard != null) + { + Debug.Console(2, this, "DMSwitchAudio:{0} Routed Input:{1} Output:{2}'", Name, + outputCard.AudioOutSourceFeedback, output); + } + if (AudioOutputFeedbacks.ContainsKey(output)) + { + AudioOutputFeedbacks[output].FireUpdate(); + } + } } else if (args.EventId == DMOutputEventIds.OutputNameEventId && OutputNameFeedbacks.ContainsKey(output))