Converted ZoomRoom Layout Size properties and methods to interface, IHasSelfviewSize, following the patterns implemented for IHasSelfviewPosition and SelfviewPipPosition.

This commit is contained in:
Jason DeVito
2021-06-08 17:56:00 -05:00
parent ca8207f2bd
commit 1805ebaf0f
5 changed files with 104 additions and 143 deletions

View File

@@ -122,6 +122,7 @@
<Compile Include="Display\PanasonicThDisplay.cs" />
<Compile Include="VideoCodec\Interfaces\IHasParticipants.cs" />
<Compile Include="VideoCodec\Interfaces\IHasSelfviewPosition.cs" />
<Compile Include="VideoCodec\Interfaces\IHasSelfviewSize.cs" />
<Compile Include="VideoCodec\Interfaces\iVideoCodecInfo.cs" />
<Compile Include="Codec\iHasCallFavorites.cs" />
<Compile Include="Codec\iHasCallHistory.cs" />

View File

@@ -31,7 +31,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
BoolFeedback LayoutViewIsOnLastPageFeedback { get; } // TODO: #697 [*] Consider modifying to report button visibility in func
BoolFeedback CanSwapContentWithThumbnailFeedback { get; }
BoolFeedback ContentSwappedWithThumbnailFeedback { get; }
StringFeedback LayoutSizeFeedback { get; } // TODO: #714 [ ] Feature Layout Size
ZoomRoom.zConfiguration.eLayoutStyle LastSelectedLayout { get; }
ZoomRoom.zConfiguration.eLayoutStyle AvailableLayouts { get; }
@@ -42,9 +41,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
void LayoutTurnNextPage();
void LayoutTurnPreviousPage();
void GetCurrentLayoutSize(); // TODO: #714 [ ] Feature Layout Size
void SetLayoutSize(ZoomRoom.zConfiguration.eLayoutSize layoutSize); // TODO: #714 [ ] Feature Layout Size
}
public class LayoutInfoChangedEventArgs : EventArgs

View File

@@ -0,0 +1,13 @@
using PepperDash.Essentials.Devices.Common.VideoCodec.Cisco;
namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
{
public interface IHasSelfviewSize
{
StringFeedback SelfviewPipSizeFeedback { get; }
void SelfviewPipSizeSet(CodecCommandWithLabel size);
void SelfviewPipSizeToggle();
}
}

View File

@@ -25,7 +25,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
public class ZoomRoom : VideoCodecBase, IHasCodecSelfView, IHasDirectoryHistoryStack, ICommunicationMonitor,
IRouting,
IHasScheduleAwareness, IHasCodecCameras, IHasParticipants, IHasCameraOff, IHasCameraMute, IHasCameraAutoMode,
IHasFarEndContentStatus, IHasSelfviewPosition, IHasPhoneDialing, IHasZoomRoomLayouts, IHasParticipantPinUnpin, IHasParticipantAudioMute
IHasFarEndContentStatus, IHasSelfviewPosition, IHasPhoneDialing, IHasZoomRoomLayouts, IHasParticipantPinUnpin, IHasParticipantAudioMute, IHasSelfviewSize
{
private const long MeetingRefreshTimer = 60000;
private const uint DefaultMeetingDurationMin = 30;
@@ -108,6 +108,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
ReceivingContent = new BoolFeedback(FarEndIsSharingContentFeedbackFunc);
SelfviewPipPositionFeedback = new StringFeedback(SelfviewPipPositionFeedbackFunc);
// TODO: #714 [ ] SelfviewPipSizeFeedback
SelfviewPipSizeFeedback = new StringFeedback(SelfviewPipSizeFeedbackFunc);
SetUpFeedbackActions();
@@ -126,9 +129,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
LocalLayoutFeedback = new StringFeedback(LocalLayoutFeedbackFunc);
// TODO: #714 [ ] Feature Layout Size
LayoutSizeFeedback = new StringFeedback(LayoutSizeFeedbackFunc);
LayoutViewIsOnFirstPageFeedback = new BoolFeedback(LayoutViewIsOnFirstPageFeedbackFunc);
LayoutViewIsOnLastPageFeedback = new BoolFeedback(LayoutViewIsOnLastPageFeedbackFunc);
CanSwapContentWithThumbnailFeedback = new BoolFeedback(CanSwapContentWithThumbnailFeedbackFunc);
@@ -231,6 +231,19 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
}
}
// TODO: #714 [ ] SelfviewPipSizeFeedbackFunc
protected Func<string> SelfviewPipSizeFeedbackFunc
{
get
{
return
() =>
_currentSelfviewPipSize != null
? _currentSelfviewPipSize.Command ?? "Unknown"
: "Unknown";
}
}
protected Func<bool> LocalLayoutIsProminentFeedbackFunc
{
get { return () => false; }
@@ -498,7 +511,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
{
case "Position":
{
ComputeSelfviewPipStatus();
ComputeSelfviewPipPositionStatus();
SelfviewPipPositionFeedback.FireUpdate();
@@ -516,7 +529,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
}
case "Size":
{
// TODO: #714 [ ] SetupFeedbackActions >> Size
ComputeSelfviewPipSizeStatus();
SelfviewPipSizeFeedback.FireUpdate();
break;
}
@@ -530,7 +547,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
{
case "Position":
{
ComputeSelfviewPipStatus();
ComputeSelfviewPipPositionStatus();
SelfviewPipPositionFeedback.FireUpdate();
@@ -1803,28 +1820,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
}
});
layoutsCodec.LocalLayoutFeedback.LinkInputSig(trilist.StringInput[joinMap.GetSetCurrentLayout.JoinNumber]);
// TODO: #714 [ ] Feature Layout Size
trilist.SetSigFalseAction(joinMap.SetLayoutSizeOff.JoinNumber, () => layoutsCodec.SetLayoutSize(zConfiguration.eLayoutSize.Off));
trilist.SetSigFalseAction(joinMap.SetLayoutSize1.JoinNumber, () => layoutsCodec.SetLayoutSize(zConfiguration.eLayoutSize.Size1));
trilist.SetSigFalseAction(joinMap.SetLayoutSize2.JoinNumber, () => layoutsCodec.SetLayoutSize(zConfiguration.eLayoutSize.Size2));
trilist.SetSigFalseAction(joinMap.SetLayoutSize3.JoinNumber, () => layoutsCodec.SetLayoutSize(zConfiguration.eLayoutSize.Size3));
trilist.SetSigFalseAction(joinMap.SetLayoutSizeStrip.JoinNumber, () => layoutsCodec.SetLayoutSize(zConfiguration.eLayoutSize.Strip));
trilist.SetSigFalseAction(joinMap.GetSetCurrentLayoutSize.JoinNumber, layoutsCodec.GetCurrentLayoutSize);
trilist.SetStringSigAction(joinMap.GetSetCurrentLayoutSize.JoinNumber, (s) =>
{
try
{
var size = (zConfiguration.eLayoutSize)Enum.Parse(typeof(zConfiguration.eLayoutSize), s, true);
SetLayoutSize(size);
}
catch (Exception e)
{
Debug.Console(1, this, "Unable to parse '{0}' to zConfiguration.eLayoutSize: {1}", s, e);
}
});
layoutsCodec.LayoutSizeFeedback.LinkInputSig(trilist.StringInput[joinMap.GetSetCurrentLayoutSize.JoinNumber]);
layoutsCodec.LocalLayoutFeedback.LinkInputSig(trilist.StringInput[joinMap.GetSetCurrentLayout.JoinNumber]);
}
var pinCodec = this as IHasParticipantPinUnpin;
@@ -1835,6 +1831,16 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
// Set the value of the local property to be used when pinning a participant
trilist.SetUShortSigAction(joinMap.ScreenIndexToPinUserTo.JoinNumber, (u) => ScreenIndexToPinUserTo = u);
}
// TODO: #714 [ ] LinkZoomRoomToApi >> layoutSizeCoodec
var layoutSizeCodec = this as IHasSelfviewSize;
if (layoutSizeCodec != null)
{
trilist.SetSigFalseAction(joinMap.GetSetSelfviewPipSize.JoinNumber, layoutSizeCodec.SelfviewPipSizeToggle);
layoutSizeCodec.SelfviewPipSizeFeedback.LinkInputSig(trilist.StringInput[joinMap.GetSetSelfviewPipSize.JoinNumber]);
}
}
public override void ExecuteSwitch(object selector)
@@ -2206,13 +2212,58 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
new CodecCommandWithLabel("DownLeft", "Lower Left")
};
private void ComputeSelfviewPipStatus()
private void ComputeSelfviewPipPositionStatus()
{
_currentSelfviewPipPosition =
SelfviewPipPositions.FirstOrDefault(
p => p.Command.ToLower().Equals(Configuration.Call.Layout.Position.ToString().ToLower()));
}
#endregion
// TODO: #714 [ ] Implementation of IHasSelfviewPipSize
#region Implementation of IHasSelfviewPipSize
private CodecCommandWithLabel _currentSelfviewPipSize;
public StringFeedback SelfviewPipSizeFeedback { get; private set; }
public void SelfviewPipSizeSet(CodecCommandWithLabel size)
{
SendText(String.Format("zConfiguration Call Layout Size: {0}", size.Command));
}
public void SelfviewPipSizeToggle()
{
if (_currentSelfviewPipSize != null)
{
var nextPipSizeIndex = SelfviewPipSizes.IndexOf(_currentSelfviewPipSize) + 1;
if (nextPipSizeIndex >= SelfviewPipSizes.Count)
// Check if we need to loop back to the first item in the list
nextPipSizeIndex = 0;
SelfviewPipSizeSet(SelfviewPipSizes[nextPipSizeIndex]);
}
}
public List<CodecCommandWithLabel> SelfviewPipSizes = new List<CodecCommandWithLabel>()
{
new CodecCommandWithLabel("Off", "Off"),
new CodecCommandWithLabel("Size1", "Size 1"),
new CodecCommandWithLabel("Size2", "Size 2"),
new CodecCommandWithLabel("Size3", "Size 3"),
new CodecCommandWithLabel("Strip", "Strip")
};
private void ComputeSelfviewPipSizeStatus()
{
_currentSelfviewPipSize =
SelfviewPipSizes.FirstOrDefault(
p => p.Command.ToLower().Equals(Configuration.Call.Layout.Size.ToString().ToLower()));
}
#endregion
#region Implementation of IHasPhoneDialing
@@ -2333,46 +2384,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
SendText("zCommand Call Layout TurnPage Forward: Off");
}
// TODO: #714 [ ] Feature Layout Size
/// <summary>
/// Stores last selected layout size
/// </summary>
public zConfiguration.eLayoutSize LastSelectedLayoutSize { get; private set; }
// TODO: #714 [ ] Feature Layout Size
/// <summary>
/// Queries for current layout size
/// </summary>
public void GetCurrentLayoutSize()
{
SendText("zConfiguration Call Layout Size");
}
// TODO: #714 [ ] Feature Layout Size
/// <summary>
/// Sets selected layout size
/// </summary>
/// <param name="layoutSize">zConfiguration.eLayoutSize</param>
public void SetLayoutSize(zConfiguration.eLayoutSize layoutSize)
{
LastSelectedLayoutSize = layoutSize;
SendText(String.Format("zConfiguration Call Layout Size: {0}", layoutSize.ToString()));
}
// TODO: #714 [ ] Feature Layout Size
private Func<string> LayoutSizeFeedbackFunc
{
get
{
return () => Configuration.Call.Layout.Size.ToString();
}
}
/// <summary>
/// Layout size feedback
/// </summary>
public StringFeedback LayoutSizeFeedback { get; private set; }
#endregion
#region IHasCodecLayouts Members

View File

@@ -162,9 +162,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
JoinType = eJoinType.DigitalSerial
});
// TODO: #714 [ ] Feature Layout Size
[JoinName("SetLayoutSizeOff")]
public JoinDataComplete SetLayoutSizeOff = new JoinDataComplete(
// TODO: #714 [ ] JoinMap >> SelfivewPipSizeToggle
[JoinName("SelfviewPipSizeToggle")]
public JoinDataComplete SelfviewPipSizeToggle = new JoinDataComplete(
new JoinData
{
JoinNumber = 231,
@@ -172,70 +172,10 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
},
new JoinMetadata
{
Description = "Sets layout size off",
Description = "Toggles the selfview pip size, (aka layout size)",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
JoinType = eJoinType.Digital
});
// TODO: #714 [ ] Feature Layout Size
[JoinName("SetLayoutSize1")]
public JoinDataComplete SetLayoutSize1 = new JoinDataComplete(
new JoinData
{
JoinNumber = 232,
JoinSpan = 1
},
new JoinMetadata
{
Description = "Sets layout size 1",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
JoinType = eJoinType.Digital
});
// TODO: #714 [ ] Feature Layout Size
[JoinName("SetLayoutSize2")]
public JoinDataComplete SetLayoutSize2 = new JoinDataComplete(
new JoinData
{
JoinNumber = 233,
JoinSpan = 1
},
new JoinMetadata
{
Description = "Sets layout size 2",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
JoinType = eJoinType.Digital
});
// TODO: #714 [ ] Feature Layout Size
[JoinName("SetLayoutSize3")]
public JoinDataComplete SetLayoutSize3 = new JoinDataComplete(
new JoinData
{
JoinNumber = 234,
JoinSpan = 1
},
new JoinMetadata
{
Description = "Sets layout size 3",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
JoinType = eJoinType.Digital
});
// TODO: #714 [ ] Feature Layout Size
[JoinName("SetLayoutSizeStrip")]
public JoinDataComplete SetLayoutSizeStrip = new JoinDataComplete(
new JoinData
{
JoinNumber = 235,
JoinSpan = 1
},
new JoinMetadata
{
Description = "Sets layout size strip",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
JoinType = eJoinType.Digital
});
});
//[JoinName("ParticipantAudioMuteToggleStart")]
//public JoinDataComplete ParticipantAudioMuteToggleStart = new JoinDataComplete(
@@ -331,9 +271,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
JoinType = eJoinType.Serial
});
// TODO: #714 [ ] Feature Layout Size
[JoinName("GetSetCurrentLayoutSize")]
public JoinDataComplete GetSetCurrentLayoutSize = new JoinDataComplete(
// TODO: #714 [ ] JoinMap >> GetSetSelfviewPipSize
[JoinName("GetSetSelfviewPipSize")]
public JoinDataComplete GetSetSelfviewPipSize = new JoinDataComplete(
new JoinData
{
JoinNumber = 230,
@@ -341,7 +281,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
},
new JoinMetadata
{
Description = "Sets and reports the current layout size.",
Description = "Sets and reports the selfview pip size, (aka layout size).",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
JoinType = eJoinType.DigitalSerial
});