/// <summary>
        /// Creates an instance of the TimedBroadcasterPlugin class, attempting to make a connection to XSplit.
        /// </summary>
        /// <param name="connectionUID">
        /// A unique ID for this application, to be matched in the accompanying .xbs file.
        /// </param>
        /// <param name="visual">
        /// The visual to be rendered.
        /// </param>
        /// <param name="width">
        /// Desired output render width, in pixels.
        /// </param>
        /// <param name="height">
        /// Desired output render height, in pixels.
        /// </param>
        /// <param name="timeInterval">
        /// The time interval between updates, in milliseconds.
        /// </param>
        /// <returns>
        /// Returns an instance of a TimedBroadcasterPlugin if the connection to XSplit was successful, otherwise null is returned.
        /// </returns>
        public static TimedBroadcasterPlugin CreateInstance(
            string connectionUID, Visual visual, int width, int height, int timeInterval)
        {
            TimedBroadcasterPlugin plugin = null;

            try
            {
                var extsrc = new VHCOMRenderEngineExtSrc2 {
                    ConnectionUID = connectionUID
                };
                plugin = new TimedBroadcasterPlugin(extsrc, timeInterval)
                {
                    visual        = visual,
                    width         = width,
                    height        = height,
                    taskScheduler = TaskScheduler.FromCurrentSynchronizationContext()
                };
            }
            catch (COMException)
            {
                // Do nothing, the plugin failed to load so null will be returned.
            }

            return(plugin);
        }
        /// <summary>
        /// Attempts to create an instance of the BroadcasterPlugin class. If XSplit is not installed, null is returned.
        /// </summary>
        /// <param name="connectionUID">
        /// Unique ID to apply to this application, should match the accompanying .xbs file.
        /// </param>
        /// <returns>
        /// Returns an instance of BroadcasterPlugin if XSplit is installed on the system, else null is returned.
        /// </returns>
        public static BroadcasterPlugin CreateInstance(string connectionUID)
        {
            BroadcasterPlugin plugin = null;

            try
            {
                var extsrc = new VHCOMRenderEngineExtSrc2 {
                    ConnectionUID = connectionUID
                };
                plugin = new BroadcasterPlugin(extsrc);
            }
            catch (COMException)
            {
                // Do nothing, the plugin failed to load so null will be returned.
            }

            return(plugin);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="TimedBroadcasterPlugin"/> class.
 /// </summary>
 /// <param name="xsplit">
 /// The xsplit COM instance.
 /// </param>
 /// <param name="timeInterval">
 /// The time interval between updates for the timer.
 /// </param>
 protected TimedBroadcasterPlugin(VHCOMRenderEngineExtSrc2 xsplit, int timeInterval)
     : this(xsplit)
 {
     this.timer          = new Timer(timeInterval);
     this.timer.Elapsed += this.RenderTimerElapsed;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="TimedBroadcasterPlugin"/> class.
 /// </summary>
 /// <param name="xsplit">
 /// The xsplit COM instance.
 /// </param>
 protected TimedBroadcasterPlugin(VHCOMRenderEngineExtSrc2 xsplit)
     : base(xsplit)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="BroadcasterPlugin"/> class.
 ///   Prevents the class from being manually created.
 /// </summary>
 /// <param name="xsplit">
 /// The xsplit instance to attach.
 /// </param>
 protected BroadcasterPlugin(VHCOMRenderEngineExtSrc2 xsplit)
 {
     this.xsplit = xsplit;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="TimedBroadcasterPlugin"/> class.
 /// </summary>
 /// <param name="xsplit">
 /// The xsplit COM instance. 
 /// </param>
 /// <param name="timeInterval">
 /// The time interval between updates for the timer. 
 /// </param>
 protected TimedBroadcasterPlugin(VHCOMRenderEngineExtSrc2 xsplit, int timeInterval)
     : this(xsplit)
 {
     this.timer = new Timer(timeInterval);
     this.timer.Elapsed += this.RenderTimerElapsed;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="TimedBroadcasterPlugin"/> class.
 /// </summary>
 /// <param name="xsplit">
 /// The xsplit COM instance. 
 /// </param>
 protected TimedBroadcasterPlugin(VHCOMRenderEngineExtSrc2 xsplit)
     : base(xsplit)
 {
 }
        /// <summary>
        /// Creates an instance of the TimedBroadcasterPlugin class, attempting to make a connection to XSplit.
        /// </summary>
        /// <param name="connectionUID">
        /// A unique ID for this application, to be matched in the accompanying .xbs file. 
        /// </param>
        /// <param name="visual">
        /// The visual to be rendered. 
        /// </param>
        /// <param name="width">
        /// Desired output render width, in pixels. 
        /// </param>
        /// <param name="height">
        /// Desired output render height, in pixels. 
        /// </param>
        /// <param name="timeInterval">
        /// The time interval between updates, in milliseconds. 
        /// </param>
        /// <returns>
        /// Returns an instance of a TimedBroadcasterPlugin if the connection to XSplit was successful, otherwise null is returned. 
        /// </returns>
        public static TimedBroadcasterPlugin CreateInstance(
            string connectionUID, Visual visual, int width, int height, int timeInterval)
        {
            TimedBroadcasterPlugin plugin = null;

            try
            {
                var extsrc = new VHCOMRenderEngineExtSrc2 { ConnectionUID = connectionUID };
                plugin = new TimedBroadcasterPlugin(extsrc, timeInterval)
                    {
                        visual = visual, 
                        width = width, 
                        height = height, 
                        taskScheduler = TaskScheduler.FromCurrentSynchronizationContext()
                    };
            }
            catch (COMException)
            {
                // Do nothing, the plugin failed to load so null will be returned.
            }

            return plugin;
        }
Example #9
0
        /// <summary>
        /// Attempts to create an instance of the BroadcasterPlugin class. If XSplit is not installed, null is returned.
        /// </summary>
        /// <param name="connectionUID">
        /// Unique ID to apply to this application, should match the accompanying .xbs file.
        /// </param>
        /// <returns>
        /// Returns an instance of BroadcasterPlugin if XSplit is installed on the system, else null is returned.
        /// </returns>
        public static BroadcasterPlugin CreateInstance(string connectionUID)
        {
            BroadcasterPlugin plugin = null;

            try
            {
                var extsrc = new VHCOMRenderEngineExtSrc2 { ConnectionUID = connectionUID };
                plugin = new BroadcasterPlugin(extsrc);
            }
            catch (COMException)
            {
                // Do nothing, the plugin failed to load so null will be returned.
            }

            return plugin;
        }
Example #10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BroadcasterPlugin"/> class. 
 ///   Prevents the class from being manually created.
 /// </summary>
 /// <param name="xsplit">
 /// The xsplit instance to attach.
 /// </param>
 protected BroadcasterPlugin(VHCOMRenderEngineExtSrc2 xsplit)
 {
     this.xsplit = xsplit;
 }