public void TestPortType() { bool tested = false; AtemMockServerWrapper.Each(_output, _pool, null, DeviceTestCases.ClassicAudioMain, helper => { var rawCommands = helper.Server.GetParsedDataDump(); IEnumerable <long> useIds = helper.Helper.BuildLibState().Audio.Inputs.Keys.ToList(); foreach (long id in useIds) { tested = true; AtemState stateBefore = helper.Helper.BuildLibState(); var inputState = stateBefore.Audio.Inputs[id].Properties; var srcCommand = RawGetCommand(rawCommands, id); for (int i = 0; i < 5; i++) { AudioPortType target = Randomiser.EnumValue(AudioPortType.Unknown); inputState.PortType = target; srcCommand.PortType = target; helper.SendAndWaitForChange(stateBefore, () => { helper.Server.SendCommands(srcCommand); }); } } }); Assert.True(tested); }
/* * public static AudioPortType ToAudioPortType(this ExternalPortTypeFlags type) * { * * }*/ public static ExternalPortTypeFlags ToExternalPortType(this AudioPortType type) { if (type >= AudioPortType.XLR) { return((ExternalPortTypeFlags)((int)type << 1)); } if (type == AudioPortType.Internal) { return(ExternalPortTypeFlags.Internal); } return((ExternalPortTypeFlags)type); }