Ejemplo n.º 1
0
        /// <summary>
        /// Toggle SetSyncClock
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void _clockButton_Click(object sender, EventArgs e)
        {
            if ((bool)_clockButton.Tag)
            {
                // unset as reference clock
                _clockButton.MouseOutsideTint = Color.DarkGray;
                _clockButton.ToolTipText      = "Set as Reference Clock";
                _clockButton.Tag = false;
            }
            else
            {
                DSFilterNodeUI refnode = (Parent.Parent as DSGraphEditPanel).GetReferenceClock();
                if (refnode != null)
                {
                    // unset the other reference clock
                    refnode._clockButton.MouseOutsideTint = Color.DarkGray;
                    refnode._clockButton.ToolTipText      = "Set as Reference Clock";
                    refnode._clockButton.Tag = false;
                }

                // set as reference clock
                _clockButton.MouseOutsideTint = Color.Yellow;
                _clockButton.ToolTipText      = "Unset Reference Clock";
                _clockButton.Tag = true;
            }

            // if the graph is set up to use a reference clock, set the new one
            if ((Parent.Parent as DSGraphEditPanel).UseReferenceClock)
            {
                (Parent.Parent as DSGraphEditPanel).Stop();

                DSFilterNodeUI refnode = (Parent.Parent as DSGraphEditPanel).GetReferenceClock();
                IMediaFilter   mf      = (Parent as DSDaggerUIGraph)._Graph as IMediaFilter;
                try
                {
                    if (refnode != null)
                    {
                        mf.SetSyncSource(refnode._referenceClock);
                    }
                    else
                    {
                        (Parent as DSDaggerUIGraph)._Graph.SetDefaultSyncSource();
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, "Error setting reference clock");
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Called when a uinode is added it the graph
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void dsDaggerUIGraph1_ControlAdded(object sender, ControlEventArgs e)
        {
            // get the last uinode added to the graph
            DSFilterNodeUI node = (sender as DSDaggerUIGraph).Controls[(sender as DSDaggerUIGraph).Controls.Count - 1] as DSFilterNodeUI;

            if (node != null)
            {
                // set it's pin placement
                if (node.PinPlacement != _pinPlacement)
                {
                    node.PinPlacement = _pinPlacement;
                }

                // set the Properties Button styles based on ModalProperties setting
                node.SetModalProperties();

                // update it's pins in case they changed during the filter insertion process (EVR especially)
                (node.Node as DSFilterNode).SyncPins();
            }
        }