#753 EssentialsCombinedHuddleVtc1Room should be ready for testing

This commit is contained in:
Neil Dorin
2021-07-21 21:33:57 -06:00
parent 152dcbe81e
commit c4752b2ac2
3 changed files with 24 additions and 54 deletions

View File

@@ -57,10 +57,11 @@ namespace PepperDash.Essentials
{ {
return () => return () =>
{ {
var disp = DefaultDisplay as DisplayBase; var displays = Displays.Where((d) => d is DisplayBase) as List<DisplayBase>;
var val = CurrentSourceInfo != null var val = CurrentSourceInfo != null
&& CurrentSourceInfo.Type == eSourceListItemType.Route && CurrentSourceInfo.Type == eSourceListItemType.Route
&& disp != null; && displays.Count() > 0;
//&& disp.PowerIsOnFeedback.BoolValue; //&& disp.PowerIsOnFeedback.BoolValue;
return val; return val;
}; };
@@ -246,6 +247,8 @@ namespace PepperDash.Essentials
DefaultAudioDevice = DeviceManager.GetDeviceForKey(PropertiesConfig.DefaultAudioKey) as IBasicVolumeControls; DefaultAudioDevice = DeviceManager.GetDeviceForKey(PropertiesConfig.DefaultAudioKey) as IBasicVolumeControls;
Displays = new List<IRoutingSinkWithSwitching>();
Initialize(); Initialize();
} }
catch (Exception e) catch (Exception e)
@@ -347,8 +350,8 @@ namespace PepperDash.Essentials
{ {
if (dispTwoWay.PowerIsOnFeedback.BoolValue != OnFeedback.BoolValue) if (dispTwoWay.PowerIsOnFeedback.BoolValue != OnFeedback.BoolValue)
{ {
if (!dispTwoWay.PowerIsOnFeedback.BoolValue) //if (!dispTwoWay.PowerIsOnFeedback.BoolValue)
CurrentSourceInfo = null; // CurrentSourceInfo = null;
OnFeedback.FireUpdate(); OnFeedback.FireUpdate();
} }
if (dispTwoWay.PowerIsOnFeedback.BoolValue) if (dispTwoWay.PowerIsOnFeedback.BoolValue)
@@ -371,41 +374,6 @@ namespace PepperDash.Essentials
} }
} }
var disp = DefaultDisplay as DisplayBase;
if (disp != null)
{
// Link power, warming, cooling to display
var dispTwoWay = disp as IHasPowerControlWithFeedback;
if (dispTwoWay != null)
{
dispTwoWay.PowerIsOnFeedback.OutputChange += (o, a) =>
{
if (dispTwoWay.PowerIsOnFeedback.BoolValue != OnFeedback.BoolValue)
{
if (!dispTwoWay.PowerIsOnFeedback.BoolValue)
CurrentSourceInfo = null;
OnFeedback.FireUpdate();
}
if (dispTwoWay.PowerIsOnFeedback.BoolValue)
{
SetDefaultLevels();
}
};
}
disp.IsWarmingUpFeedback.OutputChange += (o, a) =>
{
IsWarmingUpFeedback.FireUpdate();
if (!IsWarmingUpFeedback.BoolValue)
(CurrentVolumeControls as IBasicVolumeWithFeedback).SetVolume(DefaultVolume);
};
disp.IsCoolingDownFeedback.OutputChange += (o, a) =>
{
IsCoolingDownFeedback.FireUpdate();
};
}
} }
private void SetSourceListKey() private void SetSourceListKey()
@@ -624,8 +592,8 @@ namespace PepperDash.Essentials
if (string.IsNullOrEmpty(item.VolumeControlKey) if (string.IsNullOrEmpty(item.VolumeControlKey)
|| item.VolumeControlKey.Equals("$defaultAudio", StringComparison.OrdinalIgnoreCase)) || item.VolumeControlKey.Equals("$defaultAudio", StringComparison.OrdinalIgnoreCase))
volDev = DefaultVolumeControls; volDev = DefaultVolumeControls;
else if (item.VolumeControlKey.Equals("$defaultDisplay", StringComparison.OrdinalIgnoreCase)) //else if (item.VolumeControlKey.Equals("$defaultDisplay", StringComparison.OrdinalIgnoreCase))
volDev = DefaultDisplay as IBasicVolumeControls; // volDev = DefaultDisplay as IBasicVolumeControls;
// Or a specific device, probably rarely used. // Or a specific device, probably rarely used.
else else
{ {
@@ -717,15 +685,17 @@ namespace PepperDash.Essentials
// if there is a $defaultAll on route, run two separate // if there is a $defaultAll on route, run two separate
if (route.DestinationKey.Equals("$defaultAll", StringComparison.OrdinalIgnoreCase)) if (route.DestinationKey.Equals("$defaultAll", StringComparison.OrdinalIgnoreCase))
{ {
// Going to assume a single-path route for now foreach (var display in Displays)
{
var tempVideo = new SourceRouteListItem var tempVideo = new SourceRouteListItem
{ {
DestinationKey = "$defaultDisplay", DestinationKey = display.Key,
SourceKey = route.SourceKey, SourceKey = route.SourceKey,
Type = eRoutingSignalType.Video Type = eRoutingSignalType.Video
}; };
DoRoute(tempVideo); DoRoute(tempVideo);
} }
}
else else
DoRoute(route); DoRoute(route);
} }
@@ -740,11 +710,11 @@ namespace PepperDash.Essentials
IRoutingSink dest = null; IRoutingSink dest = null;
if (route.DestinationKey.Equals("$defaultaudio", StringComparison.OrdinalIgnoreCase)) if (route.DestinationKey.Equals("$defaultaudio", StringComparison.OrdinalIgnoreCase))
dest = DefaultAudioDevice as IRoutingSinkNoSwitching; dest = DefaultAudioDevice as IRoutingSink;
else if (route.DestinationKey.Equals("$defaultDisplay", StringComparison.OrdinalIgnoreCase)) //else if (route.DestinationKey.Equals("$defaultDisplay", StringComparison.OrdinalIgnoreCase))
dest = DefaultDisplay; // dest = DefaultDisplay;
else else
dest = DeviceManager.GetDeviceForKey(route.DestinationKey) as IRoutingSinkNoSwitching; dest = DeviceManager.GetDeviceForKey(route.DestinationKey) as IRoutingSink;
if (dest == null) if (dest == null)
{ {

View File

@@ -306,7 +306,7 @@ namespace PepperDash.Essentials
TriList.SetSigFalseAction(UIBoolJoin.DisplayPowerTogglePress, () => TriList.SetSigFalseAction(UIBoolJoin.DisplayPowerTogglePress, () =>
{ {
if (CurrentRoom != null && CurrentRoom.DefaultDisplay is IHasPowerControl) if (CurrentRoom != null && CurrentRoom.DefaultDisplay != null && CurrentRoom.DefaultDisplay is IHasPowerControl)
(CurrentRoom.DefaultDisplay as IHasPowerControl).PowerToggle(); (CurrentRoom.DefaultDisplay as IHasPowerControl).PowerToggle();
}); });

View File

@@ -319,7 +319,7 @@ namespace PepperDash.Essentials
TriList.SetSigFalseAction(UIBoolJoin.DisplayPowerTogglePress, () => TriList.SetSigFalseAction(UIBoolJoin.DisplayPowerTogglePress, () =>
{ {
if (CurrentRoom != null && CurrentRoom.DefaultDisplay is IHasPowerControl) if (CurrentRoom != null && CurrentRoom.DefaultDisplay != null && CurrentRoom.DefaultDisplay is IHasPowerControl)
(CurrentRoom.DefaultDisplay as IHasPowerControl).PowerToggle(); (CurrentRoom.DefaultDisplay as IHasPowerControl).PowerToggle();
}); });