public void TestReset() { var target = new FairlightMixerSourceDynamicsResetCommand() { Limiter = true }; var handler = CommandGenerator.MatchCommand(target); AtemMockServerWrapper.Each(_output, _pool, handler, DeviceTestCases.FairlightMain, helper => { TestFairlightInputSource.EachRandomSource(helper, (stateBefore, srcState, inputId, src, i) => { IBMDSwitcherFairlightAudioLimiter limiter = GetLimiter(src); target.Index = (AudioSource)inputId; target.SourceId = srcState.SourceId; 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); }, 1); }); }
public static void ApplyLimiter(IBMDSwitcherFairlightAudioLimiter limiter, FairlightAudioState.LimiterState state) { limiter.GetEnabled(out int enabled); state.LimiterEnabled = enabled != 0; limiter.GetThreshold(out double threshold); state.Threshold = threshold; limiter.GetAttack(out double attack); state.Attack = attack; limiter.GetRelease(out double release); state.Release = release; limiter.GetHold(out double hold); state.Hold = hold; }
public void TestLimiterEnabled() { var handler = CommandGenerator.CreateAutoCommandHandler <FairlightMixerMasterLimiterSetCommand, FairlightMixerMasterLimiterGetCommand>("LimiterEnabled"); AtemMockServerWrapper.Each(_output, _pool, handler, DeviceTestCases.FairlightMain, helper => { IBMDSwitcherFairlightAudioLimiter limiter = GetLimiter(helper); AtemState stateBefore = helper.Helper.BuildLibState(); for (int i = 0; i < 5; i++) { stateBefore.Fairlight.ProgramOut.Dynamics.Limiter.LimiterEnabled = i % 2 > 0; helper.SendAndWaitForChange(stateBefore, () => { limiter.SetEnabled(i % 2); }); } }); }
public void TestLimiterEnabled() { var handler = CommandGenerator .CreateAutoCommandHandler <FairlightMixerSourceLimiterSetCommand, FairlightMixerSourceLimiterGetCommand>("LimiterEnabled"); AtemMockServerWrapper.Each(_output, _pool, handler, DeviceTestCases.FairlightMain, helper => { TestFairlightInputSource.EachRandomSource(helper, (stateBefore, srcState, inputId, src, i) => { IBMDSwitcherFairlightAudioLimiter limiter = GetLimiter(src); srcState.Dynamics.Limiter.LimiterEnabled = i % 2 > 0; helper.SendAndWaitForChange(stateBefore, () => { limiter.SetEnabled(i % 2); }); }); }); }
public void TestAttack() { var handler = CommandGenerator.CreateAutoCommandHandler <FairlightMixerMasterLimiterSetCommand, FairlightMixerMasterLimiterGetCommand>("Attack"); AtemMockServerWrapper.Each(_output, _pool, handler, DeviceTestCases.FairlightMain, helper => { IBMDSwitcherFairlightAudioLimiter limiter = GetLimiter(helper); AtemState stateBefore = helper.Helper.BuildLibState(); for (int i = 0; i < 5; i++) { var target = Randomiser.Range(0.7, 30); stateBefore.Fairlight.ProgramOut.Dynamics.Limiter.Attack = target; helper.SendAndWaitForChange(stateBefore, () => { limiter.SetAttack(target); }); } }); }
public void TestAttack() { var handler = CommandGenerator .CreateAutoCommandHandler <FairlightMixerSourceLimiterSetCommand, FairlightMixerSourceLimiterGetCommand>("Attack"); AtemMockServerWrapper.Each(_output, _pool, handler, DeviceTestCases.FairlightMain, helper => { TestFairlightInputSource.EachRandomSource(helper, (stateBefore, srcState, inputId, src, i) => { IBMDSwitcherFairlightAudioLimiter limiter = GetLimiter(src); var target = Randomiser.Range(0.7, 30); srcState.Dynamics.Limiter.Attack = target; helper.SendAndWaitForChange(stateBefore, () => { limiter.SetAttack(target); }); }); }); }
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); }); }