private static AudioState.HeadphoneOutputState BuildHeadphone(IBMDSwitcherAudioHeadphoneOutput props) { var state = new AudioState.HeadphoneOutputState(); props.GetGain(out double gain); props.GetInputProgramOutGain(out double programGain); props.GetInputSidetoneGain(out double sidetoneGain); props.GetInputTalkbackGain(out double talkbackGain); state.Gain = gain; state.ProgramOutGain = programGain; state.SidetoneGain = sidetoneGain; state.TalkbackGain = talkbackGain; return(state); }
public void TestTalkbackGain() { var handler = CommandGenerator.CreateAutoCommandHandler <AudioMixerHeadphoneSetCommand, AudioMixerHeadphoneGetCommand>("TalkbackGain"); AtemMockServerWrapper.Each(_output, _pool, handler, DeviceTestCases.ClassicAudioHeadphones, helper => { IBMDSwitcherAudioHeadphoneOutput headphones = GetHeadphones(helper); AtemState stateBefore = helper.Helper.BuildLibState(); AudioState.HeadphoneOutputState hpState = stateBefore.Audio.HeadphoneOutputs.Single(); for (int i = 0; i < 5; i++) { double target = Randomiser.Range(); hpState.TalkbackGain = target; helper.SendAndWaitForChange(stateBefore, () => { headphones.SetInputTalkbackGain(target); }); } }); }