public void TestKeyType() { bool tested = false; var handler = CommandGenerator.CreateAutoCommandHandler <MixEffectKeyTypeSetCommand, MixEffectKeyPropertiesGetCommand>("KeyType"); AtemMockServerWrapper.Each(Output, Pool, handler, DeviceTestCases.All, helper => { SelectionOfKeyers <IBMDSwitcherKey>(helper, (stateBefore, keyerBefore, sdkKeyer, meId, keyId, i) => { try { tested = true; MixEffectKeyType target = Randomiser.EnumValue <MixEffectKeyType>(); _BMDSwitcherKeyType target2 = AtemEnumMaps.MixEffectKeyTypeMap[target]; keyerBefore.Properties.KeyType = target; helper.SendAndWaitForChange(stateBefore, () => { sdkKeyer.SetType(target2); }); } finally { // Reset it back afterwards, so that the dve is available for use elsewhere helper.SendAndWaitForChange(null, () => { sdkKeyer.SetType(_BMDSwitcherKeyType.bmdSwitcherKeyTypeLuma); }); } }); }); Assert.True(tested); }
public static bool IsAvailable(this MixEffectKeyType type, DeviceProfile profile) { if (!type.IsValid()) { return(false); } switch (type) { case MixEffectKeyType.DVE: return(profile.DVE > 0); default: return(true); } }