コード例 #1
0
        /// <summary>
        /// Core method for finishing pending operations, closing the loaded script,
        /// releasing resources and resetting the runtime context.
        /// </summary>
        protected virtual void CloseScriptCore()
        {
            NewSourceRenderSurface?.Invoke(this, new NewRenderSurfaceEventArgs(IntPtr.Zero));
            NewPreviewRenderSurface?.Invoke(this, new NewRenderSurfaceEventArgs(IntPtr.Zero));

            var internalContext = InternalContext;

            internalContext.IsVideoPlaying          = false;
            internalContext.HasVideo                = false;
            internalContext.VideoFrameSize          = Size.Empty;
            internalContext.VideoFrameCount         = 0;
            internalContext.SeekableVideoFrameCount = 0;
            internalContext.VideoDuration           = TimeSpan.Zero;
            internalContext.VideoFramerate          = new Fraction(1, 1);
            internalContext.SetFrameNumberInternal(0);
            internalContext.SetVideoPositionInternal(TimeSpan.Zero);
            internalContext.AspectRatio = new Ratio(1, 1, false);

            internalContext.SetOutputPreviewSizeInternal(
                new VideoSizeOptions()
            {
                ResizeMode  = VideoResizeMode.None,
                PixelWidth  = 0,
                PixelHeight = 0
            }
                );
        }
コード例 #2
0
 /// <summary>
 /// Raises the <see cref="NewPreviewRenderSurface"/> event
 /// with arguments containing a <see cref="IntPtr">pointer</see> to the unmanaged Direct3D preview render surface.
 /// </summary>
 /// <param name="previewRenderSurfacePtr">A <see cref="IntPtr">pointer</see> to the unmanaged Direct3D preview render surface.</param>
 protected void OnNewPreviewRenderSurface(IntPtr previewRenderSurfacePtr)
 {
     NewPreviewRenderSurface?.Invoke(this, new NewRenderSurfaceEventArgs(previewRenderSurfacePtr));
 }