示例#1
0
        /// <summary>
        /// Runs vspipe with specified source file. The output will be discarded.
        /// </summary>
        /// <param name="path">The path to the script to run.</param>
        /// <param name="options">The options for starting the process.</param>
        /// <param name="callback">A method that will be called after the process has been started.</param>
        /// <returns>The process completion status.</returns>
        public CompletionStatus RunVapourSynth(string path, ProcessOptionsEncoder options = null, ProcessStartedEventHandler callback = null)
        {
            if (string.IsNullOrEmpty(path))
            {
                throw new ArgumentException("Path cannot be null or empty.", nameof(path));
            }
            if (!fileSystem.Exists(factory.Config.VsPipePath))
            {
                throw new System.IO.FileNotFoundException($@"File ""{factory.Config.VsPipePath}"" specified by Config.VsPipePath is not found.");
            }
            string           Args    = $@"""{path}"" .";
            IProcessWorker   Manager = factory.Create(options, callback);
            CompletionStatus Result  = Manager.Run(factory.Config.VsPipePath, Args);

            return(Result);
        }