private void UpdateTransitionFramesRemaining() { long framesRemaining; m_mixEffectBlock1.GetInt(_BMDSwitcherMixEffectBlockPropertyId.bmdSwitcherMixEffectBlockPropertyIdTransitionFramesRemaining, out framesRemaining); //textBoxTransFramesRemaining.Text = String.Format("{0}", framesRemaining); if (framesRemaining == 0) { m_mixEffectBlock1.GetInt(_BMDSwitcherMixEffectBlockPropertyId.bmdSwitcherMixEffectBlockPropertyIdPreviewInput, out currentPreview); //setCurrent Program ID m_mixEffectBlock1.GetInt(_BMDSwitcherMixEffectBlockPropertyId.bmdSwitcherMixEffectBlockPropertyIdProgramInput, out currentProgram); updateProgPrevUI(currentPreview, false); updateProgPrevUI(currentProgram, true); } }
private void UpdateCurrentProgram() { long programId; m_mixEffectBlock1.GetInt(_BMDSwitcherMixEffectBlockPropertyId.bmdSwitcherMixEffectBlockPropertyIdProgramInput, out programId); // Select the program popup entry that matches the input id: foreach (StringObjectPair <long> item in _programs) { if (item.value == programId) { this.CurrentProgram = item; break; } } }
private void SwitcherConnected() { //buttonConnect.Enabled = false; // Get the switcher name: string switcherName; m_switcher.GetProductName(out switcherName); //textBoxSwitcherName.Text = switcherName; // Install SwitcherMonitor callbacks: m_switcher.AddCallback(m_switcherMonitor); // We create input monitors for each input. To do this we iterate over all inputs: // This will allow us to update the combo boxes when input names change: IBMDSwitcherInputIterator inputIterator = null; IntPtr inputIteratorPtr; Guid inputIteratorIID = typeof(IBMDSwitcherInputIterator).GUID; m_switcher.CreateIterator(ref inputIteratorIID, out inputIteratorPtr); if (inputIteratorPtr != null) { inputIterator = (IBMDSwitcherInputIterator)Marshal.GetObjectForIUnknown(inputIteratorPtr); } if (inputIterator != null) { IBMDSwitcherInput input; inputIterator.Next(out input); while (input != null) { InputMonitor newInputMonitor = new InputMonitor(input); input.AddCallback(newInputMonitor); newInputMonitor.LongNameChanged += new SwitcherEventHandler(OnInputLongNameChanged); 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 = null; IntPtr meIteratorPtr; Guid meIteratorIID = typeof(IBMDSwitcherMixEffectBlockIterator).GUID; m_switcher.CreateIterator(ref meIteratorIID, out meIteratorPtr); if (meIteratorPtr != null) { meIterator = (IBMDSwitcherMixEffectBlockIterator)Marshal.GetObjectForIUnknown(meIteratorPtr); } if (meIterator == null) { return; } 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); //MixEffectBlockSetEnable(true); getInputNames(); addAUXCallback(); //setCurrent preview ID m_mixEffectBlock1.GetInt(_BMDSwitcherMixEffectBlockPropertyId.bmdSwitcherMixEffectBlockPropertyIdPreviewInput, out currentPreview); currentKey = -1; //setCurrent Program ID m_mixEffectBlock1.GetInt(_BMDSwitcherMixEffectBlockPropertyId.bmdSwitcherMixEffectBlockPropertyIdProgramInput, out currentProgram); updateProgPrevUI(currentPreview, false); updateProgPrevUI(currentProgram, true); UpdateAuxSourceCombos(); MidiListener midi = new MidiListener(); midi.StartListening(this); }