public DownstreamKey(IBMDSwitcherDownstreamKey key, IMediator mediator) { _key = key; _mediator = mediator; _key.AddCallback(new DownstreamKeyCallback(_key, _mediator)); }
public void SetDownstreamKeyOnAir() { try { IBMDSwitcherDownstreamKey key = GetDownstreamKey(); key.SetInputFill(6); //1-6 works int yes = 1; key.SetOnAir(yes); } catch (Exception ex) { throw new SwitcherLibException(ex.Message, ex); } }
private static DownstreamKeyerState BuildOne(IBMDSwitcherDownstreamKey props) { var state = new DownstreamKeyerState(); props.GetInputCut(out long cutInput); state.Sources.CutSource = (VideoSource)cutInput; props.GetInputFill(out long input); state.Sources.FillSource = (VideoSource)input; props.GetTie(out int tie); state.Properties.Tie = tie != 0; props.GetRate(out uint frames); state.Properties.Rate = frames; props.GetPreMultiplied(out int preMultiplied); state.Properties.PreMultipliedKey = preMultiplied != 0; props.GetClip(out double clip); state.Properties.Clip = clip * 100; props.GetGain(out double gain); state.Properties.Gain = gain * 100; props.GetInverse(out int inverse); state.Properties.Invert = inverse != 0; props.GetMasked(out int masked); state.Properties.MaskEnabled = masked != 0; props.GetMaskTop(out double top); state.Properties.MaskTop = top; props.GetMaskBottom(out double bottom); state.Properties.MaskBottom = bottom; props.GetMaskLeft(out double left); state.Properties.MaskLeft = left; props.GetMaskRight(out double right); state.Properties.MaskRight = right; props.GetOnAir(out int onAir); state.State.OnAir = onAir != 0; props.IsTransitioning(out int isTransitioning); state.State.InTransition = isTransitioning != 0; props.IsAutoTransitioning(out int isAuto); state.State.IsAuto = isAuto != 0; props.GetFramesRemaining(out uint framesRemaining); state.State.RemainingFrames = framesRemaining; props.IsTransitionTowardsOnAir(out int isTowardsAir); state.State.IsTowardsOnAir = isTowardsAir != 0; return(state); }
private void SwitcherDisconnected() { try { this.Text = ""; deactivatebuttons(); btn_reconnect.Enabled = true; btnKey1Air.Enabled = false; 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 (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; } } catch (ArgumentException) { SwitcherDisconnected(); } }
public DownstreamKeyCallback(IBMDSwitcherDownstreamKey downstreamKey, IMediator mediator) { _downstreamKey = downstreamKey; _mediator = mediator; }
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; } }
internal SwitcherDownstreamKeyCallback(IBMDSwitcherDownstreamKey downstreamKey, int index) { this._indexnr = index; this.DownstreamKey = downstreamKey; }