public void TestResetDVEFull() { bool tested = false; var expectedCmd = new MixEffectKeyDVESetCommand { Mask = MixEffectKeyDVESetCommand.MaskFlags.SizeX | MixEffectKeyDVESetCommand.MaskFlags.SizeY | MixEffectKeyDVESetCommand.MaskFlags.PositionX | MixEffectKeyDVESetCommand.MaskFlags.PositionY | MixEffectKeyDVESetCommand.MaskFlags.Rotation, SizeX = 1, SizeY = 1, PositionX = 0, PositionY = 0, Rotation = 0, }; var handler = CommandGenerator.MatchCommand(expectedCmd, true); AtemMockServerWrapper.Each(Output, Pool, handler, DeviceTestCases.All, helper => { SelectionOfKeyers <IBMDSwitcherKeyFlyParameters>(helper, (stateBefore, keyerBefore, sdkKeyer, meId, keyId, i) => { sdkKeyer.GetCanRotate(out int canRotate); if (canRotate != 0) { tested = true; expectedCmd.MixEffectIndex = meId; expectedCmd.KeyerIndex = keyId; helper.SendAndWaitForChange(stateBefore, () => { sdkKeyer.ResetDVEFull(); }); } }); }); Assert.True(tested); }
public void TestShuttle() { var expectedCmd = new HyperDeckPlayerSetCommand { Mask = HyperDeckPlayerSetCommand.MaskFlags.State | HyperDeckPlayerSetCommand.MaskFlags.PlaybackSpeed, State = HyperDeckPlayerState.Playing, }; var handler = CommandGenerator.MatchCommand(expectedCmd, true); AtemMockServerWrapper.Each(_output, _pool, handler, DeviceTestCases.HyperDecks, helper => { AtemState stateBefore = helper.Helper.BuildLibState(); foreach (IBMDSwitcherHyperDeck deck in GetHyperDecks(helper)) { deck.GetId(out long id); expectedCmd.Id = (uint)id; for (int i = 0; i < 5; i++) { expectedCmd.PlaybackSpeed = Randomiser.RangeInt(-100, 200); helper.SendAndWaitForChange(stateBefore, () => { deck.Shuttle(expectedCmd.PlaybackSpeed); }); } } }); }
public void TestStillCapture() { var handler = CommandGenerator.MatchCommand(new MediaPoolCaptureStillCommand()); AtemMockServerWrapper.Each(_output, _pool, handler, DeviceTestCases.MediaPlayerStillCapture, helper => { IBMDSwitcherStills stills = GetStillsPool(helper); IBMDSwitcherStillCapture stillCapture = stills as IBMDSwitcherStillCapture; Assert.NotNull(stillCapture); stillCapture.IsAvailable(out int available); Assert.Equal(1, available); for (int i = 0; i < 5; i++) { AtemState stateBefore = helper.Helper.BuildLibState(); uint timeBefore = helper.Server.CurrentTime; helper.SendAndWaitForChange(stateBefore, () => { stillCapture.CaptureStill(); }); // It should have sent a response, but we dont expect any comparable data Assert.NotEqual(timeBefore, helper.Server.CurrentTime); } }); }
public void TestDynamicsResetOutputPeakLevels() { var expected = new FairlightMixerSourceResetPeakLevelsCommand { DynamicsOutput = true }; var handler = CommandGenerator.MatchCommand(expected); AtemMockServerWrapper.Each(_output, _pool, handler, DeviceTestCases.FairlightMain, helper => { EachRandomSource(helper, (stateBefore, srcState, inputId, src, i) => { IBMDSwitcherFairlightAudioDynamicsProcessor dynamics = GetDynamics(src); expected.Index = (AudioSource)inputId; expected.SourceId = srcState.SourceId; uint timeBefore = helper.Server.CurrentTime; helper.SendAndWaitForChange(null, () => { dynamics.ResetOutputPeakLevels(); }); // It should have sent a response, but we dont expect any comparable data Assert.NotEqual(timeBefore, helper.Server.CurrentTime); }); }); }
public void TestResetPeakLevels() { bool tested = false; var expected = new AudioMixerResetPeaksCommand { Mask = AudioMixerResetPeaksCommand.MaskFlags.Input }; var handler = CommandGenerator.MatchCommand(expected); AtemMockServerWrapper.Each(_output, _pool, handler, DeviceTestCases.ClassicAudioMain, helper => { IEnumerable <long> useIds = helper.Helper.BuildLibState().Audio.Inputs.Keys.ToList(); foreach (long id in useIds) { tested = true; uint timeBefore = helper.Server.CurrentTime; expected.Input = (AudioSource)id; IBMDSwitcherAudioInput input = GetInput(helper, id); helper.SendAndWaitForChange(null, () => { input.ResetLevelNotificationPeaks(); }); // It should have sent a response, but we dont expect any comparable data Assert.NotEqual(timeBefore, helper.Server.CurrentTime); } }); Assert.True(tested); }
public void TestStoreAsKeyFrame() { bool tested = false; var expectedCmd = new MixEffectKeyFlyKeyframeStoreCommand(); var handler = CommandGenerator.MatchCommand(expectedCmd, true); AtemMockServerWrapper.Each(Output, Pool, handler, DeviceTestCases.All, helper => { SelectionOfKeyers <IBMDSwitcherKeyFlyParameters>(helper, (stateBefore, keyerBefore, sdkKeyer, meId, keyId, i) => { sdkKeyer.GetCanRotate(out int canRotate); if (canRotate != 0) { tested = true; expectedCmd.MixEffectIndex = meId; expectedCmd.KeyerIndex = keyId; expectedCmd.KeyFrame = Randomiser.EnumValue <FlyKeyKeyFrameId>(); var kfId = expectedCmd.KeyFrame == FlyKeyKeyFrameId.One ? _BMDSwitcherFlyKeyFrame.bmdSwitcherFlyKeyFrameA : _BMDSwitcherFlyKeyFrame.bmdSwitcherFlyKeyFrameB; helper.SendAndWaitForChange(stateBefore, () => { sdkKeyer.StoreAsKeyFrame(kfId); }); } }); }); Assert.True(tested); }
public void TestReset() { var target = new FairlightMixerSourceEqualizerResetCommand { Mask = FairlightMixerSourceEqualizerResetCommand.MaskFlags.Band }; var handler = CommandGenerator.MatchCommand(target); AtemMockServerWrapper.Each(_output, _pool, handler, DeviceTestCases.FairlightMain, helper => { ForSampleOfBands(helper, (stateBefore, bandState, band, inputId, sourceId, index) => { uint timeBefore = helper.Server.CurrentTime; target.Index = (AudioSource)inputId; target.SourceId = sourceId; target.Band = index; helper.SendAndWaitForChange(null, () => { band.Reset(); }); // It should have sent a response, but we dont expect any comparable data Assert.NotEqual(timeBefore, helper.Server.CurrentTime); }); }); }
public void TestReset() { var target = new FairlightMixerSourceDynamicsResetCommand() { Expander = true }; var handler = CommandGenerator.MatchCommand(target); AtemMockServerWrapper.Each(_output, _pool, handler, DeviceTestCases.FairlightMain, helper => { TestFairlightInputSource.EachRandomSource(helper, (stateBefore, srcState, inputId, src, i) => { IBMDSwitcherFairlightAudioExpander expander = GetExpander(src); target.Index = (AudioSource)inputId; target.SourceId = srcState.SourceId; uint timeBefore = helper.Server.CurrentTime; helper.SendAndWaitForChange(null, () => { expander.Reset(); }); // It should have sent a response, but we dont expect any comparable data Assert.NotEqual(timeBefore, helper.Server.CurrentTime); }, 1); }); }
public void TestSwitchDisk() { var handler = CommandGenerator.MatchCommand(new RecordingSwitchDiskCommand()); AtemMockServerWrapper.Each(_output, _pool, handler, DeviceTestCases.Streaming, helper => { var switcher = helper.SdkClient.SdkSwitcher as IBMDSwitcherRecordAV; Assert.NotNull(switcher); var stateBefore = helper.Helper.BuildLibState(); InitDisk(helper, stateBefore, 0); InitDisk(helper, stateBefore, 1); InitRecording(helper, stateBefore, 0, 1); for (int i = 0; i < 5; i++) { uint timeBefore = helper.Server.CurrentTime; helper.SendAndWaitForChange(null, () => { switcher.SwitchDisk(); }); // It should have sent a response, but we dont expect any comparable data Assert.NotEqual(timeBefore, helper.Server.CurrentTime); } }); }
public void TestStopStreaming() { var handler = CommandGenerator.MatchCommand(new StreamingStatusSetCommand { IsStreaming = false }); AtemMockServerWrapper.Each(_output, _pool, handler, DeviceTestCases.Streaming, helper => { var switcher = helper.SdkClient.SdkSwitcher as IBMDSwitcherStreamRTMP; Assert.NotNull(switcher); // Set streaming var stateBefore = helper.Helper.BuildLibState(); var streamCmd = new StreamingStatusGetCommand { Status = StreamingStatus.Streaming, Error = StreamingError.None }; stateBefore.Streaming.Status.State = StreamingStatus.Streaming; helper.SendFromServerAndWaitForChange(stateBefore, streamCmd); for (int i = 0; i < 5; i++) { uint timeBefore = helper.Server.CurrentTime; helper.SendAndWaitForChange(null, () => { switcher.StopStreaming(); }); // It should have sent a response, but we dont expect any comparable data Assert.NotEqual(timeBefore, helper.Server.CurrentTime); } }); }
public void TestRecordPause() { var expectedCommand = new MacroAddTimedPauseCommand(); var handler = CommandGenerator.MatchCommand(expectedCommand); AtemMockServerWrapper.Each(_output, _pool, handler, DeviceTestCases.All, helper => { var control = helper.SdkClient.SdkSwitcher as IBMDSwitcherMacroControl; Assert.NotNull(control); AtemState stateBefore = helper.Helper.BuildLibState(); for (int i = 0; i < 5; i++) { uint frames = Randomiser.RangeInt(2500); expectedCommand.Frames = frames; uint timeBefore = helper.Server.CurrentTime; helper.SendAndWaitForChange(stateBefore, () => { control.RecordPause(frames); }); // It should have sent a response, but we dont expect any comparable data Assert.NotEqual(timeBefore, helper.Server.CurrentTime); } }); }
public void TestRun() { var expectedCommand = RunThroughSerialize(new MacroActionCommand { Action = MacroActionCommand.MacroAction.Run }); var handler = CommandGenerator.MatchCommand(expectedCommand); AtemMockServerWrapper.Each(_output, _pool, handler, DeviceTestCases.All, helper => { var control = helper.SdkClient.SdkSwitcher as IBMDSwitcherMacroControl; Assert.NotNull(control); AtemState stateBefore = helper.Helper.BuildLibState(); for (int i = 0; i < 5; i++) { uint index = Randomiser.RangeInt((uint)stateBefore.Macros.Pool.Count); expectedCommand.Index = index; uint timeBefore = helper.Server.CurrentTime; helper.SendAndWaitForChange(stateBefore, () => { control.Run(index); }); // It should have sent a response, but we dont expect any comparable data Assert.NotEqual(timeBefore, helper.Server.CurrentTime); } }); }
public void TestStop() { var expectedCommand = RunThroughSerialize(new MacroActionCommand { Action = MacroActionCommand.MacroAction.Stop }); var handler = CommandGenerator.MatchCommand(expectedCommand); AtemMockServerWrapper.Each(_output, _pool, handler, DeviceTestCases.All, helper => { var control = helper.SdkClient.SdkSwitcher as IBMDSwitcherMacroControl; Assert.NotNull(control); uint timeBefore = helper.Server.CurrentTime; AtemState stateBefore = helper.Helper.BuildLibState(); helper.SendAndWaitForChange(stateBefore, () => { control.StopRunning(); }); // It should have sent a response, but we dont expect any comparable data Assert.NotEqual(timeBefore, helper.Server.CurrentTime); }); }
public void TestResetColorAdjustments() { MixEffectKeyAdvancedChromaResetCommand keyerTarget = new MixEffectKeyAdvancedChromaResetCommand { ColorAdjustments = true }; var handler = CommandGenerator.MatchCommand(keyerTarget); bool tested = false; AtemMockServerWrapper.Each(Output, Pool, handler, DeviceTestCases.AdvancedChromaKeyer, helper => { SelectionOfKeyers <IBMDSwitcherKeyAdvancedChromaParameters>(helper, (stateBefore, keyerBefore, sdkKeyer, meId, keyId, i) => { tested = true; Assert.NotNull(keyerBefore.AdvancedChroma); keyerTarget.MixEffectIndex = meId; keyerTarget.KeyerIndex = keyId; uint timeBefore = helper.Server.CurrentTime; helper.SendAndWaitForChange(null, () => { sdkKeyer.ResetColorAdjustments(); }); // It should have sent a response, but we dont expect any comparable data Assert.NotEqual(timeBefore, helper.Server.CurrentTime); }, 1); }); Assert.True(tested); }
public void TestJog() { var expectedCmd = new HyperDeckPlayerSetCommand { Mask = HyperDeckPlayerSetCommand.MaskFlags.Jog, }; var handler = CommandGenerator.MatchCommand(expectedCmd, true); AtemMockServerWrapper.Each(_output, _pool, handler, DeviceTestCases.HyperDecks, helper => { foreach (IBMDSwitcherHyperDeck deck in GetHyperDecks(helper)) { deck.GetId(out long id); expectedCmd.Id = (uint)id; expectedCmd.Jog = Randomiser.RangeInt(-100, 100); AtemState stateBefore = helper.Helper.BuildLibState(); helper.SendAndWaitForChange(stateBefore, () => { deck.Jog(expectedCmd.Jog); }); } }); }
public void TestAuto() { var expected = new DownstreamKeyAutoV8Command(); var handler = CommandGenerator.MatchCommand(expected, true); AtemMockServerWrapper.Each(_output, _pool, handler, DeviceTestCases.All, helper => { EachKeyer(helper, (stateBefore, state, props, id, i) => { expected.Index = id; helper.SendAndWaitForChange(stateBefore, () => { props.PerformAutoTransition(); }); }); }); }
public void TestRequestTimecode() { var handler = CommandGenerator.MatchCommand(new TimeCodeRequestCommand()); AtemMockServerWrapper.Each(_output, _pool, handler, DeviceTestCases.All, helper => { IBMDSwitcher switcher = helper.SdkClient.SdkSwitcher; AtemState stateBefore = helper.Helper.BuildLibState(); uint timeBefore = helper.Server.CurrentTime; helper.SendAndWaitForChange(stateBefore, () => { switcher.RequestTimeCode(); }); // It should have sent a response, but we dont expect any comparable data Assert.NotEqual(timeBefore, helper.Server.CurrentTime); }); }
public void TestClearPool() { var expectedCmd = new MediaPoolClearAllCommand(); AtemMockServerWrapper.Each(_output, _pool, CommandGenerator.MatchCommand(expectedCmd), DeviceTestCases.MediaPlayer, helper => { IBMDSwitcherMediaPool pool = GetMediaPool(helper); for (int i = 0; i < 3; i++) { AtemState stateBefore = helper.Helper.BuildLibState(); helper.SendAndWaitForChange(stateBefore, () => { pool.Clear(); }); } }); }
public void TestPerformAuto() { var expected = new MixEffectAutoCommand(); bool tested = false; var handler = CommandGenerator.MatchCommand(expected); AtemMockServerWrapper.Each(Output, Pool, handler, DeviceTestCases.All, helper => { EachMixEffect <IBMDSwitcherMixEffectBlock>(helper, (stateBefore, meBefore, sdk, meId, i) => { tested = true; expected.Index = meId; helper.SendAndWaitForChange(stateBefore, () => { sdk.PerformAutoTransition(); }); }); }); Assert.True(tested); }
public void TestAutoInDirection() { var expected = new DownstreamKeyAutoV8Command { Mask = DownstreamKeyAutoV8Command.MaskFlags.IsTowardsOnAir }; var handler = CommandGenerator.MatchCommand(expected); AtemMockServerWrapper.Each(_output, _pool, handler, DeviceTestCases.All, helper => { EachKeyer(helper, (stateBefore, state, props, id, i) => { expected.Index = id; expected.IsTowardsOnAir = i % 2 != 0; helper.SendAndWaitForChange(stateBefore, () => { props.PerformAutoTransitionInDirection(i % 2); }); }); }); }
public void TestClearStartupState() { var handler = CommandGenerator.MatchCommand(new StartupStateClearCommand()); AtemMockServerWrapper.Each(_output, _pool, handler, DeviceTestCases.SerialPort, helper => { IBMDSwitcherSaveRecall saveRecall = helper.SdkClient.SdkSwitcher as IBMDSwitcherSaveRecall; Assert.NotNull(saveRecall); AtemState stateBefore = helper.Helper.BuildLibState(); uint timeBefore = helper.Server.CurrentTime; helper.SendAndWaitForChange(stateBefore, () => { saveRecall.Clear(_BMDSwitcherSaveRecallType.bmdSwitcherSaveRecallTypeStartupState); }); // It should have sent a response, but we dont expect any comparable data Assert.NotEqual(timeBefore, helper.Server.CurrentTime); }); }
public void TestReset() { var target = new FairlightMixerMasterDynamicsResetCommand { Limiter = true }; var handler = CommandGenerator.MatchCommand(target); AtemMockServerWrapper.Each(_output, _pool, handler, DeviceTestCases.FairlightMain, helper => { IBMDSwitcherFairlightAudioLimiter limiter = GetLimiter(helper); uint timeBefore = helper.Server.CurrentTime; helper.SendAndWaitForChange(null, () => { limiter.Reset(); }); // It should have sent a response, but we dont expect any comparable data Assert.NotEqual(timeBefore, helper.Server.CurrentTime); }); }
public void TestResetPeakLevels() { var expected = new AudioMixerResetPeaksCommand { Mask = AudioMixerResetPeaksCommand.MaskFlags.Monitor }; var handler = CommandGenerator.MatchCommand(expected, true); AtemMockServerWrapper.Each(_output, _pool, handler, DeviceTestCases.ClassicAudioMonitors, helper => { uint timeBefore = helper.Server.CurrentTime; IBMDSwitcherAudioMonitorOutput monitor = GetMonitor(helper); helper.SendAndWaitForChange(null, () => { monitor.ResetLevelNotificationPeaks(); }); // It should have sent a response, but we dont expect any comparable data Assert.NotEqual(timeBefore, helper.Server.CurrentTime); }); }
public void TestRequestDuration() { var handler = CommandGenerator.MatchCommand(new StreamingRequestDurationCommand()); AtemMockServerWrapper.Each(_output, _pool, handler, DeviceTestCases.Streaming, helper => { var switcher = helper.SdkClient.SdkSwitcher as IBMDSwitcherStreamRTMP; Assert.NotNull(switcher); for (int i = 0; i < 5; i++) { uint timeBefore = helper.Server.CurrentTime; helper.SendAndWaitForChange(null, () => { switcher.RequestDuration(); }); // It should have sent a response, but we dont expect any comparable data Assert.NotEqual(timeBefore, helper.Server.CurrentTime); } }); }
public void TestResetProgramOutPeaks() { var expected = new AudioMixerResetPeaksCommand { Mask = AudioMixerResetPeaksCommand.MaskFlags.Master }; var handler = CommandGenerator.MatchCommand(expected, true); AtemMockServerWrapper.Each(_output, _pool, handler, DeviceTestCases.ClassicAudioMain, helper => { IBMDSwitcherAudioMixer mixer = GetAudioMixer(helper); AtemState stateBefore = helper.Helper.BuildLibState(); uint timeBefore = helper.Server.CurrentTime; helper.SendAndWaitForChange(stateBefore, () => { mixer.ResetProgramOutLevelNotificationPeaks(); }); // It should have sent a response, but we dont expect any comparable data Assert.NotEqual(timeBefore, helper.Server.CurrentTime); }); }
public void TestResetAllPeaks() { var expected = new FairlightMixerResetPeakLevelsCommand { All = true }; var handler = CommandGenerator.MatchCommand(expected); AtemMockServerWrapper.Each(_output, _pool, handler, DeviceTestCases.FairlightMain, helper => { IBMDSwitcherFairlightAudioMixer mixer = GetFairlightMixer(helper); AtemState stateBefore = helper.Helper.BuildLibState(); uint timeBefore = helper.Server.CurrentTime; helper.SendAndWaitForChange(stateBefore, () => { mixer.ResetAllPeakLevels(); }); // It should have sent a response, but we dont expect any comparable data Assert.NotEqual(timeBefore, helper.Server.CurrentTime); }); }
public void TestResetNames() { var expectedCmd = new InputNameResetCommand(); AtemMockServerWrapper.Each(_output, _pool, CommandGenerator.MatchCommand(expectedCmd), DeviceTestCases.All, helper => { List <VideoSource> inputIds = helper.Helper.BuildLibState().Settings.Inputs.Keys.ToList(); foreach (VideoSource id in Randomiser.SelectionOfGroup(inputIds)) { AtemState stateBefore = helper.Helper.BuildLibState(); expectedCmd.Id = id; IBMDSwitcherInput input = GetInput(helper, id); helper.SendAndWaitForChange(stateBefore, () => { input.ResetNames(); }); } }); }
public void TestAtBeginning() { try { var expectedCommand = new MediaPlayerClipStatusSetCommand { Mask = MediaPlayerClipStatusSetCommand.MaskFlags.AtBeginning, AtBeginning = true }; var handler = CommandGenerator.MatchCommand(expectedCommand, true); AtemMockServerWrapper.Each(_output, _pool, handler, DeviceTestCases.MediaPlayerClips, helper => { var tested = false; var players = GetMediaPlayers(helper); foreach (Tuple <uint, IBMDSwitcherMediaPlayer> player in players) { tested = true; expectedCommand.Index = (MediaPlayerId)player.Item1; AtemState stateBefore = helper.Helper.BuildLibState(); uint timeBefore = helper.Server.CurrentTime; helper.SendAndWaitForChange(stateBefore, () => { player.Item2.SetAtBeginning(); }); // It should have sent a response, but we dont expect any comparable data Assert.NotEqual(timeBefore, helper.Server.CurrentTime); } Assert.True(tested); }); } finally { _pool.StateSettings.TrackMediaClipFrames = false; } }
public void TestSendLevelsCommand() { var expected = new FairlightMixerSendLevelsCommand(); var handler = CommandGenerator.MatchCommand(expected); AtemMockServerWrapper.Each(_output, _pool, handler, DeviceTestCases.FairlightMain, helper => { IBMDSwitcherFairlightAudioMixer mixer = GetFairlightMixer(helper); AtemState stateBefore = helper.Helper.BuildLibState(); for (int i = 0; i < 5; i++) { uint timeBefore = helper.Server.CurrentTime; expected.SendLevels = i % 2 == 1; helper.SendAndWaitForChange(stateBefore, () => { mixer.SetAllLevelNotificationsEnabled(i % 2); }); // It should have sent a response, but we dont expect any comparable data Assert.NotEqual(timeBefore, helper.Server.CurrentTime); } }); }
public void TestSetTimecode() { var expectedCmd = new TimeCodeCommand(); var handler = CommandGenerator.MatchCommand(expectedCmd, false, "IsDropFrame"); AtemMockServerWrapper.Each(_output, _pool, handler, DeviceTestCases.All, helper => { IBMDSwitcher switcher = helper.SdkClient.SdkSwitcher; AtemState stateBefore = helper.Helper.BuildLibState(); uint timeBefore = helper.Server.CurrentTime; helper.SendAndWaitForChange(stateBefore, () => { switcher.SetTimeCode((byte)expectedCmd.Hour, (byte)expectedCmd.Minute, (byte)expectedCmd.Second, (byte)expectedCmd.Frame); }); // It should have sent a response, but we dont expect any comparable data Assert.NotEqual(timeBefore, helper.Server.CurrentTime); }); }