protected static void EachSuperSourceBox(AtemMockServerWrapper helper, Action <AtemState, SuperSourceState.BoxState, IBMDSwitcherSuperSourceBox, SuperSourceId, SuperSourceBoxId, int> fcn, int iterations = 5) { var allBoxes = new List <Tuple <SuperSourceId, SuperSourceBoxId, IBMDSwitcherSuperSourceBox> >(); foreach (KeyValuePair <VideoSource, IBMDSwitcherInputSuperSource> ssrc in helper.GetSdkInputsOfType <IBMDSwitcherInputSuperSource>()) { SuperSourceId id = (SuperSourceId)(ssrc.Key - VideoSource.SuperSource); var iterator = AtemSDKConverter.CastSdk <IBMDSwitcherSuperSourceBoxIterator>(ssrc.Value.CreateIterator); AtemSDKConverter.Iterate <IBMDSwitcherSuperSourceBox>(iterator.Next, (box, i) => { allBoxes.Add(Tuple.Create(id, (SuperSourceBoxId)i, box)); }); } var boxes = Randomiser.SelectionOfGroup(allBoxes); foreach (Tuple <SuperSourceId, SuperSourceBoxId, IBMDSwitcherSuperSourceBox> box in boxes) { AtemState stateBefore = helper.Helper.BuildLibState(); SuperSourceState.BoxState boxBefore = stateBefore.SuperSources[(int)box.Item1].Boxes[(int)box.Item2]; Assert.NotNull(boxBefore); for (int i = 0; i < iterations; i++) { fcn(stateBefore, boxBefore, box.Item3, box.Item1, box.Item2, i); } } }
private void EachTalkback(AtemMockServerWrapper helper, Action <AtemState, SettingsState.TalkbackState, IBMDSwitcherTalkback, uint> fcn) { AtemState stateBefore = helper.Helper.BuildLibState(); var it = AtemSDKConverter.CastSdk <IBMDSwitcherTalkbackIterator>(helper.SdkClient.SdkSwitcher .CreateIterator); AtemSDKConverter.Iterate <IBMDSwitcherTalkback>(it.Next, (talkback, i) => { SettingsState.TalkbackState talkbackState = stateBefore.Settings.Talkback[(int)i]; fcn(stateBefore, talkbackState, talkback, i); }); }