public IRecipientOption AddCustomArguments(string key, string value)
        {
            if (CustomArguments == null)
            {
                CustomArguments = new Dictionary <string, string>();
            }

            CustomArguments.Add(key, value);
            return(this);
        }
        public ISendEmailCommand AddCustomArguments(string key, string value)
        {
            if (CustomArguments == null)
            {
                CustomArguments = new Dictionary <string, string>();
            }

            CustomArguments.Add(key, value);
            return(this);
        }
Beispiel #3
0
        private void backgroundWorker1_seekAfterComplete(object sender, RunWorkerCompletedEventArgs e)
        {
            extractPreview(m_inputFile, trackBarSeek.Value.ToString());
            //seek to time that user chose on slider
            backgroundWorker1.RunWorkerCompleted -= backgroundWorker1_seekAfterComplete;
            CustomArguments args = new CustomArguments();

            args.inputFile = m_inputFile;
            args.seekTime  = trackBarSeek.Value.ToString();
            backgroundWorker1.RunWorkerAsync(args);
        }
Beispiel #4
0
        private void buttonPlay_Click(object sender, EventArgs e)
        {
            pictureBoxPreviewThumb.Image = null;
            if (backgroundWorker1.IsBusy != true)
            {
                // Start the asynchronous operation.
                CustomArguments args = new CustomArguments();
                args.inputFile = m_inputFile;

                backgroundWorker1.RunWorkerAsync(args);
            }
        }
Beispiel #5
0
        private void backgroundWorker1_DoWork_1(object sender, DoWorkEventArgs e)
        {
            //starts ffmpeg process
            CustomArguments args = (CustomArguments)e.Argument;

            try
            {
                if (!File.Exists(ffmpeg_exe))
                {
                    MessageBox.Show(ffmpeg_exe + " does not exist!");
                }
                string cmd = "";
                if (args.seekTime != null)
                {
                    cmd += " -ss " + args.seekTime;
                }
                cmd += m_sourceIsImage + " -i \"" + args.inputFile + "\" ";
                cmd += m_colorSpaceFilter;
                cmd += m_colorRangeFilter;
                string selectedDecklink = comboBoxDevices.SelectedValue.ToString();
                cmd += " -f decklink -vcodec v210 -c:a pcm_s24le -ar 48000 -ac 8 \"" + selectedDecklink + "\"";
                System.Diagnostics.Process proc = new System.Diagnostics.Process();
                textBoxFfmpegCmd.Text                 = "ffmpeg " + cmd;
                proc.StartInfo.FileName               = ffmpeg_exe;
                proc.StartInfo.Arguments              = cmd;
                proc.StartInfo.UseShellExecute        = false;
                proc.StartInfo.CreateNoWindow         = true;
                proc.StartInfo.RedirectStandardOutput = true;
                proc.StartInfo.RedirectStandardError  = true;
                proc.ErrorDataReceived               += this.HandleFfmpegOutput;
                proc.OutputDataReceived              += this.HandleFfmpegOutput;
                proc.Start();

                // and start asynchronous read
                proc.BeginOutputReadLine();
                proc.BeginErrorReadLine();

                m_ffmpegPID = proc.Id;
                // wait until it's finished in your background worker thread
                proc.WaitForExit();
                proc.Close();
                e.Cancel = true;
                return;
            }
            catch (Exception err)
            {
                string myerr = err.ToString();
            }
        }