Updates to mute toggle for ZoomRoom

This commit is contained in:
Neil Dorin
2021-08-09 16:20:55 -06:00
parent 22aea3089d
commit cea1d2fcdd
2 changed files with 337 additions and 326 deletions

View File

@@ -316,7 +316,7 @@ namespace PepperDash.Essentials.UIDrivers
void CommunicationMonitor_StatusChange(object sender, MonitorStatusChangeEventArgs e) void CommunicationMonitor_StatusChange(object sender, MonitorStatusChangeEventArgs e)
{ {
var c = sender as ICommunicationMonitor; var c = sender as ICommunicationMonitor;
if (StatusListDeviceIndexes.ContainsKey(c)) if (c != null && StatusListDeviceIndexes.ContainsKey(c))
{ {
var i = StatusListDeviceIndexes[c]; var i = StatusListDeviceIndexes[c];
StatusList.UShortInputSig(i, 1).UShortValue = (ushort)e.Status; StatusList.UShortInputSig(i, 1).UShortValue = (ushort)e.Status;

View File

@@ -157,7 +157,18 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
{ {
get get
{ {
return () => CrestronEnvironment.ScaleWithLimits(Configuration.Audio.Output.Volume, 100, 0, 65535, 0); return () =>
{
var scaledVol = CrestronEnvironment.ScaleWithLimits(Configuration.Audio.Output.Volume, 100, 0, 65535, 0);
if (Configuration.Audio.Output.Volume != 0)
{
Debug.Console(2, this, "Storing previous volume level as: {0}, scaled: {1}", Configuration.Audio.Output.Volume, scaledVol);
_previousVolumeLevel = scaledVol; // Store the previous level for recall
}
return scaledVol;
};
} }
} }
@@ -1684,12 +1695,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
public override void MuteOff() public override void MuteOff()
{ {
Debug.Console(2, this, "Unmuting to previous level: {0}", _previousVolumeLevel);
SetVolume((ushort)_previousVolumeLevel); SetVolume((ushort)_previousVolumeLevel);
} }
public override void MuteOn() public override void MuteOn()
{ {
_previousVolumeLevel = Configuration.Audio.Output.Volume; // Store the previous level for recall
SetVolume(0); SetVolume(0);
} }