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 TestGateEnabled()
        {
            var handler = CommandGenerator.CreateAutoCommandHandler <FairlightMixerSourceExpanderSetCommand, FairlightMixerSourceExpanderGetCommand>("GateEnabled");

            AtemMockServerWrapper.Each(_output, _pool, handler, DeviceTestCases.FairlightMain, helper =>
            {
                TestFairlightInputSource.EachRandomSource(helper, (stateBefore, srcState, inputId, src, i) =>
                {
                    IBMDSwitcherFairlightAudioExpander expander = GetExpander(src);

                    srcState.Dynamics.Expander.GateEnabled = i % 2 > 0;
                    helper.SendAndWaitForChange(stateBefore, () => { expander.SetGateMode(i % 2); });
                });
            });
        }
        public void TestAttack()
        {
            var handler = CommandGenerator.CreateAutoCommandHandler <FairlightMixerSourceExpanderSetCommand, FairlightMixerSourceExpanderGetCommand>("Attack");

            AtemMockServerWrapper.Each(_output, _pool, handler, DeviceTestCases.FairlightMain, helper =>
            {
                TestFairlightInputSource.EachRandomSource(helper, (stateBefore, srcState, inputId, src, i) =>
                {
                    IBMDSwitcherFairlightAudioExpander expander = GetExpander(src);

                    var target = Randomiser.Range(0.7, 30);
                    srcState.Dynamics.Expander.Attack = target;
                    helper.SendAndWaitForChange(stateBefore, () => { expander.SetAttack(target); });
                });
            });
        }
Exemple #4
0
 public static void ApplyExpander(IBMDSwitcherFairlightAudioExpander expander,
                                  FairlightAudioState.ExpanderState state)
 {
     expander.GetEnabled(out int enabled);
     state.ExpanderEnabled = enabled != 0;
     expander.GetGateMode(out int gateMode);
     state.GateEnabled = gateMode != 0;
     expander.GetThreshold(out double threshold);
     state.Threshold = threshold;
     expander.GetRatio(out double ratio);
     state.Ratio = ratio;
     expander.GetRange(out double range);
     state.Range = range;
     expander.GetAttack(out double attack);
     state.Attack = attack;
     expander.GetRelease(out double release);
     state.Release = release;
     expander.GetHold(out double hold);
     state.Hold = hold;
 }