2 using System.Collections.Generic;
\r
3 using System.ComponentModel;
\r
5 using System.Drawing;
\r
7 using System.Windows.Forms;
\r
10 using System.Diagnostics;
\r
11 using System.Threading;
\r
15 public partial class frmMain : Form
\r
17 private Process hbProc;
\r
18 private Parsing.DVD thisDVD;
\r
20 // --------------------------------------------------------------
\r
21 // Some windows that require only 1 instance.
\r
22 // --------------------------------------------------------------
\r
23 private frmQueue queueWindow = new frmQueue();
\r
25 // --------------------------------------------------------------
\r
26 // Stuff that needs doing on startup.
\r
27 // - Load users default settings. (if required)
\r
28 // - Do an update check (if required)
\r
29 // --------------------------------------------------------------
\r
30 private frmDvdInfo dvdInfoWindow = new frmDvdInfo();
\r
35 ThreadPool.QueueUserWorkItem(showSplash);
\r
38 InitializeComponent();
\r
40 // This is a quick Hack fix for the cross-thread problem with frmDvdIndo ************************
\r
41 dvdInfoWindow.Show();
\r
42 dvdInfoWindow.Hide();
\r
43 // **********************************************************************************************
\r
45 // Set the Version number lable to the corect version.
\r
46 Version.Text = "Version " + Properties.Settings.Default.GuiVersion;
\r
48 // Run the update checker.
\r
51 // Now load the users default if required.
\r
55 public void showSplash(object sender)
\r
57 Form splash = new frmSplashScreen();
\r
62 public void loadUserDefaults()
\r
66 if (Properties.Settings.Default.defaultSettings == "Checked")
\r
69 text_source.Text = Properties.Settings.Default.DVDSource;
\r
70 drp_dvdtitle.Text = Properties.Settings.Default.DVDTitle;
\r
71 drop_chapterStart.Text = Properties.Settings.Default.ChapterStart;
\r
72 drop_chapterFinish.Text = Properties.Settings.Default.ChapterFinish;
\r
75 text_destination.Text = Properties.Settings.Default.VideoDest;
\r
76 drp_videoEncoder.Text = Properties.Settings.Default.VideoEncoder;
\r
77 drp_audioCodec.Text = Properties.Settings.Default.AudioEncoder;
\r
78 text_width.Text = Properties.Settings.Default.Width;
\r
79 text_height.Text = Properties.Settings.Default.Height;
\r
81 // Picture Settings Tab
\r
82 drp_crop.Text = Properties.Settings.Default.CroppingOption;
\r
83 text_top.Text = Properties.Settings.Default.CropTop;
\r
84 text_bottom.Text = Properties.Settings.Default.CropBottom;
\r
85 text_left.Text = Properties.Settings.Default.CropLeft;
\r
86 text_right.Text = Properties.Settings.Default.CropRight;
\r
87 drp_subtitle.Text = Properties.Settings.Default.Subtitles;
\r
89 // Video Settings Tab
\r
90 text_bitrate.Text = Properties.Settings.Default.VideoBitrate;
\r
91 text_filesize.Text = Properties.Settings.Default.VideoFilesize;
\r
92 slider_videoQuality.Value = Properties.Settings.Default.VideoQuality;
\r
94 if (Properties.Settings.Default.TwoPass == "Checked")
\r
96 check_2PassEncode.CheckState = CheckState.Checked;
\r
99 drp_deInterlace_option.Text = Properties.Settings.Default.DeInterlace;
\r
101 if (Properties.Settings.Default.Grayscale == "Checked")
\r
103 check_grayscale.CheckState = CheckState.Checked;
\r
106 drp_videoFramerate.Text = Properties.Settings.Default.Framerate;
\r
108 if (Properties.Settings.Default.PixelRatio == "Checked")
\r
110 CheckPixelRatio.CheckState = CheckState.Checked;
\r
112 if (Properties.Settings.Default.turboFirstPass == "Checked")
\r
114 check_turbo.CheckState = CheckState.Checked;
\r
116 if (Properties.Settings.Default.largeFile == "Checked")
\r
118 check_largeFile.CheckState = CheckState.Checked;
\r
120 // Audio Settings Tab
\r
121 drp_audioBitrate.Text = Properties.Settings.Default.AudioBitrate;
\r
122 drp_audioSampleRate.Text = Properties.Settings.Default.AudioSampleRate;
\r
123 drp_audioChannels.Text = Properties.Settings.Default.AudioChannels;
\r
126 if (Properties.Settings.Default.CRF == "Checked")
\r
128 CheckCRF.CheckState = CheckState.Checked;
\r
130 rtf_h264advanced.Text = Properties.Settings.Default.H264;
\r
135 // No real need to alert the user. Try/Catch only in just incase there is a problem reading the settings xml file.
\r
139 public void updateCheck()
\r
141 if (Properties.Settings.Default.updateStatus == "Checked")
\r
145 String updateFile = Properties.Settings.Default.updateFile;
\r
146 WebClient client = new WebClient();
\r
147 String data = client.DownloadString(updateFile);
\r
148 String[] versionData = data.Split('\n');
\r
150 if ((versionData[0] != Properties.Settings.Default.GuiVersion) || (versionData[1] != Properties.Settings.Default.CliVersion))
\r
152 lbl_update.Visible = true;
\r
157 // Silently ignore the error
\r
162 // --------------------------------------------------------------
\r
163 // The main Menu bar.
\r
164 // --------------------------------------------------------------
\r
168 private void mnu_open_Click(object sender, EventArgs e)
\r
171 File_Open.ShowDialog();
\r
172 filename = File_Open.FileName;
\r
173 if (filename != "")
\r
177 // Create StreamReader & open file
\r
178 StreamReader line = new StreamReader(filename);
\r
179 string temporyLine; // Used for reading the line into a varible before processing on the checkState items below.
\r
181 // Read in the data and set the correct GUI component with the setting.
\r
182 text_source.Text = line.ReadLine();
\r
183 drp_dvdtitle.Text = line.ReadLine();
\r
184 drop_chapterStart.Text = line.ReadLine();
\r
185 drop_chapterFinish.Text = line.ReadLine();
\r
186 text_destination.Text = line.ReadLine();
\r
187 drp_videoEncoder.Text = line.ReadLine();
\r
188 drp_audioCodec.Text = line.ReadLine();
\r
189 text_width.Text = line.ReadLine();
\r
190 text_height.Text = line.ReadLine();
\r
191 text_top.Text = line.ReadLine();
\r
192 text_bottom.Text = line.ReadLine();
\r
193 text_left.Text = line.ReadLine();
\r
194 text_right.Text = line.ReadLine();
\r
195 drp_subtitle.Text = line.ReadLine();
\r
196 text_bitrate.Text = line.ReadLine();
\r
197 text_filesize.Text = line.ReadLine();
\r
198 slider_videoQuality.Value = int.Parse(line.ReadLine());
\r
200 temporyLine = line.ReadLine();
\r
201 if (temporyLine == "Checked")
\r
203 check_2PassEncode.CheckState = CheckState.Checked;
\r
206 drp_deInterlace_option.Text = line.ReadLine();
\r
208 temporyLine = line.ReadLine();
\r
209 if (temporyLine == "Checked")
\r
211 check_grayscale.CheckState = CheckState.Checked;
\r
214 drp_videoFramerate.Text = line.ReadLine();
\r
216 temporyLine = line.ReadLine();
\r
217 if (temporyLine == "Checked")
\r
219 Check_ChapterMarkers.CheckState = CheckState.Checked;
\r
222 temporyLine = line.ReadLine();
\r
223 if (temporyLine == "Checked")
\r
225 CheckPixelRatio.CheckState = CheckState.Checked;
\r
228 temporyLine = line.ReadLine();
\r
229 if (temporyLine == "Checked")
\r
231 check_turbo.CheckState = CheckState.Checked;
\r
234 temporyLine = line.ReadLine();
\r
235 if (temporyLine == "Checked")
\r
237 check_largeFile.CheckState = CheckState.Checked;
\r
240 drp_audioBitrate.Text = line.ReadLine();
\r
241 drp_audioSampleRate.Text = line.ReadLine();
\r
242 drp_audioChannels.Text = line.ReadLine();
\r
243 drp_audioMixDown.Text = line.ReadLine();
\r
245 // Advanced H264 Options
\r
246 temporyLine = line.ReadLine();
\r
247 if (temporyLine == "Checked")
\r
249 CheckCRF.CheckState = CheckState.Checked;
\r
251 rtf_h264advanced.Text = line.ReadLine();
\r
253 // Close the stream
\r
257 // Fix for SliderValue not appearing when Opening saved file
\r
258 SliderValue.Text = slider_videoQuality.Value + "%";
\r
260 } catch (Exception){
\r
261 MessageBox.Show("Unable to load profile.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
\r
266 private void mnu_save_Click(object sender, EventArgs e)
\r
270 File_Save.ShowDialog();
\r
271 filename = File_Save.FileName;
\r
272 if (filename != "")
\r
276 // Create a StreamWriter and open the file
\r
277 StreamWriter line = new StreamWriter(filename);
\r
280 line.WriteLine(text_source.Text);
\r
281 line.WriteLine(drp_dvdtitle.Text);
\r
282 line.WriteLine(drop_chapterStart.Text);
\r
283 line.WriteLine(drop_chapterFinish.Text);
\r
285 line.WriteLine(text_destination.Text);
\r
286 line.WriteLine(drp_videoEncoder.Text);
\r
287 line.WriteLine(drp_audioCodec.Text);
\r
288 line.WriteLine(text_width.Text);
\r
289 line.WriteLine(text_height.Text);
\r
290 //Picture Settings Tab
\r
291 line.WriteLine(text_top.Text);
\r
292 line.WriteLine(text_bottom.Text);
\r
293 line.WriteLine(text_left.Text);
\r
294 line.WriteLine(text_right.Text);
\r
295 line.WriteLine(drp_subtitle.Text);
\r
296 //Video Settings Tab
\r
297 line.WriteLine(text_bitrate.Text);
\r
298 line.WriteLine(text_filesize.Text);
\r
299 line.WriteLine(slider_videoQuality.Value.ToString());
\r
300 line.WriteLine(check_2PassEncode.CheckState.ToString());
\r
301 line.WriteLine(drp_deInterlace_option.Text);
\r
302 line.WriteLine(check_grayscale.CheckState.ToString());
\r
303 line.WriteLine(drp_videoFramerate.Text);
\r
304 line.WriteLine(Check_ChapterMarkers.CheckState.ToString());
\r
305 line.WriteLine(CheckPixelRatio.CheckState.ToString());
\r
306 line.WriteLine(check_turbo.CheckState.ToString());
\r
307 line.WriteLine(check_largeFile.CheckState.ToString());
\r
308 //Audio Settings Tab
\r
309 line.WriteLine(drp_audioBitrate.Text);
\r
310 line.WriteLine(drp_audioSampleRate.Text);
\r
311 line.WriteLine(drp_audioChannels.Text);
\r
312 line.WriteLine(drp_audioMixDown.Text);
\r
314 line.WriteLine(CheckCRF.CheckState.ToString());
\r
315 line.WriteLine(rtf_h264advanced.Text);
\r
316 // close the stream
\r
318 MessageBox.Show("Your profile has been sucessfully saved.", "Status", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
\r
322 MessageBox.Show("Unable to write to the file. Please make sure the location has the correct permissions for file writing.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
\r
328 private void mnu_update_Click(object sender, EventArgs e)
\r
330 Form Update = new frmUpdate();
\r
331 Update.ShowDialog();
\r
334 private void mnu_exit_Click(object sender, EventArgs e)
\r
343 private void mnu_encode_Click(object sender, EventArgs e)
\r
349 private void mnu_viewDVDdata_Click(object sender, EventArgs e)
\r
353 dvdInfoWindow.Show();
\r
360 // BUG *******************************************************
\r
361 // Cross-thread operation not valid: Control 'rtf_dvdInfo' accessed from a thread other than the thread it was created on.
\r
362 // This happens when the DVD is scanned and this item is then selected.
\r
363 // If this item is selected so a blank copy of the window appears, then a DVD is scanned, there is no cross-thread issue.
\r
364 // NOTE: Try/catch added to prevent final build crashing.
\r
365 // NOTE2: Included a quick fix in frmMain(). Simply show and hide the window when starting the app.
\r
366 // Note3: Suspect the problem lies with line 30.
\r
367 // ***********************************************************
\r
371 private void mnu_options_Click(object sender, EventArgs e)
\r
373 Form Options = new frmOptions();
\r
374 Options.ShowDialog();
\r
379 #region Presets Menu
\r
381 private void mnu_preset_ipod133_Click(object sender, EventArgs e)
\r
383 CheckPixelRatio.CheckState = CheckState.Unchecked;
\r
384 text_width.Text = "640";
\r
385 text_height.Text = "480";
\r
386 drp_videoEncoder.Text = "H.264 (iPod)";
\r
387 text_bitrate.Text = "1000";
\r
388 text_filesize.Text = "";
\r
389 slider_videoQuality.Value = 0;
\r
390 SliderValue.Text = "0%";
\r
391 drp_audioBitrate.Text = "160";
\r
392 rtf_h264advanced.Text = "";
\r
393 drp_crop.Text = "No Crop";
\r
396 private void mnu_preset_ipod178_Click(object sender, EventArgs e)
\r
398 CheckPixelRatio.CheckState = CheckState.Unchecked;
\r
399 text_width.Text = "640";
\r
400 text_height.Text = "352";
\r
401 drp_videoEncoder.Text = "H.264 (iPod)";
\r
402 text_bitrate.Text = "1000";
\r
403 text_filesize.Text = "";
\r
404 slider_videoQuality.Value = 0;
\r
405 SliderValue.Text = "0%";
\r
406 drp_audioBitrate.Text = "160";
\r
407 rtf_h264advanced.Text = "";
\r
408 drp_crop.Text = "No Crop";
\r
411 private void mnu_preset_ipod235_Click(object sender, EventArgs e)
\r
413 CheckPixelRatio.CheckState = CheckState.Unchecked;
\r
414 text_width.Text = "640";
\r
415 text_height.Text = "272";
\r
416 drp_videoEncoder.Text = "H.264 (iPod)";
\r
417 text_bitrate.Text = "1000";
\r
418 text_filesize.Text = "";
\r
419 slider_videoQuality.Value = 0;
\r
420 SliderValue.Text = "0%";
\r
421 drp_audioBitrate.Text = "160";
\r
422 rtf_h264advanced.Text = "";
\r
423 drp_crop.Text = "No Crop";
\r
426 private void mnu_appleTv_Click(object sender, EventArgs e)
\r
428 text_width.Text = "";
\r
429 text_height.Text = "";
\r
430 drp_videoEncoder.Text = "H.264";
\r
431 text_bitrate.Text = "3000";
\r
432 text_filesize.Text = "";
\r
433 slider_videoQuality.Value = 0;
\r
434 SliderValue.Text = "0%";
\r
435 drp_audioBitrate.Text = "160";
\r
436 CheckPixelRatio.CheckState = CheckState.Checked;
\r
437 drp_audioSampleRate.Text = "48";
\r
438 rtf_h264advanced.Text = "bframes=3:ref=1:subme=5:me=umh:no-fast-pskip=1:no-dct-decimate=1:trellis=2";
\r
439 drp_crop.Text = "No Crop";
\r
443 private void mnu_presetPS3_Click(object sender, EventArgs e)
\r
445 CheckPixelRatio.CheckState = CheckState.Unchecked;
\r
446 text_width.Text = "";
\r
447 text_height.Text = "";
\r
448 drp_videoEncoder.Text = "H.264";
\r
449 text_bitrate.Text = "3000";
\r
450 text_filesize.Text = "";
\r
451 slider_videoQuality.Value = 0;
\r
452 SliderValue.Text = "0%";
\r
453 drp_audioBitrate.Text = "160";
\r
454 CheckPixelRatio.CheckState = CheckState.Checked;
\r
455 drp_audioSampleRate.Text = "48";
\r
456 rtf_h264advanced.Text = "level=41";
\r
457 drp_crop.Text = "No Crop";
\r
460 private void mnu_ProgramDefaultOptions_Click(object sender, EventArgs e)
\r
463 Properties.Settings.Default.DVDSource = text_source.Text;
\r
464 Properties.Settings.Default.DVDTitle = drp_dvdtitle.Text;
\r
465 Properties.Settings.Default.ChapterStart = drop_chapterStart.Text;
\r
466 Properties.Settings.Default.ChapterFinish = drop_chapterFinish.Text;
\r
468 Properties.Settings.Default.VideoDest = text_destination.Text;
\r
469 Properties.Settings.Default.VideoEncoder = drp_videoEncoder.Text;
\r
470 Properties.Settings.Default.AudioEncoder = drp_audioCodec.Text;
\r
471 Properties.Settings.Default.Width = text_width.Text;
\r
472 Properties.Settings.Default.Height = text_height.Text;
\r
473 //Picture Settings Tab
\r
474 Properties.Settings.Default.CroppingOption = drp_crop.Text;
\r
475 Properties.Settings.Default.CropTop = text_top.Text;
\r
476 Properties.Settings.Default.CropBottom = text_bottom.Text;
\r
477 Properties.Settings.Default.CropLeft = text_left.Text;
\r
478 Properties.Settings.Default.CropRight = text_right.Text;
\r
479 Properties.Settings.Default.Subtitles = drp_subtitle.Text;
\r
480 //Video Settings Tab
\r
481 Properties.Settings.Default.VideoBitrate = text_bitrate.Text;
\r
482 Properties.Settings.Default.VideoFilesize = text_filesize.Text;
\r
483 Properties.Settings.Default.VideoQuality = slider_videoQuality.Value;
\r
484 Properties.Settings.Default.TwoPass = check_2PassEncode.CheckState.ToString();
\r
485 Properties.Settings.Default.DeInterlace = drp_deInterlace_option.Text;
\r
486 Properties.Settings.Default.Grayscale = check_grayscale.CheckState.ToString();
\r
487 Properties.Settings.Default.Framerate = drp_videoFramerate.Text;
\r
488 Properties.Settings.Default.PixelRatio = CheckPixelRatio.CheckState.ToString();
\r
489 Properties.Settings.Default.turboFirstPass = check_turbo.CheckState.ToString();
\r
490 Properties.Settings.Default.largeFile = check_largeFile.CheckState.ToString();
\r
491 //Audio Settings Tab
\r
492 Properties.Settings.Default.AudioBitrate = drp_audioBitrate.Text;
\r
493 Properties.Settings.Default.AudioSampleRate = drp_audioSampleRate.Text;
\r
494 Properties.Settings.Default.AudioChannels = drp_audioChannels.Text;
\r
496 Properties.Settings.Default.CRF = CheckCRF.CheckState.ToString();
\r
497 Properties.Settings.Default.H264 = rtf_h264advanced.Text;
\r
498 Properties.Settings.Default.Save();
\r
505 private void mnu_wiki_Click(object sender, EventArgs e)
\r
507 Process.Start("http://handbrake.m0k.org/trac");
\r
510 private void mnu_onlineDocs_Click(object sender, EventArgs e)
\r
512 Process.Start("http://handbrake.m0k.org/?page_id=11");
\r
515 private void mnu_faq_Click(object sender, EventArgs e)
\r
517 Process.Start("http://handbrake.m0k.org/trac/wiki/WindowsGuiFaq");
\r
520 private void mnu_homepage_Click(object sender, EventArgs e)
\r
522 Process.Start("http://handbrake.m0k.org");
\r
525 private void mnu_forum_Click(object sender, EventArgs e)
\r
527 Process.Start("http://handbrake.m0k.org/forum");
\r
530 private void mnu_about_Click(object sender, EventArgs e)
\r
532 Form About = new frmAbout();
\r
533 About.ShowDialog();
\r
538 // --------------------------------------------------------------
\r
539 // Buttons on the main Window
\r
540 // --------------------------------------------------------------
\r
541 private void btn_Browse_Click(object sender, EventArgs e)
\r
544 String filename ="";
\r
545 text_source.Text = "";
\r
547 //int scanTwice = 0;
\r
549 if (RadioDVD.Checked)
\r
551 DVD_Open.ShowDialog();
\r
552 filename = DVD_Open.SelectedPath;
\r
553 if (filename != "")
\r
555 Form frmRD = new frmReadDVD(filename, this, dvdInfoWindow);
\r
556 text_source.Text = filename;
\r
557 frmRD.ShowDialog();
\r
562 ISO_Open.ShowDialog();
\r
563 filename = ISO_Open.FileName;
\r
564 if (filename != "")
\r
566 Form frmRD = new frmReadDVD(filename, this, dvdInfoWindow);
\r
567 text_source.Text = filename;
\r
568 frmRD.ShowDialog();
\r
572 // Check if there was titles in the dvd title dropdown
\r
573 // If there isn't any, rescan the DVD. hbcli occasionally fails (see bug in encode) with standard error.
\r
574 if (filename != "")
\r
576 // Disbaled the 2nd pass for the time being.
\r
577 /* if (drp_dvdtitle.Items.Count == 0)
\r
579 if (scanTwice == 0)
\r
581 MessageBox.Show("Scan Failed. Waiting 5 Seconds before attempting to re-scan the source a 2nd time.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
\r
582 Thread.Sleep(3000);
\r
583 Form frmRD = new frmReadDVD(filename, this, dvdInfoWindow);
\r
584 frmRD.ShowDialog();
\r
591 text_source.Text = "Click 'Browse' to continue";
\r
594 if (drp_dvdtitle.Items.Count == 0)
\r
596 MessageBox.Show("No Title(s) found. Please make sure you have selected a valid, non-copy protected source. Please refer to the FAQ (see Help Menu).", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
\r
601 private void btn_destBrowse_Click(object sender, EventArgs e)
\r
603 // TODO: Need to write some code to check if there is a reasonable amount of disk space left.
\r
605 DVD_Save.ShowDialog();
\r
606 text_destination.Text = DVD_Save.FileName;
\r
608 if (Check_ChapterMarkers.Checked)
\r
610 string destination = text_destination.Text;
\r
611 destination = destination.Replace(".mp4", ".m4v");
\r
612 text_destination.Text = destination;
\r
616 private void btn_h264Clear_Click(object sender, EventArgs e)
\r
618 rtf_h264advanced.Text = "";
\r
621 private void GenerateQuery_Click(object sender, EventArgs e)
\r
623 String query = GenerateTheQuery();
\r
624 QueryEditorText.Text = query;
\r
627 private void btn_ClearQuery_Click(object sender, EventArgs e)
\r
629 QueryEditorText.Text = "";
\r
632 private void btn_queue_Click(object sender, EventArgs e)
\r
634 if (text_destination.Text != "" && text_source.Text != "")
\r
637 if (QueryEditorText.Text == "")
\r
639 query = GenerateTheQuery();
\r
643 query = QueryEditorText.Text;
\r
645 queueWindow.list_queue.Items.Add(query);
\r
646 queueWindow.Show();
\r
650 MessageBox.Show("No Source OR destination selected.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
\r
654 private void showQueue()
\r
656 queueWindow.Show();
\r
663 //---------------------------------------------------
\r
664 // Encode / Cancel Buttons
\r
665 // Encode Progress Text Handler
\r
666 //---------------------------------------------------
\r
668 Functions.CLI process = new Functions.CLI();
\r
670 private void btn_encode_Click(object sender, EventArgs e)
\r
672 btn_eCancel.Enabled = true;
\r
674 lbl_encode.Visible = false;
\r
676 if (QueryEditorText.Text == "")
\r
678 query = GenerateTheQuery();
\r
682 query = QueryEditorText.Text;
\r
685 ThreadPool.QueueUserWorkItem(procMonitor, query);
\r
686 lbl_encode.Text = "Encoding Started";
\r
689 private void btn_eCancel_Click(object sender, EventArgs e)
\r
693 lbl_encode.Text = "Encoding Canceled";
\r
696 private void procMonitor(object state)
\r
698 // Make sure we are not already encoding and if we are then display an error.
\r
699 if (hbProc != null)
\r
701 MessageBox.Show("Handbrake is already encoding a video!", "Status", MessageBoxButtons.OK, MessageBoxIcon.Warning);
\r
705 hbProc = process.runCli(this, (string)state, false, false, false, false);
\r
706 MessageBox.Show("The encode process has now started.", "Status", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
\r
707 hbProc.WaitForExit();
\r
712 //*****************************************************************************************
\r
714 // When the below code is used and standard error is set to true, hbcli is outputing a
\r
715 // video stream which has mild corruption issues every few seconds.
\r
716 // Maybe an issue with the Parser cauing the CLI to hickup/pause?
\r
717 //*****************************************************************************************
\r
720 /*Parsing.Parser encode = new Parsing.Parser(hbProc.StandardError.BaseStream);
\r
721 encode.OnEncodeProgress += encode_OnEncodeProgress;
\r
722 while (!encode.EndOfStream)
\r
727 hbProc.WaitForExit();
\r
728 process.closeCLI();
\r
736 MessageBox.Show("The encode process has now ended.", "Status", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
\r
741 private void encode_OnEncodeProgress(object Sender, int CurrentTask, int TaskCount, float PercentComplete, float CurrentFps, float AverageFps, TimeSpan TimeRemaining)
\r
743 if (this.InvokeRequired)
\r
745 this.BeginInvoke(new Parsing.EncodeProgressEventHandler(encode_OnEncodeProgress),
\r
746 new object[] { Sender, CurrentTask, TaskCount, PercentComplete, CurrentFps, AverageFps, TimeRemaining });
\r
749 lbl_encode.Text = string.Format("Encode Progress: {0}%, FPS: {1}, Avg FPS: {2}, Time Remaining: {3} ", PercentComplete, CurrentFps, AverageFps, TimeRemaining);
\r
752 //---------------------------------------------------
\r
753 // Items that require actions on frmMain
\r
754 //---------------------------------------------------
\r
756 private void drop_chapterStart_SelectedIndexChanged(object sender, EventArgs e)
\r
758 lbl_chptWarn.Visible = false;
\r
759 QueryEditorText.Text = "";
\r
760 if ((drop_chapterFinish.Text != "Auto") && (drop_chapterStart.Text != "Auto"))
\r
764 int chapterFinish = int.Parse(drop_chapterFinish.Text);
\r
765 int chapterStart = int.Parse(drop_chapterStart.Text);
\r
767 if (chapterFinish < chapterStart)
\r
769 lbl_chptWarn.Visible = true;
\r
770 lbl_chptWarn.Text = "Invalid Chapter Range!";
\r
775 lbl_chptWarn.Visible = true;
\r
776 lbl_chptWarn.Text = "Invalid Chapter Range!";
\r
783 private void drop_chapterFinish_SelectedIndexChanged(object sender, EventArgs e)
\r
785 lbl_chptWarn.Visible = false;
\r
786 QueryEditorText.Text = "";
\r
787 if ((drop_chapterFinish.Text != "Auto") && (drop_chapterStart.Text != "Auto"))
\r
791 int chapterFinish = int.Parse(drop_chapterFinish.Text);
\r
792 int chapterStart = int.Parse(drop_chapterStart.Text);
\r
794 if (chapterFinish < chapterStart)
\r
796 lbl_chptWarn.Visible = true;
\r
797 lbl_chptWarn.Text = "Invalid Chapter Range!";
\r
802 lbl_chptWarn.Visible = true;
\r
803 lbl_chptWarn.Text = "Invalid Chapter Range!";
\r
808 private void text_bitrate_TextChanged(object sender, EventArgs e)
\r
810 text_filesize.Text = "";
\r
811 slider_videoQuality.Value = 0;
\r
812 SliderValue.Text = "0%";
\r
813 CheckCRF.CheckState = CheckState.Unchecked;
\r
814 CheckCRF.Enabled = false;
\r
817 private void text_filesize_TextChanged(object sender, EventArgs e)
\r
819 text_bitrate.Text = "";
\r
820 slider_videoQuality.Value = 0;
\r
821 SliderValue.Text = "0%";
\r
822 CheckCRF.CheckState = CheckState.Unchecked;
\r
823 CheckCRF.Enabled = false;
\r
826 private void slider_videoQuality_Scroll(object sender, EventArgs e)
\r
828 SliderValue.Text = slider_videoQuality.Value.ToString() + "%";
\r
829 text_bitrate.Text = "";
\r
830 text_filesize.Text = "";
\r
831 CheckCRF.Enabled = true;
\r
834 private void label_h264_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
\r
836 Process.Start("http://handbrake.m0k.org/trac/wiki/x264Options");
\r
839 private void text_width_TextChanged(object sender, EventArgs e)
\r
844 if (CheckPixelRatio.Checked)
\r
846 text_width.Text = "";
\r
847 text_width.BackColor = Color.White;
\r
851 if ((int.Parse(text_width.Text) % 16) != 0)
\r
853 text_width.BackColor = Color.LightCoral;
\r
857 text_width.BackColor = Color.LightGreen;
\r
861 if (lbl_Aspect.Text != "Select a Title")
\r
863 double height = int.Parse(text_width.Text) / double.Parse(lbl_Aspect.Text);
\r
864 double mod16 = height % 16;
\r
865 height = height - mod16;
\r
867 if (text_width.Text == "")
\r
869 text_height.Text = "";
\r
870 text_width.BackColor = Color.White;
\r
874 text_height.Text = height.ToString();
\r
880 // No need to throw an error here.
\r
886 private void text_height_TextChanged(object sender, EventArgs e)
\r
890 if (CheckPixelRatio.Checked)
\r
892 text_height.Text = "";
\r
893 text_width.BackColor = Color.White;
\r
897 if ((int.Parse(text_height.Text) % 16) != 0)
\r
899 text_height.BackColor = Color.LightCoral;
\r
903 text_height.BackColor = Color.LightGreen;
\r
906 } catch(Exception){
\r
907 // No need to alert the user.
\r
911 private void drp_crop_SelectedIndexChanged(object sender, EventArgs e)
\r
913 if ((string)drp_crop.SelectedItem == "Manual")
\r
915 text_left.Enabled = true;
\r
916 text_right.Enabled = true;
\r
917 text_top.Enabled = true;
\r
918 text_bottom.Enabled = true;
\r
921 if ((string)drp_crop.SelectedItem == "Auto Crop")
\r
923 text_left.Enabled = false;
\r
924 text_right.Enabled = false;
\r
925 text_top.Enabled = false;
\r
926 text_bottom.Enabled = false;
\r
927 text_left.Text = "";
\r
928 text_right.Text = "";
\r
929 text_top.Text = "";
\r
930 text_bottom.Text = "";
\r
932 if (lbl_RecomendedCrop.Text != "Select a Title")
\r
934 string[] temp = new string[4];
\r
935 temp = lbl_RecomendedCrop.Text.Split('/');
\r
936 text_left.Text = temp[2];
\r
937 text_right.Text = temp[3];
\r
938 text_top.Text = temp[0];
\r
939 text_bottom.Text = temp[1];
\r
943 if ((string)drp_crop.SelectedItem == "No Crop")
\r
945 text_left.Enabled = false;
\r
946 text_right.Enabled = false;
\r
947 text_top.Enabled = false;
\r
948 text_bottom.Enabled = false;
\r
949 text_left.Text = "0";
\r
950 text_right.Text = "0";
\r
951 text_top.Text = "0";
\r
952 text_bottom.Text = "0";
\r
957 private void CheckPixelRatio_CheckedChanged(object sender, EventArgs e)
\r
959 text_width.Text = "";
\r
960 text_height.Text = "";
\r
961 text_width.BackColor = Color.White;
\r
962 text_height.BackColor = Color.White;
\r
965 private void drp_dvdtitle_Click(object sender, EventArgs e)
\r
967 if (drp_dvdtitle.Items.Count == 1)
\r
969 MessageBox.Show("There are no titles to select. Please scan the DVD by clicking the 'browse' button above before trying to select a title.", "Alert", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
\r
973 private void drp_audioCodec_SelectedIndexChanged(object sender, EventArgs e)
\r
976 //CLI Audio mixdown Names: mono stereo dpl1 dpl2 6ch
\r
978 drp_audioMixDown.Items.Clear();
\r
980 if (drp_audioCodec.Text == "AAC")
\r
982 drp_audioMixDown.Items.Clear();
\r
983 drp_audioMixDown.Items.Add("Mono");
\r
984 drp_audioMixDown.Items.Add("Stereo");
\r
985 drp_audioMixDown.Items.Add("Dolby Surround");
\r
986 drp_audioMixDown.Items.Add("Dolby Pro Logic II");
\r
987 drp_audioMixDown.Items.Add("6 Channel Discrete");
\r
989 drp_audioBitrate.Items.Clear();
\r
990 drp_audioBitrate.Items.Add("32");
\r
991 drp_audioBitrate.Items.Add("40");
\r
992 drp_audioBitrate.Items.Add("48");
\r
993 drp_audioBitrate.Items.Add("56");
\r
994 drp_audioBitrate.Items.Add("64");
\r
995 drp_audioBitrate.Items.Add("80");
\r
996 drp_audioBitrate.Items.Add("86");
\r
997 drp_audioBitrate.Items.Add("112");
\r
998 drp_audioBitrate.Items.Add("128");
\r
999 drp_audioBitrate.Items.Add("160");
\r
1004 drp_audioMixDown.Items.Clear();
\r
1005 drp_audioMixDown.Items.Add("Stereo");
\r
1006 drp_audioMixDown.Items.Add("Dolby Surround");
\r
1007 drp_audioMixDown.Items.Add("Dolby Pro Logic II");
\r
1009 drp_audioBitrate.Items.Clear();
\r
1010 drp_audioBitrate.Items.Add("32");
\r
1011 drp_audioBitrate.Items.Add("40");
\r
1012 drp_audioBitrate.Items.Add("48");
\r
1013 drp_audioBitrate.Items.Add("56");
\r
1014 drp_audioBitrate.Items.Add("64");
\r
1015 drp_audioBitrate.Items.Add("80");
\r
1016 drp_audioBitrate.Items.Add("86");
\r
1017 drp_audioBitrate.Items.Add("112");
\r
1018 drp_audioBitrate.Items.Add("128");
\r
1019 drp_audioBitrate.Items.Add("160");
\r
1020 drp_audioBitrate.Items.Add("192");
\r
1021 drp_audioBitrate.Items.Add("224");
\r
1022 drp_audioBitrate.Items.Add("256");
\r
1023 drp_audioBitrate.Items.Add("320");
\r
1024 drp_audioBitrate.Items.Add("384");
\r
1028 private void drp_audioMixDown_SelectedIndexChanged(object sender, EventArgs e)
\r
1030 if (drp_audioCodec.Text == "AAC")
\r
1032 if (drp_audioMixDown.Text == "6 Channel Discrete")
\r
1035 drp_audioBitrate.Items.Clear();
\r
1036 drp_audioBitrate.Items.Add("32");
\r
1037 drp_audioBitrate.Items.Add("40");
\r
1038 drp_audioBitrate.Items.Add("48");
\r
1039 drp_audioBitrate.Items.Add("56");
\r
1040 drp_audioBitrate.Items.Add("64");
\r
1041 drp_audioBitrate.Items.Add("80");
\r
1042 drp_audioBitrate.Items.Add("86");
\r
1043 drp_audioBitrate.Items.Add("112");
\r
1044 drp_audioBitrate.Items.Add("128");
\r
1045 drp_audioBitrate.Items.Add("160");
\r
1046 drp_audioBitrate.Items.Add("192");
\r
1047 drp_audioBitrate.Items.Add("224");
\r
1048 drp_audioBitrate.Items.Add("256");
\r
1049 drp_audioBitrate.Items.Add("320");
\r
1050 drp_audioBitrate.Items.Add("384");
\r
1055 private void Check_ChapterMarkers_CheckedChanged(object sender, EventArgs e)
\r
1057 if (Check_ChapterMarkers.Checked)
\r
1059 string destination = text_destination.Text;
\r
1060 destination = destination.Replace(".mp4", ".m4v");
\r
1061 text_destination.Text = destination;
\r
1065 private void check_largeFile_CheckedChanged(object sender, EventArgs e)
\r
1067 if (!text_destination.Text.Contains(".mp4"))
\r
1069 MessageBox.Show("This option is only compatible with the mp4 file container.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
\r
1070 check_largeFile.CheckState = CheckState.Unchecked;
\r
1074 private void drp_videoEncoder_SelectedIndexChanged(object sender, EventArgs e)
\r
1076 //Turn off some options which are H.264 only when the user selects a non h.264 encoder
\r
1077 if (!drp_videoEncoder.Text.Contains("H.264"))
\r
1079 check_turbo.CheckState = CheckState.Unchecked;
\r
1080 CheckCRF.CheckState = CheckState.Unchecked;
\r
1081 CheckCRF.Enabled = false;
\r
1082 check_turbo.Enabled = false;
\r
1083 h264Tab.Enabled = false;
\r
1087 CheckCRF.Enabled = true;
\r
1088 check_turbo.Enabled = true;
\r
1089 h264Tab.Enabled = true;
\r
1094 public void setStreamReader(Parsing.DVD dvd)
\r
1096 this.thisDVD = dvd;
\r
1099 private void drp_dvdtitle_SelectedIndexChanged(object sender, EventArgs e)
\r
1101 // Reset some values on the form
\r
1102 lbl_Aspect.Text = "Select a Title";
\r
1103 lbl_RecomendedCrop.Text = "Select a Title";
\r
1104 drop_chapterStart.Items.Clear();
\r
1105 drop_chapterFinish.Items.Clear();
\r
1106 QueryEditorText.Text = "";
\r
1108 // If the dropdown is set to automatic nothing else needs to be done.
\r
1109 // Otheriwse if its not, title data has to be loased from parsing.
\r
1110 if (drp_dvdtitle.Text != "Automatic")
\r
1112 Parsing.Title selectedTitle = drp_dvdtitle.SelectedItem as Parsing.Title;
\r
1114 // Set the Aspect Ratio
\r
1115 lbl_Aspect.Text = selectedTitle.AspectRatio.ToString();
\r
1117 // Set the Recommended Cropping values
\r
1118 lbl_RecomendedCrop.Text = string.Format("{0}/{1}/{2}/{3}", selectedTitle.AutoCropDimensions[0], selectedTitle.AutoCropDimensions[1], selectedTitle.AutoCropDimensions[2], selectedTitle.AutoCropDimensions[3]);
\r
1120 // Populate the Start chapter Dropdown
\r
1121 drop_chapterStart.Items.Clear();
\r
1122 drop_chapterStart.Items.AddRange(selectedTitle.Chapters.ToArray());
\r
1123 if (drop_chapterStart.Items.Count > 0)
\r
1125 drop_chapterStart.Text = drop_chapterStart.Items[0].ToString();
\r
1128 // Populate the Final Chapter Dropdown
\r
1129 drop_chapterFinish.Items.Clear();
\r
1130 drop_chapterFinish.Items.AddRange(selectedTitle.Chapters.ToArray());
\r
1131 if (drop_chapterFinish.Items.Count > 0)
\r
1133 drop_chapterFinish.Text = drop_chapterFinish.Items[drop_chapterFinish.Items.Count - 1].ToString();
\r
1136 // Populate the Audio Channels Dropdown
\r
1137 drp_audioChannels.Items.Clear();
\r
1138 drp_audioChannels.Items.Add("Automatic");
\r
1139 drp_audioChannels.Items.AddRange(selectedTitle.AudioTracks.ToArray());
\r
1140 if (drp_audioChannels.Items.Count > 0)
\r
1142 drp_audioChannels.Text = drp_audioChannels.Items[0].ToString();
\r
1145 // Populate the Subtitles dropdown
\r
1146 drp_subtitle.Items.Clear();
\r
1147 drp_subtitle.Items.Add("None");
\r
1148 drp_subtitle.Items.AddRange(selectedTitle.Subtitles.ToArray());
\r
1149 if (drp_subtitle.Items.Count > 0)
\r
1151 drp_subtitle.Text = drp_subtitle.Items[0].ToString();
\r
1161 * ---------------------------------------------------
\r
1163 * The query Generation function.
\r
1165 * ---------------------------------------------------
\r
1168 public string GenerateTheQuery()
\r
1170 string source = text_source.Text;
\r
1171 string dvdTitle = drp_dvdtitle.Text;
\r
1172 string chapterStart = drop_chapterStart.Text;
\r
1173 string chapterFinish = drop_chapterFinish.Text;
\r
1174 int totalChapters = drop_chapterFinish.Items.Count - 1;
\r
1175 string dvdChapter = "";
\r
1178 MessageBox.Show("No Source has been selected.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
\r
1181 source = " -i " + '"' + source+ '"'; //'"'+
\r
1184 if (dvdTitle == "Automatic")
\r
1188 string[] titleInfo = dvdTitle.Split(' ');
\r
1189 dvdTitle = " -t "+ titleInfo[0];
\r
1192 if (chapterFinish.Equals("Auto") && chapterStart.Equals("Auto"))
\r
1194 else if (chapterFinish == chapterStart)
\r
1195 dvdChapter = " -c " + chapterStart;
\r
1197 dvdChapter = " -c " + chapterStart + "-" + chapterFinish;
\r
1199 string querySource = source+ dvdTitle+ dvdChapter;
\r
1200 // ----------------------------------------------------------------------
\r
1204 string destination = text_destination.Text;
\r
1205 string videoEncoder = drp_videoEncoder.Text;
\r
1206 string audioEncoder = drp_audioCodec.Text;
\r
1207 string width = text_width.Text;
\r
1208 string height = text_height.Text;
\r
1210 if (destination == "")
\r
1211 MessageBox.Show("No destination has been selected.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
\r
1213 destination = " -o " + '"' + destination + '"'; //'"'+
\r
1216 switch (videoEncoder)
\r
1219 videoEncoder = " -e ffmpeg";
\r
1222 videoEncoder = " -e xvid";
\r
1225 videoEncoder = " -e x264";
\r
1227 case "H.264 Baseline 1.3":
\r
1228 videoEncoder = " -e x264b13";
\r
1230 case "H.264 (iPod)":
\r
1231 videoEncoder = " -e x264b30";
\r
1234 videoEncoder = " -e x264";
\r
1238 switch (audioEncoder)
\r
1241 audioEncoder = " -E faac";
\r
1244 audioEncoder = " -E lame";
\r
1247 audioEncoder = " -E vorbis";
\r
1250 audioEncoder = " -E ac3";
\r
1253 audioEncoder = " -E faac";
\r
1258 width = " -w "+ width;
\r
1262 height = " -l "+ height;
\r
1265 string queryDestination = destination+ videoEncoder+ audioEncoder+ width+ height;
\r
1266 // ----------------------------------------------------------------------
\r
1268 // Picture Settings Tab
\r
1270 string cropSetting = drp_crop.Text;
\r
1271 string cropTop = text_top.Text;
\r
1272 string cropBottom = text_bottom.Text;
\r
1273 string cropLeft = text_left.Text;
\r
1274 string cropRight = text_right.Text;
\r
1275 string subtitles = drp_subtitle.Text;
\r
1276 string cropOut = "";
\r
1277 string deInterlace_Option = drp_deInterlace_option.Text;
\r
1278 string deinterlace = "";
\r
1279 string grayscale = "";
\r
1280 string pixelRatio = "";
\r
1281 string ChapterMarkers = "";
\r
1282 // Returns Crop Query
\r
1284 if (cropSetting == "Auto Crop")
\r
1286 else if (cropSetting == "No Crop")
\r
1287 cropOut = " --crop 0:0:0:0 ";
\r
1289 cropOut = " --crop " + cropTop + ":" + cropBottom + ":" + cropLeft + ":" + cropRight;
\r
1291 if (subtitles == "None")
\r
1293 else if (subtitles == "")
\r
1298 tempSub = subtitles.Split(' ');
\r
1299 subtitles = " -s "+ tempSub[0];
\r
1302 switch (deInterlace_Option)
\r
1307 case "Origional ( Fast )":
\r
1308 deinterlace = " --deinterlace";
\r
1310 case "yadif ( Slow )":
\r
1311 deinterlace = " --deinterlace=" + '"' + "1" + '"';
\r
1313 case "yadif + mcdeint ( Slower )":
\r
1314 deinterlace = " -d " + '"' + "1:-1:1" + '"';
\r
1316 case "yadif + mcdeint ( Slowest )":
\r
1317 deinterlace = " --deinterlace=" + '"' + "3:-1:2" + '"';
\r
1320 deinterlace = " --deinterlace=";
\r
1324 if (check_grayscale.Checked)
\r
1325 grayscale = " -g ";
\r
1327 if (CheckPixelRatio.Checked)
\r
1328 pixelRatio = " -p ";
\r
1330 if (Check_ChapterMarkers.Checked)
\r
1331 ChapterMarkers = " -m ";
\r
1333 string queryPictureSettings = cropOut + subtitles + deinterlace + grayscale + pixelRatio + ChapterMarkers;
\r
1334 // ----------------------------------------------------------------------
\r
1336 // Video Settings Tab
\r
1338 string videoBitrate = text_bitrate.Text;
\r
1339 string videoFilesize = text_filesize.Text;
\r
1340 int videoQuality = slider_videoQuality.Value;
\r
1341 string vidQSetting = "";
\r
1342 string twoPassEncoding = "";
\r
1343 string videoFramerate = drp_videoFramerate.Text;
\r
1344 string turboH264 = "";
\r
1345 string largeFile = "";
\r
1347 if (videoBitrate != "")
\r
1348 videoBitrate = " -b "+ videoBitrate;
\r
1350 if (videoFilesize != "")
\r
1351 videoFilesize = " -S "+ videoFilesize;
\r
1353 // Video Quality Setting
\r
1355 if ((videoQuality == 0))
\r
1359 videoQuality = videoQuality/ 100;
\r
1360 if (videoQuality == 1)
\r
1362 vidQSetting = "1.0";
\r
1365 vidQSetting = " -q " + videoQuality.ToString();
\r
1368 if (check_2PassEncode.Checked)
\r
1369 twoPassEncoding = " -2 ";
\r
1371 if (videoFramerate == "Automatic")
\r
1372 videoFramerate = "";
\r
1374 videoFramerate = " -r "+ videoFramerate;
\r
1376 if (check_turbo.Checked)
\r
1377 turboH264 = " -T ";
\r
1379 if (check_largeFile.Checked)
\r
1380 largeFile = " -4 ";
\r
1383 * -7, --deblock Deblock video with pp7 filter
\r
1384 * <QP:M> (default 0:2)
\r
1385 * -8, --denoise Denoise video with hqdn3d filter
\r
1386 * <SL:SC:TL:TC> (default 4:3:6:4.5)
\r
1387 * -9, --detelecine Detelecine video with pullup filter
\r
1388 * <L:R:T:B:SB:MP> (default 1:1:4:4:0:0)
\r
1391 string queryVideoSettings = videoBitrate + videoFilesize + vidQSetting + twoPassEncoding + videoFramerate + turboH264 + largeFile;
\r
1392 // ----------------------------------------------------------------------
\r
1394 // Audio Settings Tab
\r
1396 string audioBitrate = drp_audioBitrate.Text;
\r
1397 string audioSampleRate = drp_audioSampleRate.Text;
\r
1398 string audioChannels = drp_audioChannels.Text;
\r
1399 string Mixdown = drp_audioMixDown.Text;
\r
1400 string SixChannelAudio = "";
\r
1402 if (audioBitrate != "")
\r
1403 audioBitrate = " -B "+ audioBitrate;
\r
1405 if (audioSampleRate != "")
\r
1406 audioSampleRate = " -R "+ audioSampleRate;
\r
1408 if (audioChannels == "Automatic")
\r
1409 audioChannels = "";
\r
1410 else if (audioChannels == "")
\r
1411 audioChannels = "";
\r
1415 tempSub = audioChannels.Split(' ');
\r
1416 audioChannels = " -a "+ tempSub[0];
\r
1428 Mixdown = "stereo";
\r
1430 case "Dolby Surround":
\r
1433 case "Dolby Pro Logic II":
\r
1436 case "6 Channel Discrete":
\r
1440 Mixdown = "stero";
\r
1444 if (Mixdown != "")
\r
1445 SixChannelAudio = " -6 "+ Mixdown;
\r
1447 SixChannelAudio = "";
\r
1449 string queryAudioSettings = audioBitrate+ audioSampleRate+ audioChannels+ SixChannelAudio;
\r
1450 // ----------------------------------------------------------------------
\r
1454 string CRF = CheckCRF.CheckState.ToString();
\r
1455 string h264Advanced = rtf_h264advanced.Text;
\r
1461 if ((h264Advanced == ""))
\r
1462 h264Advanced = "";
\r
1464 h264Advanced = " -x "+ h264Advanced;
\r
1467 string h264Settings = CRF+ h264Advanced;
\r
1468 // ----------------------------------------------------------------------
\r
1470 // Processors (Program Settings)
\r
1472 string processors = Properties.Settings.Default.Processors;
\r
1473 // Number of Processors Handler
\r
1475 if (processors == "Automatic")
\r
1478 processors = " -C "+ processors+ " ";
\r
1481 string queryAdvancedSettings = processors;
\r
1482 // ----------------------------------------------------------------------
\r
1484 // Verbose option (Program Settings)
\r
1486 string verbose = "";
\r
1487 if (Properties.Settings.Default.verbose == "Checked")
\r
1490 // ----------------------------------------------------------------------
\r
1492 return querySource+ queryDestination+ queryPictureSettings+ queryVideoSettings+ h264Settings+ queryAudioSettings+ queryAdvancedSettings+ verbose;
\r
1496 // This is the END of the road ------------------------------------------------------------------------------
\r