Exemple #1
0
 public AuxOutput(Switcher parentSwitcher, IBMDSwitcherInputAux apiAuxOutput, int index)
 {
     ParentSwitcher = parentSwitcher;
     ApiAuxOutput   = apiAuxOutput;
     ApiAuxOutput.AddCallback(this);
     Index = index;
 }
        public void TestSource()
        {
            AtemMockServerWrapper.Each(_output, _pool, SourceCommandHandler, DeviceTestCases.All, helper =>
            {
                Dictionary <VideoSource, IBMDSwitcherInputAux> allAuxes = helper.GetSdkInputsOfType <IBMDSwitcherInputAux>();
                VideoSource[] chosenIds = VideoSourceUtil.TakeSelection(allAuxes.Keys.ToArray());

                foreach (VideoSource auxSource in chosenIds)
                {
                    uint auxId = AtemEnumMaps.GetAuxId(auxSource);
                    IBMDSwitcherInputAux aux = allAuxes[auxSource];

                    // GetInputAvailabilityMask is used when checking if another input can be used for this output.
                    // We track this another way
                    aux.GetInputAvailabilityMask(out _BMDSwitcherInputAvailability availabilityMask);
                    Assert.Equal(availabilityMask, (_BMDSwitcherInputAvailability)((int)SourceAvailability.Auxiliary << 2));

                    AtemState stateBefore = helper.Helper.BuildLibState();

                    VideoSource[] validSources = stateBefore.Settings.Inputs.Where(
                        i => i.Value.Properties.SourceAvailability.HasFlag(SourceAvailability.Auxiliary)
                        ).Select(i => i.Key).ToArray();
                    var sampleSources = VideoSourceUtil.TakeSelection(validSources);

                    foreach (VideoSource src in sampleSources)
                    {
                        stateBefore.Auxiliaries[(int)auxId].Source = src;
                        helper.SendAndWaitForChange(stateBefore, () =>
                        {
                            aux.SetInputSource((long)src);
                        });
                    }
                }
            });
        }
        private static AuxState AuxInput(IBMDSwitcherInputAux props)
        {
            var state = new AuxState();

            props.GetInputSource(out long source);
            state.Source = (VideoSource)source;

            return(state);
        }
Exemple #4
0
        private void ChangeAUX(int AuxNumber, long inputId)
        {
            //Console.WriteLine("AuxNumber=" + AuxNumber + " inputId=" + inputId);
            IBMDSwitcherInputIterator inputIterator = null;
            IntPtr inputIteratorPtr;
            Guid   inputIteratorIID = typeof(IBMDSwitcherInputIterator).GUID;

            this.m_switcher.CreateIterator(ref inputIteratorIID, out inputIteratorPtr);
            if (inputIteratorPtr != null)
            {
                inputIterator = (IBMDSwitcherInputIterator)Marshal.GetObjectForIUnknown(inputIteratorPtr);
            }

            if (inputIterator != null)
            {
                IBMDSwitcherInput input;
                inputIterator.Next(out input);
                int AUXCount = 0;
                while (input != null)
                {
                    BMDSwitcherAPI._BMDSwitcherPortType inputPortType;
                    input.GetPortType(out inputPortType);
                    if (inputPortType == BMDSwitcherAPI._BMDSwitcherPortType.bmdSwitcherPortTypeAuxOutput)
                    {
                        AUXCount++;
                        if (AUXCount == AuxNumber)
                        {
                            IBMDSwitcherInputAux WkAux = (IBMDSwitcherInputAux)input;
                            WkAux.SetInputSource(inputId);
                            break;
                        }
                    }
                    inputIterator.Next(out input);
                }
            }
        }
Exemple #5
0
        private void SwitcherConnected()
        {
            btn_reconnect.Enabled = false;
            reactivatebuttons();
            // Get the switcher name:
            string switcherName;
            m_switcher.GetString(_BMDSwitcherPropertyId.bmdSwitcherPropertyIdProductName, out switcherName);
            this.Text = switcherName;

            // Install SwitcherMonitor callbacks:
            m_switcher.AddCallback(m_switcherMonitor);

            // We create input monitors for each input. To do this we iterator over all inputs:
            // This will allow us to update the combo boxes when input names change:
            IBMDSwitcherInputIterator inputIterator;
            if (SwitcherAPIHelper.CreateIterator(m_switcher, out inputIterator))
            {
                IBMDSwitcherInput input;
                inputIterator.Next(out input);
                while (input != null)
                {
                    InputMonitor newInputMonitor = new InputMonitor(input);
                    input.AddCallback(newInputMonitor);

                    m_inputMonitors.Add(newInputMonitor);

                    inputIterator.Next(out input);
                }
            }

            // We want to get the first Mix Effect block (ME 1). We create a ME iterator,
            // and then get the first one:
            m_mixEffectBlock1 = null;
            IBMDSwitcherMixEffectBlockIterator meIterator;
            SwitcherAPIHelper.CreateIterator(m_switcher, out meIterator);

            if (meIterator != null)
            {
                meIterator.Next(out m_mixEffectBlock1);
            }

            if (m_mixEffectBlock1 == null)
            {
                MessageBox.Show("Unexpected: Could not get first mix effect block", "Error");
                return;
            }

            // Install MixEffectBlockMonitor callbacks:
            m_mixEffectBlock1.AddCallback(m_mixEffectBlockMonitor);

            m_transition = (BMDSwitcherAPI.IBMDSwitcherTransitionParameters)m_mixEffectBlock1;
            m_transition.AddCallback(m_transitionMonitor);

            IBMDSwitcherKeyIterator keyIterator;
            SwitcherAPIHelper.CreateIterator(m_mixEffectBlock1, out keyIterator);

            if (keyIterator != null)
            {
                keyIterator.Next(out me1_key1);
                keyIterator.Next(out me1_key2);
                keyIterator.Next(out me1_key3);
                keyIterator.Next(out me1_key4);   
            }

            me1_key1.AddCallback(m_keyMonitor);
            me1_key2.AddCallback(m_keyMonitor);
            me1_key3.AddCallback(m_keyMonitor);
            me1_key4.AddCallback(m_keyMonitor);


            if (SwitcherAPIHelper.CreateIterator(m_switcher, out inputIterator))
            {
                IBMDSwitcherInput input;
                inputIterator.Next(out input);
                while (input != null)
                {
                    InputMonitor newInputMonitor = new InputMonitor(input);
                    input.AddCallback(newInputMonitor);
                    m_inputMonitors.Add(newInputMonitor);
                    inputIterator.Next(out input);
                    IntPtr lvPointer;
                    IBMDSwitcherInputIterator lvInputIterator;
                    IBMDSwitcherInput lvInput;
                    string lvPortName;
                    long lvPortType;
                    int lvAUXCount;
                    lvAUXCount = 0;
                    m_switcher.CreateIterator(typeof(IBMDSwitcherInputIterator).GUID, out lvPointer);
                    lvInputIterator = (IBMDSwitcherInputIterator)Marshal.GetObjectForIUnknown(lvPointer);
                    lvInputIterator.Next(out lvInput);
                    while (lvInput != null)
                    {
                        lvInput.GetString(BMDSwitcherAPI._BMDSwitcherInputPropertyId.bmdSwitcherInputPropertyIdLongName, out lvPortName); // bmdSwitcherInputPropertyIdLongName

                        lvInput.GetInt(BMDSwitcherAPI._BMDSwitcherInputPropertyId.bmdSwitcherInputPropertyIdPortType, out lvPortType);

                        if ((_BMDSwitcherPortType)lvPortType == BMDSwitcherAPI._BMDSwitcherPortType.bmdSwitcherPortTypeColorGenerator)
                        {

                        }

                        if ((_BMDSwitcherPortType)lvPortType == BMDSwitcherAPI._BMDSwitcherPortType.bmdSwitcherPortTypeAuxOutput)
                        {
                            lvAUXCount = lvAUXCount + 1;

                            m_inputAux = (IBMDSwitcherInputAux)lvInput;

                            if (lvAUXCount == 1)
                            {
                                m_AUX1 = m_inputAux;
                            }
                            if (lvAUXCount == 2)
                            {
                                m_AUX2 = m_inputAux;
                            }
                            if (lvAUXCount == 3)
                            {
                                m_AUX3 = m_inputAux;
                            }
                        }
                        lvInputIterator.Next(out lvInput);
                    }
                }
            }
            m_AUX1.AddCallback(m_auxMonitor);
            m_AUX2.AddCallback(m_auxMonitor);
            m_AUX3.AddCallback(m_auxMonitor);
            
            IBMDSwitcherDownstreamKeyIterator dkeyiterator;
            dkeyiterator = null;
            SwitcherAPIHelper.CreateIterator(m_switcher, out dkeyiterator);
            if (dkeyiterator != null)
            {
                dkeyiterator.Next(out me1_dkey1);
                dkeyiterator.Next(out me1_dkey2);
            }

            me1_dkey1.AddCallback(m_dkeyMonitor);
            me1_dkey2.AddCallback(m_dkeyMonitor);

            m_audiomixer = (BMDSwitcherAPI.IBMDSwitcherAudioMixer)m_switcher;
            m_audiomixer.AddCallback(m_audioMixerMonitor);

            IBMDSwitcherAudioInputIterator m_audioInputiterator;
            SwitcherAPIHelper.CreateIterator(m_audiomixer, out m_audioInputiterator);

            if (m_audioInputiterator != null)
            {
                m_audioInputiterator.Next(out m_audioInput);
            }

            m_audioInput.AddCallback(m_audioInputMonitor);

            IBMDSwitcherAudioMonitorOutputIterator m_audioOutputIterator;
            SwitcherAPIHelper.CreateIterator(m_audiomixer, out m_audioOutputIterator);

            if (m_audioOutputIterator != null)
            {
                m_audioOutputIterator.Next(out m_audioMonitorOutput);
            }

            m_audioMonitorOutput.AddCallback(m_audioOutputMonitor);
            btnKey1Air.Enabled = true;
            ProgramInputChanged();
            KeyerOnAirChanged();
            InputAuxChanged();
        }
 internal SwitcherInputAuxCallback(IBMDSwitcherInputAux input, int index)
 {
     this._indexnr = index;
     this.InputAux = input;
 }
Exemple #7
0
        private void SwitcherDisconnected()
        {
            buttonConnect.Enabled = true;
            textBoxSwitcherName.Text = "";

            if (m_audioInput != null)
            {
                m_audioInput.RemoveCallback(m_audioInputMonitor);
                m_audioInput = null;
            }

            if (m_audioMonitorOutput != null)
            {
                m_audioMonitorOutput.RemoveCallback(m_audioOutputMonitor);
                m_audioMonitorOutput = null;
            }

            if (m_audiomixer != null)
            {
                 m_audiomixer.RemoveCallback(m_audioMixerMonitor);
                 m_audiomixer = null;
            }

            if (me1_dkey1 != null)
            {
                // Remove callback
                me1_dkey1.RemoveCallback(m_dkeyMonitor);

                // Release reference
                me1_dkey1 = null;
            }

            if (me1_dkey2 != null)
            {
                // Remove callback
                me1_dkey2.RemoveCallback(m_dkeyMonitor);

                // Release reference
                me1_dkey2 = null;
            }

            if (m_AUX1 != null)
            {
                // Remove callback
                m_AUX1.RemoveCallback(m_auxMonitor);

                // Release reference
                m_AUX1 = null;
            }

            if (m_AUX2 != null)
            {
                // Remove callback
                m_AUX2.RemoveCallback(m_auxMonitor);

                // Release reference
                m_AUX2 = null;
            }

            if (m_AUX3 != null)
            {
                // Remove callback
                m_AUX3.RemoveCallback(m_auxMonitor);

                // Release reference
                m_AUX3 = null;
            }

            if (m_inputAux != null)
            {
                // Remove callback
                m_inputAux.RemoveCallback(m_auxMonitor);

                // Release reference
                m_inputAux = null;
            }

            if (me1_key1 != null)
            {
                // Remove callback
                me1_key1.RemoveCallback(m_keyMonitor);

                // Release reference
                me1_key1 = null;
            }
            if (me1_key2 != null)
            {
                // Remove callback
                me1_key2.RemoveCallback(m_keyMonitor);

                // Release reference
                me1_key2 = null;
            }
            if (me1_key3 != null)
            {
                // Remove callback
                me1_key3.RemoveCallback(m_keyMonitor);

                // Release reference
                me1_key3 = null;
            }
            if (me1_key4 != null)
            {
                // Remove callback
                me1_key4.RemoveCallback(m_keyMonitor);

                // Release reference
                me1_key4 = null;
            }

            if (m_transition != null)
            {
                // Remove callback
                m_transition.RemoveCallback(m_transitionMonitor);

                // Release reference
                m_transition = null;
            }
            
            // Remove all input monitors, remove callbacks
            foreach (InputMonitor inputMon in m_inputMonitors)
            {
                inputMon.Input.RemoveCallback(inputMon);
            }
            m_inputMonitors.Clear();

            if (m_mixEffectBlock1 != null)
            {
                // Remove callback
                m_mixEffectBlock1.RemoveCallback(m_mixEffectBlockMonitor);

                // Release reference
                m_mixEffectBlock1 = null;
            }

            if (m_switcher != null)
            {
                // Remove callback:
                m_switcher.RemoveCallback(m_switcherMonitor);

                // release reference:
                m_switcher = null;
            }
        }
Exemple #8
0
        private void UpdateAuxSourceCombos()
        {
            long lvSource = 0;
            IBMDSwitcherInputIterator inputIterator = null;
            IntPtr inputIteratorPtr;
            Guid   inputIteratorIID = typeof(IBMDSwitcherInputIterator).GUID;

            this.m_switcher.CreateIterator(ref inputIteratorIID, out inputIteratorPtr);
            if (inputIteratorPtr != null)
            {
                inputIterator = (IBMDSwitcherInputIterator)Marshal.GetObjectForIUnknown(inputIteratorPtr);
            }

            if (inputIterator != null)
            {
                IBMDSwitcherInput input;
                inputIterator.Next(out input);
                int AUXCount = 0;

                while (input != null)
                {
                    BMDSwitcherAPI._BMDSwitcherPortType inputPortType;
                    input.GetPortType(out inputPortType);
                    if (inputPortType == BMDSwitcherAPI._BMDSwitcherPortType.bmdSwitcherPortTypeAuxOutput)

                    {
                        IBMDSwitcherInputAux WkAux = (IBMDSwitcherInputAux)input;
                        WkAux.GetInputSource(out lvSource);
                        AUXCount++;
                        if (AUXCount == 1)
                        {
                            switch (lvSource)
                            {
                            case 6:
                                aux1But1.IsChecked = true;
                                break;

                            case 10010:
                                aux1But2.IsChecked = true;
                                break;

                            case 3010:
                                aux1But3.IsChecked = true;
                                break;

                            case 2:
                                aux1But4.IsChecked = true;
                                break;

                            case 3:
                                aux1But5.IsChecked = true;
                                break;

                            case 4:
                                aux1But7.IsChecked = true;
                                break;

                            case 5:
                                aux1But8.IsChecked = true;
                                break;
                            }
                            //ComboBox WkCombo = (ComboBox)this.Controls.Find("comboBoxAUX" + AUXCount, true)[0];
                            //foreach (StringObjectPair<long> item in WkCombo.Items)
                            //{
                            //    if (item.value == lvSource)
                            //    {
                            //WkCombo.SelectedIndex = WkCombo.Items.IndexOf(item);
                            //        break;
                            //    }
                            //}
                        }
                        if (AUXCount == 3)
                        {
                            //UpdateAudio options --  6=input 6 (Slid/mixer out), 1=input 1 (Ann/broadcast computer). 1201=input RCA (slides computer)
                            switch (lvSource)
                            {
                            case 1:
                                Console.WriteLine("2");
                                //aux2But2.IsChecked = true;
                                //UpdateAudio(1, 6);
                                aux2But8.IsChecked = true;
                                break;

                            case 10010:
                                aux2But1.IsChecked = true;
                                //UpdateAudio(6, 1);
                                //aux2But9.IsChecked = true;
                                break;

                            case 3010:
                                //aux2But2.IsChecked = true;

                                break;

                            case 2:
                                aux2But3.IsChecked = true;

                                break;

                            case 3:
                                aux2But4.IsChecked = true;
                                break;

                            case 4:
                                aux2But6.IsChecked = true;
                                break;

                            case 5:
                                aux2But7.IsChecked = true;
                                break;

                            case 6:
                                aux2But5.IsChecked = true;
                                break;
                            }
                        }
                    }
                    inputIterator.Next(out input);
                }
            }
        }
        public void Connect()
        {
            this.BMDSwitcherInfo = new SwitcherInfo(this);

            #region Switcher
            this.BMDSwitcher = new SwitcherCallback(this.m_switcher);
            this.m_switcher.AddCallback(this.BMDSwitcher);
            #endregion

            #region SwitcherMediaPool
            this.m_switcherMediaPool  = (IBMDSwitcherMediaPool)this.m_switcher;
            this.BMDSwitcherMediaPool = new SwitcherMediaPoolCallback(this.m_switcherMediaPool);
            this.m_switcherMediaPool.AddCallback(this.BMDSwitcherMediaPool);
            #endregion

            #region SwitcherStills
            this.m_switcherMediaPool.GetStills(out this.m_switcherStills);
            this.BMDSwitcherStills = new SwitcherStillsCallback(this.m_switcherStills);
            this.m_switcherStills.GetCount(out uint totalStills);
            for (this.BMDSwitcherInfo.TotalSwitcherStills = 0; this.BMDSwitcherInfo.TotalSwitcherStills < totalStills; this.BMDSwitcherInfo.TotalSwitcherStills++)
            {
                this.BMDSwitcherStill.Add(new SwitcherStill(this.m_switcherStills, (int)this.BMDSwitcherInfo.TotalSwitcherStills));
            }
            #endregion

            #region SwitcherClips
            this.m_switcherMediaPool.GetClipCount(out uint totalClips);
            for (this.BMDSwitcherInfo.TotalSwitcherClip = 0; this.BMDSwitcherInfo.TotalSwitcherClip < totalClips; this.BMDSwitcherInfo.TotalSwitcherClip++)
            {
                this.m_switcherMediaPool.GetClip(this.BMDSwitcherInfo.TotalSwitcherClip, out this.m_switcherClip);
                this.BMDSwitcherClip.Add(new SwitcherClipCallback(this.m_switcherClip, (int)this.BMDSwitcherInfo.TotalSwitcherClip));
            }
            #endregion

            #region SwitcherMacroPool
            this.m_switcherMacroPool  = (IBMDSwitcherMacroPool)this.m_switcher;
            this.BMDSwitcherMacroPool = new SwitcherMacroPoolCallback(this.m_switcherMacroPool);
            this.m_switcherMacroPool.AddCallback(this.BMDSwitcherMacroPool);
            this.m_switcherMacroPool.GetMaxCount(out uint totalMacros);
            for (this.BMDSwitcherInfo.TotalSwitcherMacros = 0; this.BMDSwitcherInfo.TotalSwitcherMacros < totalMacros; this.BMDSwitcherInfo.TotalSwitcherMacros++)
            {
                this.BMDSwitcherMacro.Add(new SwitcherMacro(this.m_switcherMacroPool, (int)this.BMDSwitcherInfo.TotalSwitcherMacros));
            }
            #endregion

            #region SwitcherAudioMixer
            this.m_switcherAudioMixer  = (IBMDSwitcherAudioMixer)this.m_switcher;
            this.BMDSwitcherAudioMixer = new SwitcherAudioMixerCallback(this.m_switcherAudioMixer);
            this.m_switcherAudioMixer.AddCallback(this.BMDSwitcherAudioMixer);
            #endregion

            #region SwitcherMixMinusOutput
            try
            {
                this.m_switcherMixMinusOutput  = (IBMDSwitcherMixMinusOutput)this.m_switcher;
                this.BMDSwitcherMixMinusOutput = new SwitcherMixMinusOutputCallback(this.m_switcherMixMinusOutput);
                this.m_switcherMixMinusOutput.AddCallback(this.BMDSwitcherMixMinusOutput);
            }
            catch
            {
                // Not Supported bij switcher
            }
            #endregion

            #region SwitcherInput
            IBMDSwitcherInputIterator SwitcherInputIterator = null;
            Guid SwitcherInputIteratorIID = typeof(IBMDSwitcherInputIterator).GUID;
            this.m_switcher.CreateIterator(ref SwitcherInputIteratorIID, out IntPtr SwitcherInputIteratorintPtr);
            SwitcherInputIterator = (IBMDSwitcherInputIterator)Marshal.GetObjectForIUnknown(SwitcherInputIteratorintPtr);

            if (SwitcherInputIterator != null)
            {
                SwitcherInputIterator.Next(out this.m_switcherInput);
                while (this.m_switcherInput != null)
                {
                    SwitcherInputCallback switcherInputCallback = new SwitcherInputCallback(this.m_switcherInput, this.BMDSwitcherInfo.TotalSwitcherInput);
                    this.m_switcherInput.AddCallback(switcherInputCallback);
                    this.BMDSwitcherInput.Add(switcherInputCallback);

                    switch (switcherInputCallback.PortType)
                    {
                        #region bmdSwitcherPortTypeBlack
                    case _BMDSwitcherPortType.bmdSwitcherPortTypeBlack:
                        this.BMDSwitcherInfo.TotalSwitcherPortTypeBlack++;
                        break;
                        #endregion

                        #region SwitcherPortTypeColorBars
                    case _BMDSwitcherPortType.bmdSwitcherPortTypeColorBars:
                        this.BMDSwitcherInfo.TotalSwitcherPortTypeColorBars++;
                        break;
                        #endregion

                        #region SwitcherPortTypeExternal
                    case _BMDSwitcherPortType.bmdSwitcherPortTypeExternal:
                        this.BMDSwitcherInfo.TotalSwitcherPortTypeExternal++;
                        break;
                        #endregion

                        #region SwitcherPortTypeKeyCutOutput
                    case _BMDSwitcherPortType.bmdSwitcherPortTypeKeyCutOutput:
                        this.BMDSwitcherInfo.TotalSwitcherPortTypeKeyCutOutput++;
                        break;
                        #endregion

                        #region SwitcherPortTypeMediaPlayerCut
                    case _BMDSwitcherPortType.bmdSwitcherPortTypeMediaPlayerCut:
                        this.BMDSwitcherInfo.TotalSwitcherPortTypeMediaPlayerCut++;
                        break;
                        #endregion

                        #region SwitcherPortTypeMediaPlayerFill
                    case _BMDSwitcherPortType.bmdSwitcherPortTypeMediaPlayerFill:
                        this.BMDSwitcherInfo.TotalSwitcherPortTypeMediaPlayerFill++;
                        break;
                        #endregion

                        #region SwitcherPortTypeMixEffectBlockOutput
                    case _BMDSwitcherPortType.bmdSwitcherPortTypeMixEffectBlockOutput:
                        this.BMDSwitcherInfo.TotalSwitcherPortTypeMixEffectBlockOutput++;
                        break;
                        #endregion

                        #region SwitcherPortTypeAuxOutput
                    case _BMDSwitcherPortType.bmdSwitcherPortTypeAuxOutput:
                        this.m_switcherInputAux = (IBMDSwitcherInputAux)this.m_switcherInput;
                        SwitcherInputAuxCallback switcherInputAuxCallback = new SwitcherInputAuxCallback(this.m_switcherInputAux, this.BMDSwitcherInfo.TotalSwitcherPortTypeAuxOutput);
                        this.BMDSwitcherInputAux.Add(switcherInputAuxCallback);
                        this.BMDSwitcherInfo.TotalSwitcherPortTypeAuxOutput++;
                        break;
                        #endregion

                        #region SwitcherPortTypeColorGenerator
                    case _BMDSwitcherPortType.bmdSwitcherPortTypeColorGenerator:
                        this.m_switcherInputColor = (IBMDSwitcherInputColor)this.m_switcherInput;
                        SwitcherInputColorCallback switcherInputColorCallback = new SwitcherInputColorCallback(this.m_switcherInputColor, this.BMDSwitcherInfo.TotalSwitcherPortTypeColorGenerator);
                        this.BMDSwitcherInputColor.Add(switcherInputColorCallback);
                        this.BMDSwitcherInfo.TotalSwitcherPortTypeColorGenerator++;
                        break;
                        #endregion

                        #region SwitcherPortTypeSuperSource
                    case _BMDSwitcherPortType.bmdSwitcherPortTypeSuperSource:
                        this.m_switcherInputSuperSource_v7_5_2 = (IBMDSwitcherInputSuperSource_v7_5_2)this.m_switcherInput;
                        SwitcherInputSuperSourceCallback_v7_5_2 switcherInputSuperSourceCallback_v7_5_2 = new SwitcherInputSuperSourceCallback_v7_5_2(this.m_switcherInputSuperSource_v7_5_2, this.BMDSwitcherInfo.TotalSwitcherPortTypeSuperSource_v7_5_2);
                        this.BMDSwitcherInputSuperSource_v7_5_2.Add(switcherInputSuperSourceCallback_v7_5_2);
                        this.BMDSwitcherInfo.TotalSwitcherPortTypeSuperSource_v7_5_2++;
                        break;
                        #endregion
                    }
                    SwitcherInputIterator.Next(out this.m_switcherInput);
                    this.BMDSwitcherInfo.TotalSwitcherInput++;
                }
            }
            #endregion

            #region SwitcherMixEffectBlock
            IBMDSwitcherMixEffectBlockIterator_v7_5 SwitcherMixEffectBlockIterator_v7_5 = null;
            Guid SwitcherMixEffectBlockIteratorIID_v7_5 = typeof(IBMDSwitcherMixEffectBlockIterator_v7_5).GUID;

            IBMDSwitcherKeyIterator SwitcherKeyIterator = null;
            Guid SwitcherKeyIteratorIID = typeof(IBMDSwitcherKeyIterator).GUID;

            this.m_switcher.CreateIterator(ref SwitcherMixEffectBlockIteratorIID_v7_5, out IntPtr SwitcherMixEffectBlockIteratorintPtr);
            SwitcherMixEffectBlockIterator_v7_5 = (IBMDSwitcherMixEffectBlockIterator_v7_5)Marshal.GetObjectForIUnknown(SwitcherMixEffectBlockIteratorintPtr);

            if (SwitcherMixEffectBlockIterator_v7_5 != null)
            {
                SwitcherMixEffectBlockIterator_v7_5.Next(out this.m_switcherMixEffectBlock_v7_5);

                while (this.m_switcherMixEffectBlock_v7_5 != null)
                {
                    #region SwitcherTransitionParameters
                    this.m_switcherTransitionParameters  = (IBMDSwitcherTransitionParameters)this.m_switcherMixEffectBlock_v7_5;
                    this.BMDSwitcherTransitionParameters = new SwitcherTransitionParametersCallback(this.m_switcherTransitionParameters);
                    this.m_switcherTransitionParameters.AddCallback(this.BMDSwitcherTransitionParameters);
                    #endregion

                    #region SwitcherTransitionDipParameters
                    this.m_switcherTransitionDipParameters  = (IBMDSwitcherTransitionDipParameters)this.m_switcherMixEffectBlock_v7_5;
                    this.BMDSwitcherTransitionDipParameters = new SwitcherTransitionDipParametersCallback(this.m_switcherTransitionDipParameters);
                    this.m_switcherTransitionDipParameters.AddCallback(this.BMDSwitcherTransitionDipParameters);
                    #endregion

                    #region SwitcherTransitionDVEParameters
                    try
                    {
                        this.m_switcherTransitionDVEParameters  = (IBMDSwitcherTransitionDVEParameters)this.m_switcherMixEffectBlock_v7_5;
                        this.BMDSwitcherTransitionDVEParameters = new SwitcherTransitionDVEParametersCallback(this.m_switcherTransitionDVEParameters);
                        this.m_switcherTransitionDVEParameters.AddCallback(this.BMDSwitcherTransitionDVEParameters);
                    }
                    catch { }
                    #endregion

                    #region SwitcherTransitionMixParameters
                    this.m_switcherTransitionMixParameters  = (IBMDSwitcherTransitionMixParameters)this.m_switcherMixEffectBlock_v7_5;
                    this.BMDSwitcherTransitionMixParameters = new SwitcherTransitionMixParametersCallback(this.m_switcherTransitionMixParameters);
                    this.m_switcherTransitionMixParameters.AddCallback(this.BMDSwitcherTransitionMixParameters);
                    #endregion

                    #region SwitcherTransitionStingerParameters
                    try
                    {
                        this.m_switcherTransitionStingerParameters  = (IBMDSwitcherTransitionStingerParameters)this.m_switcherMixEffectBlock_v7_5;
                        this.BMDSwitcherTransitionStingerParameters = new SwitcherTransitionStingerParametersCallback(this.m_switcherTransitionStingerParameters);
                        this.m_switcherTransitionStingerParameters.AddCallback(this.BMDSwitcherTransitionStingerParameters);
                    }
                    catch { }
                    #endregion

                    #region SwitcherTransitionWipeParameters
                    this.m_switcherTransitionWipeParameters  = (IBMDSwitcherTransitionWipeParameters)this.m_switcherMixEffectBlock_v7_5;
                    this.BMDSwitcherTransitionWipeParameters = new SwitcherTransitionWipeParametersCallback(this.m_switcherTransitionWipeParameters);
                    this.m_switcherTransitionWipeParameters.AddCallback(this.BMDSwitcherTransitionWipeParameters);
                    #endregion

                    SwitcherMixEffectBlockCallback_v7_5 switcherMixEffectBlockCallback_v7_5 = new SwitcherMixEffectBlockCallback_v7_5(this.m_switcherMixEffectBlock_v7_5, this.BMDSwitcherInfo.TotalSwitcherMixEffectBlock_v7_5);
                    this.m_switcherMixEffectBlock_v7_5.AddCallback(switcherMixEffectBlockCallback_v7_5);
                    this.BMDSwitcherMixEffectBlock_7_5.Add(switcherMixEffectBlockCallback_v7_5);

                    this.m_switcherMixEffectBlock_v7_5.CreateIterator(ref SwitcherKeyIteratorIID, out IntPtr SwitcherKeyIteratorintPtr);
                    SwitcherKeyIterator = (IBMDSwitcherKeyIterator)Marshal.GetObjectForIUnknown(SwitcherKeyIteratorintPtr);
                    if (SwitcherKeyIterator != null)
                    {
                        SwitcherKeyIterator.Next(out this.m_switcherKey);

                        while (this.m_switcherKey != null)
                        {
                            #region SwitcherKey
                            SwitcherKeyCallback switcherKeyCallback = new SwitcherKeyCallback(this.m_switcherKey, this.BMDSwitcherInfo.TotalSwitcherKey);
                            this.m_switcherKey.AddCallback(switcherKeyCallback);
                            this.BMDSwitcherKey.Add(switcherKeyCallback);
                            #endregion

                            #region SwitcherKeyChromaParameters
                            this.m_switcherKeyChromaParameters = (IBMDSwitcherKeyChromaParameters)this.m_switcherKey;
                            SwitcherKeyChromaParametersCallback switcherKeyChromaParametersCallback = new SwitcherKeyChromaParametersCallback(this.m_switcherKeyChromaParameters, this.BMDSwitcherInfo.TotalSwitcherKey);
                            this.m_switcherKeyChromaParameters.AddCallback(switcherKeyChromaParametersCallback);
                            this.BMDSwitcherKeyChromaParameters.Add(switcherKeyChromaParametersCallback);
                            #endregion

                            #region SwitcherKeyLumaParameters
                            this.m_switcherKeyLumaParameters = (IBMDSwitcherKeyLumaParameters)this.m_switcherKey;
                            SwitcherKeyLumaParametersCallback switcherKeyLumaParametersCallback = new SwitcherKeyLumaParametersCallback(this.m_switcherKeyLumaParameters, this.BMDSwitcherInfo.TotalSwitcherKey);
                            this.m_switcherKeyLumaParameters.AddCallback(switcherKeyLumaParametersCallback);
                            this.BMDSwitcherKeyLumaParameters.Add(switcherKeyLumaParametersCallback);
                            #endregion

                            #region SwitcherKeyPatternParameters
                            this.m_switcherKeyPatternParameters = (IBMDSwitcherKeyPatternParameters)this.m_switcherKey;
                            SwitcherKeyPatternParametersCallback switcherKeyPatternParametersCallback = new SwitcherKeyPatternParametersCallback(this.m_switcherKeyPatternParameters, this.BMDSwitcherInfo.TotalSwitcherKey);
                            this.m_switcherKeyPatternParameters.AddCallback(switcherKeyPatternParametersCallback);
                            this.BMDSwitcherKeyPatternParameters.Add(switcherKeyPatternParametersCallback);
                            #endregion

                            #region SwitcherKeyDVEParameters
                            try
                            {
                                this.m_switcherKeyDVEParameters = (IBMDSwitcherKeyDVEParameters)this.m_switcherKey;
                                SwitcherKeyDVEParametersCallback switcherKeyDVEParametersCallback = new SwitcherKeyDVEParametersCallback(this.m_switcherKeyDVEParameters, this.BMDSwitcherInfo.TotalSwitcherKey);
                                this.m_switcherKeyDVEParameters.AddCallback(switcherKeyDVEParametersCallback);
                                this.BMDSwitcherKeyDVEParameters.Add(switcherKeyDVEParametersCallback);
                            }
                            catch { }
                            #endregion

                            #region SwitcherKeyFlyParameters
                            this.m_switcherKeyFlyParameters = (IBMDSwitcherKeyFlyParameters)this.m_switcherKey;
                            SwitcherKeyFlyParametersCallback switcherKeyFlyParametersCallback = new SwitcherKeyFlyParametersCallback(this.m_switcherKeyFlyParameters, this.BMDSwitcherInfo.TotalSwitcherKey);
                            this.m_switcherKeyFlyParameters.AddCallback(switcherKeyFlyParametersCallback);
                            this.BMDSwitcherKeyFlyParameters.Add(switcherKeyFlyParametersCallback);
                            #endregion

                            #region SwitcherKeyFlyKeyFrameParameters (Not sure if i handle it the right way.
                            this.m_switcherKeyFlyKeyFrameParameters = (IBMDSwitcherKeyFlyKeyFrameParameters)switcherKeyFlyParametersCallback.KeyFrameParameters(_BMDSwitcherFlyKeyFrame.bmdSwitcherFlyKeyFrameA);
                            SwitcherKeyFlyKeyFrameParametersCallback switcherKeyFlyKeyFrameParametersCallback = new SwitcherKeyFlyKeyFrameParametersCallback(this.m_switcherKeyFlyKeyFrameParameters, this.BMDSwitcherInfo.TotalSwitcherKey);
                            this.m_switcherKeyFlyKeyFrameParameters.AddCallback(switcherKeyFlyKeyFrameParametersCallback);
                            this.BMDSwitcherKeyFlyKeyFrameParameters.Add(switcherKeyFlyKeyFrameParametersCallback);
                            #endregion

                            SwitcherKeyIterator.Next(out this.m_switcherKey);
                            this.BMDSwitcherInfo.TotalSwitcherKey++;
                        }
                    }
                    SwitcherMixEffectBlockIterator_v7_5.Next(out this.m_switcherMixEffectBlock_v7_5);
                    this.BMDSwitcherInfo.TotalSwitcherMixEffectBlock_v7_5++;
                }
            }
            #endregion

            #region SwitcherDownstreamKey
            IBMDSwitcherDownstreamKeyIterator SwitcherDownstreamKeyIterator = null;
            Guid SwitcherDownstreamKeyIteratorIID = typeof(IBMDSwitcherDownstreamKeyIterator).GUID;
            this.m_switcher.CreateIterator(ref SwitcherDownstreamKeyIteratorIID, out IntPtr SwitcherDownstreamKeyIteratorintPtr);
            SwitcherDownstreamKeyIterator = (IBMDSwitcherDownstreamKeyIterator)Marshal.GetObjectForIUnknown(SwitcherDownstreamKeyIteratorintPtr);

            if (SwitcherDownstreamKeyIterator != null)
            {
                SwitcherDownstreamKeyIterator.Next(out this.m_switcherDownstreamKey);
                while (this.m_switcherDownstreamKey != null)
                {
                    SwitcherDownstreamKeyCallback switcherDownstreamKeyCallback = new SwitcherDownstreamKeyCallback(this.m_switcherDownstreamKey, this.BMDSwitcherInfo.TotalSwitcherDownstreamKey);
                    this.m_switcherDownstreamKey.AddCallback(switcherDownstreamKeyCallback);
                    this.BMDSwitcherDownstreamKey.Add(switcherDownstreamKeyCallback);
                    SwitcherDownstreamKeyIterator.Next(out this.m_switcherDownstreamKey);
                    this.BMDSwitcherInfo.TotalSwitcherDownstreamKey++;
                }
            }
            #endregion

            #region SwitcherAudioInput
            IBMDSwitcherAudioInputIterator SwitcherAudioInputIterator = null;
            Guid SwitcherAudioInputIteratorIID = typeof(IBMDSwitcherAudioInputIterator).GUID;
            this.m_switcherAudioMixer.CreateIterator(ref SwitcherAudioInputIteratorIID, out IntPtr SwitcherAudioInputIteratorintPtr);
            SwitcherAudioInputIterator = (IBMDSwitcherAudioInputIterator)Marshal.GetObjectForIUnknown(SwitcherAudioInputIteratorintPtr);

            if (SwitcherAudioInputIterator != null)
            {
                SwitcherAudioInputIterator.Next(out this.m_switcherAudioInput);
                while (this.m_switcherAudioInput != null)
                {
                    SwitcherAudioInputCallback switcherAudioInputCallback = new SwitcherAudioInputCallback(this.m_switcherAudioInput, this.BMDSwitcherInfo.TotalSwitcherAudioInput);
                    this.m_switcherAudioInput.AddCallback(switcherAudioInputCallback);
                    this.BMDSwitcherAudioInput.Add(switcherAudioInputCallback);
                    SwitcherAudioInputIterator.Next(out this.m_switcherAudioInput);
                    this.BMDSwitcherInfo.TotalSwitcherAudioInput++;
                }
            }
            #endregion

            #region SwitcherAudioMonitorOutput
            IBMDSwitcherAudioMonitorOutputIterator SwitcherAudioMonitorOutputIterator = null;
            Guid SwitcherAudioMonitorOutputIteratorIID = typeof(IBMDSwitcherAudioMonitorOutputIterator).GUID;
            this.m_switcherAudioMixer.CreateIterator(ref SwitcherAudioMonitorOutputIteratorIID, out IntPtr SwitcherAudioMonitorOutputIteratorintPtr);
            SwitcherAudioMonitorOutputIterator = (IBMDSwitcherAudioMonitorOutputIterator)Marshal.GetObjectForIUnknown(SwitcherAudioMonitorOutputIteratorintPtr);

            if (SwitcherAudioMonitorOutputIterator != null)
            {
                SwitcherAudioMonitorOutputIterator.Next(out this.m_switcherAudioMonitorOutput);
                while (this.m_switcherAudioMonitorOutput != null)
                {
                    SwitcherAudioMonitorOutputCallback switcherAudioMonitorOutputCallback = new SwitcherAudioMonitorOutputCallback(this.m_switcherAudioMonitorOutput, this.BMDSwitcherInfo.TotalSwitcherAudioMonitorOutput);
                    this.m_switcherAudioMonitorOutput.AddCallback(switcherAudioMonitorOutputCallback);
                    this.BMDSwitcherAudioMonitorOutput.Add(switcherAudioMonitorOutputCallback);
                    SwitcherAudioMonitorOutputIterator.Next(out this.m_switcherAudioMonitorOutput);
                    this.BMDSwitcherInfo.TotalSwitcherAudioMonitorOutput++;
                }
            }
            #endregion

            #region SwitcherMediaPlayer
            IBMDSwitcherMediaPlayerIterator SwitcherMediaPlayerIterator = null;
            Guid SwitcherMediaPlayerIteratorIID = typeof(IBMDSwitcherMediaPlayerIterator).GUID;
            this.m_switcher.CreateIterator(ref SwitcherMediaPlayerIteratorIID, out IntPtr SwitcherMediaPlayerIteratorintPtr);
            SwitcherMediaPlayerIterator = (IBMDSwitcherMediaPlayerIterator)Marshal.GetObjectForIUnknown(SwitcherMediaPlayerIteratorintPtr);

            if (SwitcherMediaPlayerIterator != null)
            {
                SwitcherMediaPlayerIterator.Next(out m_switcherMediaPlayer);
                while (this.m_switcherMediaPlayer != null)
                {
                    SwitcherMediaPlayerCallback switcherMediaPlayerCallback = new SwitcherMediaPlayerCallback(this.m_switcherMediaPlayer, this.BMDSwitcherInfo.TotalSwitcherMediaPlayer);
                    this.m_switcherMediaPlayer.AddCallback(switcherMediaPlayerCallback);
                    this.BMDSwitcherMediaPlayer.Add(switcherMediaPlayerCallback);
                    SwitcherMediaPlayerIterator.Next(out m_switcherMediaPlayer);
                    this.BMDSwitcherInfo.TotalSwitcherMediaPlayer++;
                }
            }
            #endregion

            #region SwitcherMultiView
            IBMDSwitcherMultiViewIterator_v7_5_2 SwitcherMultiViewIterator_v7_5_2 = null;
            Guid SwitcherMultiViewIteratorIID_v7_5_2 = typeof(IBMDSwitcherMultiViewIterator_v7_5_2).GUID;
            this.m_switcher.CreateIterator(ref SwitcherMultiViewIteratorIID_v7_5_2, out IntPtr SwitcherMultiViewIteratorintPtr_v7_5_2);
            SwitcherMultiViewIterator_v7_5_2 = (IBMDSwitcherMultiViewIterator_v7_5_2)Marshal.GetObjectForIUnknown(SwitcherMultiViewIteratorintPtr_v7_5_2);

            if (SwitcherMultiViewIterator_v7_5_2 != null)
            {
                SwitcherMultiViewIterator_v7_5_2.Next(out m_switcherMultiView_v7_5_2);
                while (this.m_switcherMultiView_v7_5_2 != null)
                {
                    SwitcherMultiViewCallback switcherMultiViewCallback = new SwitcherMultiViewCallback(this.m_switcherMultiView_v7_5_2, this.BMDSwitcherInfo.TotalSwitcherMultiView);
                    this.m_switcherMultiView_v7_5_2.AddCallback(switcherMultiViewCallback);
                    this.BMDSwitcherMultiView.Add(switcherMultiViewCallback);
                    SwitcherMultiViewIterator_v7_5_2.Next(out m_switcherMultiView_v7_5_2);
                    this.BMDSwitcherInfo.TotalSwitcherMultiView++;
                }
            }
            #endregion
        }