Ejemplo n.º 1
0
        private static IBMDSwitcherFairlightAudioEqualizer GetEqualizer(IBMDSwitcherFairlightAudioSource src)
        {
            var equalizer = AtemSDKConverter.CastSdk <IBMDSwitcherFairlightAudioEqualizer>(src.GetEffect);

            Assert.NotNull(equalizer);
            return(equalizer);
        }
Ejemplo n.º 2
0
        internal static void EachRandomSource(AtemMockServerWrapper helper, Action <AtemState, FairlightAudioState.InputSourceState, long, IBMDSwitcherFairlightAudioSource, int> fcn, int maxIterations = 5, bool useAll = false)
        {
            List <long> useIds = helper.Helper.BuildLibState().Fairlight.Inputs.Keys.ToList();

            if (!useAll)
            {
                useIds = Randomiser.SelectionOfGroup(useIds, 2).ToList();
            }

            foreach (long id in useIds)
            {
                helper.Helper.SyncStates();

                IBMDSwitcherFairlightAudioSource src = GetSource(helper, id);
                src.GetId(out long sourceId);

                AtemState stateBefore = helper.Helper.BuildLibState();
                FairlightAudioState.InputSourceState srcState = stateBefore.Fairlight.Inputs[id].Sources.Single(s => s.SourceId == sourceId);

                for (int i = 0; i < maxIterations; i++)
                {
                    fcn(stateBefore, srcState, id, src, i);
                }
            }
        }
Ejemplo n.º 3
0
        public static IBMDSwitcherFairlightAudioDynamicsProcessor GetDynamics(IBMDSwitcherFairlightAudioSource src)
        {
            var dynamics = AtemSDKConverter.CastSdk <IBMDSwitcherFairlightAudioDynamicsProcessor>(src.GetEffect);

            Assert.NotNull(dynamics);
            return(dynamics);
        }
Ejemplo n.º 4
0
        private static FairlightAudioState.InputSourceState BuildSource(IBMDSwitcherFairlightAudioSource props, AudioSource inputId, Dictionary <Tuple <AudioSource, long>, bool> tally)
        {
            var state = new FairlightAudioState.InputSourceState();

            props.IsActive(out int active);
            if (active == 0)
            {
                return(null);
            }

            props.GetId(out long id);
            state.SourceId = id;
            props.GetSupportedMixOptions(out _BMDSwitcherFairlightAudioMixOption supportedMixOptions);
            state.SupportedMixOptions = (FairlightAudioMixOption)supportedMixOptions;
            props.GetSourceType(out _BMDSwitcherFairlightAudioSourceType sourceType);
            state.SourceType = AtemEnumMaps.FairlightAudioSourceTypeMap.FindByValue(sourceType);

            props.GetMaxDelayFrames(out ushort maxDelay);
            state.MaxFramesDelay = maxDelay;
            props.GetDelayFrames(out ushort delay);
            state.FramesDelay = delay;

            props.GetInputGain(out double inputGain);
            state.Gain = inputGain;
            props.GetPan(out double pan);
            state.Balance = pan;
            props.GetFaderGain(out double faderGain);
            state.FaderGain = faderGain;
            props.GetMixOption(out _BMDSwitcherFairlightAudioMixOption mixOption);
            state.MixOption = AtemEnumMaps.FairlightAudioMixOptionMap.FindByValue(mixOption);
            props.HasStereoSimulation(out int hasStereoSimulation);
            state.HasStereoSimulation = hasStereoSimulation != 0;
            props.GetStereoSimulationIntensity(out double stereoSimulation);
            state.StereoSimulation = stereoSimulation;

            props.IsMixedIn(out int mixedIn);
            tally[Tuple.Create(inputId, id)] = mixedIn != 0;

            var dynamics = AtemSDKConverter.CastSdk <IBMDSwitcherFairlightAudioDynamicsProcessor>(props.GetEffect);

            dynamics.GetMakeupGain(out double makeupGain);
            state.Dynamics.MakeUpGain = makeupGain;

            var compressor = AtemSDKConverter.CastSdk <IBMDSwitcherFairlightAudioCompressor>(dynamics.GetProcessor);

            FairlightAudioBuilderCommon.ApplyCompressor(compressor, state.Dynamics.Compressor = new FairlightAudioState.CompressorState());
            var limiter = AtemSDKConverter.CastSdk <IBMDSwitcherFairlightAudioLimiter>(dynamics.GetProcessor);

            FairlightAudioBuilderCommon.ApplyLimiter(limiter, state.Dynamics.Limiter = new FairlightAudioState.LimiterState());
            var expander = AtemSDKConverter.CastSdk <IBMDSwitcherFairlightAudioExpander>(dynamics.GetProcessor);

            FairlightAudioBuilderCommon.ApplyExpander(expander, state.Dynamics.Expander = new FairlightAudioState.ExpanderState());

            var eq = AtemSDKConverter.CastSdk <IBMDSwitcherFairlightAudioEqualizer>(props.GetEffect);

            FairlightAudioBuilderCommon.ApplyEqualizer(eq, state.Equalizer);

            return(state);
        }
        private static IBMDSwitcherFairlightAudioExpander GetExpander(IBMDSwitcherFairlightAudioSource src)
        {
            IBMDSwitcherFairlightAudioDynamicsProcessor dynamics = TestFairlightInputSource.GetDynamics(src);
            var expander = AtemSDKConverter.CastSdk <IBMDSwitcherFairlightAudioExpander>(dynamics.GetProcessor);

            Assert.NotNull(expander);
            return(expander);
        }
Ejemplo n.º 6
0
        private static IBMDSwitcherFairlightAudioCompressor GetCompressor(IBMDSwitcherFairlightAudioSource src)
        {
            IBMDSwitcherFairlightAudioDynamicsProcessor dynamics = TestFairlightInputSource.GetDynamics(src);
            var compressor = AtemSDKConverter.CastSdk <IBMDSwitcherFairlightAudioCompressor>(dynamics.GetProcessor);

            Assert.NotNull(compressor);
            return(compressor);
        }
 public FairlightAudioMixerInputSource(FairlightAudioMixerInput input, IBMDSwitcherFairlightAudioSource source, IMediator mediator)
 {
     _input       = input;
     _source      = source;
     _mediator    = mediator;
     _callback    = new FairlightAudioMixerInputSourceCallback(this, _mediator);
     _hasCallback = true;
     source.AddCallback(_callback);
 }