public void TestArtKeyInput() { bool tested = false; var handler = CommandGenerator.CreateAutoCommandHandler <SuperSourcePropertiesSetV8Command, SuperSourcePropertiesGetV8Command>("ArtCutSource"); AtemMockServerWrapper.Each(_output, _pool, handler, DeviceTestCases.SuperSource, helper => { VideoSource[] validSources = helper.Helper.BuildLibState().Settings.Inputs.Where( i => i.Value.Properties.SourceAvailability.HasFlag(SourceAvailability.SuperSourceArt) ).Select(i => i.Key).ToArray(); var sampleSources = VideoSourceUtil.TakeSelection(validSources); EachSuperSource(helper, (stateBefore, ssrcBefore, sdk, ssrcId, i) => { tested = true; // TODO GetCutInputAvailabilityMask VideoSource target = sampleSources[i]; ssrcBefore.Properties.ArtCutSource = target; helper.SendAndWaitForChange(stateBefore, () => { sdk.SetInputCut((long)target); }); }, sampleSources.Length); }); Assert.True(tested); }
protected static VideoSource[] GetTransitionSourcesSelection(AtemMockServerWrapper helper) { VideoSource[] validSources = helper.Helper.BuildLibState().Settings.Inputs.Where( i => i.Value.Properties.SourceAvailability.HasFlag(SourceAvailability.KeySource) ).Select(i => i.Key).ToArray(); return(VideoSourceUtil.TakeSelection(validSources)); }
public void TestFillSource() { bool tested = false; var handler = CommandGenerator.CreateAutoCommandHandler <TransitionDVESetCommand, TransitionDVEGetCommand>("FillSource"); AtemMockServerWrapper.Each(Output, Pool, handler, DeviceTestCases.All, helper => { VideoSource[] validSources = helper.Helper.BuildLibState().Settings.Inputs.Where( i => i.Value.Properties.SourceAvailability.HasFlag(SourceAvailability.KeySource) ).Select(i => i.Key).ToArray(); var sampleSources = VideoSourceUtil.TakeSelection(validSources); EachMixEffect <IBMDSwitcherTransitionDVEParameters>(helper, (stateBefore, meBefore, sdk, meId, i) => { tested = true; Assert.NotNull(meBefore.Transition.DVE); // sdk.GetFillInputAvailabilityMask(out _BMDSwitcherInputAvailability mask); // Assert.Equal((long)SourceAvailability., (long)mask); VideoSource target = sampleSources[i]; meBefore.Transition.DVE.FillSource = target; helper.SendAndWaitForChange(stateBefore, () => { sdk.SetInputFill((long)target); }); }, sampleSources.Length); }); Assert.True(tested); }
public void TestSource() { AtemMockServerWrapper.Each(_output, _pool, SourceCommandHandler, DeviceTestCases.All, helper => { Dictionary <VideoSource, IBMDSwitcherInputAux> allAuxes = helper.GetSdkInputsOfType <IBMDSwitcherInputAux>(); VideoSource[] chosenIds = VideoSourceUtil.TakeSelection(allAuxes.Keys.ToArray()); foreach (VideoSource auxSource in chosenIds) { uint auxId = AtemEnumMaps.GetAuxId(auxSource); IBMDSwitcherInputAux aux = allAuxes[auxSource]; // GetInputAvailabilityMask is used when checking if another input can be used for this output. // We track this another way aux.GetInputAvailabilityMask(out _BMDSwitcherInputAvailability availabilityMask); Assert.Equal(availabilityMask, (_BMDSwitcherInputAvailability)((int)SourceAvailability.Auxiliary << 2)); AtemState stateBefore = helper.Helper.BuildLibState(); VideoSource[] validSources = stateBefore.Settings.Inputs.Where( i => i.Value.Properties.SourceAvailability.HasFlag(SourceAvailability.Auxiliary) ).Select(i => i.Key).ToArray(); var sampleSources = VideoSourceUtil.TakeSelection(validSources); foreach (VideoSource src in sampleSources) { stateBefore.Auxiliaries[(int)auxId].Source = src; helper.SendAndWaitForChange(stateBefore, () => { aux.SetInputSource((long)src); }); } } }); }
public void TestCutSource() { var handler = CommandGenerator.CreateAutoCommandHandler <DownstreamKeyCutSourceSetCommand, DownstreamKeySourceGetCommand>("CutSource", true); AtemMockServerWrapper.Each(_output, _pool, handler, DeviceTestCases.All, helper => { VideoSource[] validSources = helper.Helper.BuildLibState().Settings.Inputs.Where( i => i.Value.Properties.SourceAvailability.HasFlag(SourceAvailability.KeySource) ).Select(i => i.Key).ToArray(); var sampleSources = VideoSourceUtil.TakeSelection(validSources); EachKeyer(helper, (stateBefore, state, props, id, i) => { // TODO GetCutInputAvailabilityMask VideoSource target = sampleSources[i]; state.Sources.CutSource = target; helper.SendAndWaitForChange(stateBefore, () => { props.SetInputCut((long)target); }); }, sampleSources.Length); }); }
public void TestCutSource() { var handler = CommandGenerator.CreateAutoCommandHandler <MixEffectKeyCutSourceSetCommand, MixEffectKeyPropertiesGetCommand>("CutSource", true); AtemMockServerWrapper.Each(Output, Pool, handler, DeviceTestCases.All, helper => { VideoSource[] validSources = helper.Helper.BuildLibState().Settings.Inputs.Where( i => i.Value.Properties.SourceAvailability.HasFlag(SourceAvailability.KeySource) ).Select(i => i.Key).ToArray(); var sampleSources = VideoSourceUtil.TakeSelection(validSources); SelectionOfKeyers <IBMDSwitcherKey>(helper, (stateBefore, keyerBefore, sdkKeyer, meId, keyId, i) => { // TODO GetCutInputAvailabilityMask VideoSource target = sampleSources[i]; keyerBefore.Properties.CutSource = target; helper.SendAndWaitForChange(stateBefore, () => { sdkKeyer.SetInputCut((long)target); }); }, sampleSources.Length); }); }