private void AddFile(ICInputOptions inputOptions, ICOutputOptions outputOptions) { int taskIndex = 0; if (mConverter == null || inputOptions == null || outputOptions == null) { return; } taskIndex = mConverter.AddTask(inputOptions.FileName, outputOptions.FileName); if (taskIndex < 0) { richTextBoxLog.Text += "\r\n"; richTextBoxLog.Text += "*** Add Task Failed: " + mConverter.LastErrMsg; richTextBoxLog.Text += "\r\n"; richTextBoxLog.Focus(); richTextBoxLog.Select(richTextBoxLog.TextLength, 0); richTextBoxLog.ScrollToCaret(); return; } ListViewItem lvItem = listViewTask.Items.Add(inputOptions.FileName); lvItem.Tag = taskIndex; long duration = mConverter.AVPrope.FileStreamInfo.Duration; if (duration > 0) { lvItem.SubItems.Add((duration / DURATION_RATIO).ToString()); } else { lvItem.SubItems.Add("N/A"); } lvItem.SubItems.Add(mConverter.AVPrope.FileSize.ToString()); lvItem.SubItems.Add(outputOptions.FileName); lvItem.SubItems.Add(""); lvItem.SubItems.Add(""); lvItem.SubItems.Add(""); lvItem.SubItems.Add(""); richTextBoxLog.Text += "\r\n"; richTextBoxLog.Text += "*** File has been added to the convert list"; richTextBoxLog.Text += "\r\n"; richTextBoxLog.Focus(); richTextBoxLog.Select(richTextBoxLog.TextLength, 0); richTextBoxLog.ScrollToCaret(); buttonClearTask.Enabled = true; buttonRemoveTask.Enabled = true; buttonStartStop.Enabled = true; }
private void AddFile(ICInputOptions inputOptions, ICOutputOptions outputOptions) { int taskIndex = 0; if (mConverter == null || inputOptions == null || outputOptions == null) { return; } taskIndex = mConverter.AddTask(inputOptions.FileName, outputOptions.FileName); if (taskIndex < 0) { richTextBoxLog.Text += "\r\n"; richTextBoxLog.Text += "*** Add Task Failed: " + mConverter.LastErrMsg; richTextBoxLog.Text += "\r\n"; richTextBoxLog.Focus(); richTextBoxLog.Select(richTextBoxLog.TextLength, 0); richTextBoxLog.ScrollToCaret(); return; } ListViewItem lvItem = listViewTask.Items.Add(inputOptions.FileName); lvItem.Tag = taskIndex; long duration = mConverter.AVPrope.FileStreamInfo.Duration; if (duration > 0) { lvItem.SubItems.Add((duration / DURATION_RATIO).ToString()); } else { lvItem.SubItems.Add("N/A"); } lvItem.SubItems.Add(mConverter.AVPrope.FileSize.ToString()); lvItem.SubItems.Add(outputOptions.FileName); lvItem.SubItems.Add(""); lvItem.SubItems.Add(""); lvItem.SubItems.Add(""); lvItem.SubItems.Add(""); richTextBoxLog.Text += "\r\n"; richTextBoxLog.Text += "*** File has been added to the convert list"; richTextBoxLog.Text += "\r\n"; richTextBoxLog.Focus(); richTextBoxLog.Select(richTextBoxLog.TextLength, 0); richTextBoxLog.ScrollToCaret(); buttonClearTask.Enabled = true; buttonRemoveTask.Enabled = true; buttonStartStop.Enabled = true; }