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
63 public void loadUserDefaults()
\r
67 if (Properties.Settings.Default.defaultSettings == "Checked")
\r
70 text_source.Text = Properties.Settings.Default.DVDSource;
\r
71 drp_dvdtitle.Text = Properties.Settings.Default.DVDTitle;
\r
72 drop_chapterStart.Text = Properties.Settings.Default.ChapterStart;
\r
73 drop_chapterFinish.Text = Properties.Settings.Default.ChapterFinish;
\r
76 text_destination.Text = Properties.Settings.Default.VideoDest;
\r
77 drp_videoEncoder.Text = Properties.Settings.Default.VideoEncoder;
\r
78 drp_audioCodec.Text = Properties.Settings.Default.AudioEncoder;
\r
79 text_width.Text = Properties.Settings.Default.Width;
\r
80 text_height.Text = Properties.Settings.Default.Height;
\r
82 // Picture Settings Tab
\r
83 drp_crop.Text = Properties.Settings.Default.CroppingOption;
\r
84 text_top.Text = Properties.Settings.Default.CropTop;
\r
85 text_bottom.Text = Properties.Settings.Default.CropBottom;
\r
86 text_left.Text = Properties.Settings.Default.CropLeft;
\r
87 text_right.Text = Properties.Settings.Default.CropRight;
\r
88 drp_subtitle.Text = Properties.Settings.Default.Subtitles;
\r
90 // Video Settings Tab
\r
91 text_bitrate.Text = Properties.Settings.Default.VideoBitrate;
\r
92 text_filesize.Text = Properties.Settings.Default.VideoFilesize;
\r
93 slider_videoQuality.Value = Properties.Settings.Default.VideoQuality;
\r
95 if (Properties.Settings.Default.TwoPass == "Checked")
\r
97 check_2PassEncode.CheckState = CheckState.Checked;
\r
100 drp_deInterlace_option.Text = Properties.Settings.Default.DeInterlace;
\r
101 drp_deNoise.Text = Properties.Settings.Default.denoise;
\r
103 if (Properties.Settings.Default.detelecine == "Checked")
\r
105 check_detelecine.CheckState = CheckState.Checked;
\r
108 if (Properties.Settings.Default.detelecine == "Checked")
\r
110 check_deblock.CheckState = CheckState.Checked;
\r
114 if (Properties.Settings.Default.Grayscale == "Checked")
\r
116 check_grayscale.CheckState = CheckState.Checked;
\r
119 drp_videoFramerate.Text = Properties.Settings.Default.Framerate;
\r
121 if (Properties.Settings.Default.PixelRatio == "Checked")
\r
123 CheckPixelRatio.CheckState = CheckState.Checked;
\r
125 if (Properties.Settings.Default.turboFirstPass == "Checked")
\r
127 check_turbo.CheckState = CheckState.Checked;
\r
129 if (Properties.Settings.Default.largeFile == "Checked")
\r
131 check_largeFile.CheckState = CheckState.Checked;
\r
133 // Audio Settings Tab
\r
134 drp_audioBitrate.Text = Properties.Settings.Default.AudioBitrate;
\r
135 drp_audioSampleRate.Text = Properties.Settings.Default.AudioSampleRate;
\r
136 drp_audioChannels.Text = Properties.Settings.Default.AudioChannels;
\r
139 if (Properties.Settings.Default.CRF == "Checked")
\r
141 CheckCRF.CheckState = CheckState.Checked;
\r
143 rtf_h264advanced.Text = Properties.Settings.Default.H264;
\r
148 // No real need to alert the user. Try/Catch only in just incase there is a problem reading the settings xml file.
\r
152 public void updateCheck()
\r
154 if (Properties.Settings.Default.updateStatus == "Checked")
\r
158 String updateFile = Properties.Settings.Default.updateFile;
\r
159 WebClient client = new WebClient();
\r
160 String data = client.DownloadString(updateFile);
\r
161 String[] versionData = data.Split('\n');
\r
163 if ((versionData[0] != Properties.Settings.Default.GuiVersion) || (versionData[1] != Properties.Settings.Default.CliVersion))
\r
165 lbl_update.Visible = true;
\r
170 // Silently ignore the error
\r
175 // --------------------------------------------------------------
\r
176 // The main Menu bar.
\r
177 // --------------------------------------------------------------
\r
181 private void mnu_open_Click(object sender, EventArgs e)
\r
184 File_Open.ShowDialog();
\r
185 filename = File_Open.FileName;
\r
186 if (filename != "")
\r
190 // Create StreamReader & open file
\r
191 StreamReader line = new StreamReader(filename);
\r
192 string temporyLine; // Used for reading the line into a varible before processing on the checkState items below.
\r
194 // Read in the data and set the correct GUI component with the setting.
\r
195 text_source.Text = line.ReadLine();
\r
196 drp_dvdtitle.Text = line.ReadLine();
\r
197 drop_chapterStart.Text = line.ReadLine();
\r
198 drop_chapterFinish.Text = line.ReadLine();
\r
199 text_destination.Text = line.ReadLine();
\r
200 drp_videoEncoder.Text = line.ReadLine();
\r
201 drp_audioCodec.Text = line.ReadLine();
\r
202 text_width.Text = line.ReadLine();
\r
203 text_height.Text = line.ReadLine();
\r
204 text_top.Text = line.ReadLine();
\r
205 text_bottom.Text = line.ReadLine();
\r
206 text_left.Text = line.ReadLine();
\r
207 text_right.Text = line.ReadLine();
\r
208 drp_subtitle.Text = line.ReadLine();
\r
209 text_bitrate.Text = line.ReadLine();
\r
210 text_filesize.Text = line.ReadLine();
\r
211 slider_videoQuality.Value = int.Parse(line.ReadLine());
\r
213 temporyLine = line.ReadLine();
\r
214 if (temporyLine == "Checked")
\r
216 check_2PassEncode.CheckState = CheckState.Checked;
\r
219 drp_deInterlace_option.Text = line.ReadLine();
\r
221 temporyLine = line.ReadLine();
\r
222 if (temporyLine == "Checked")
\r
224 check_grayscale.CheckState = CheckState.Checked;
\r
227 drp_videoFramerate.Text = line.ReadLine();
\r
229 temporyLine = line.ReadLine();
\r
230 if (temporyLine == "Checked")
\r
232 Check_ChapterMarkers.CheckState = CheckState.Checked;
\r
235 temporyLine = line.ReadLine();
\r
236 if (temporyLine == "Checked")
\r
238 CheckPixelRatio.CheckState = CheckState.Checked;
\r
241 temporyLine = line.ReadLine();
\r
242 if (temporyLine == "Checked")
\r
244 check_turbo.CheckState = CheckState.Checked;
\r
247 temporyLine = line.ReadLine();
\r
248 if (temporyLine == "Checked")
\r
250 check_largeFile.CheckState = CheckState.Checked;
\r
253 drp_audioBitrate.Text = line.ReadLine();
\r
254 drp_audioSampleRate.Text = line.ReadLine();
\r
255 drp_audioChannels.Text = line.ReadLine();
\r
256 drp_audioMixDown.Text = line.ReadLine();
\r
258 // Advanced H264 Options
\r
259 temporyLine = line.ReadLine();
\r
260 if (temporyLine == "Checked")
\r
262 CheckCRF.CheckState = CheckState.Checked;
\r
264 rtf_h264advanced.Text = line.ReadLine();
\r
266 // Close the stream
\r
270 // Fix for SliderValue not appearing when Opening saved file
\r
271 SliderValue.Text = slider_videoQuality.Value + "%";
\r
273 } catch (Exception){
\r
274 MessageBox.Show("Unable to load profile.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
\r
279 private void mnu_save_Click(object sender, EventArgs e)
\r
283 File_Save.ShowDialog();
\r
284 filename = File_Save.FileName;
\r
285 if (filename != "")
\r
289 // Create a StreamWriter and open the file
\r
290 StreamWriter line = new StreamWriter(filename);
\r
293 line.WriteLine(text_source.Text);
\r
294 line.WriteLine(drp_dvdtitle.Text);
\r
295 line.WriteLine(drop_chapterStart.Text);
\r
296 line.WriteLine(drop_chapterFinish.Text);
\r
298 line.WriteLine(text_destination.Text);
\r
299 line.WriteLine(drp_videoEncoder.Text);
\r
300 line.WriteLine(drp_audioCodec.Text);
\r
301 line.WriteLine(text_width.Text);
\r
302 line.WriteLine(text_height.Text);
\r
303 //Picture Settings Tab
\r
304 line.WriteLine(text_top.Text);
\r
305 line.WriteLine(text_bottom.Text);
\r
306 line.WriteLine(text_left.Text);
\r
307 line.WriteLine(text_right.Text);
\r
308 line.WriteLine(drp_subtitle.Text);
\r
309 //Video Settings Tab
\r
310 line.WriteLine(text_bitrate.Text);
\r
311 line.WriteLine(text_filesize.Text);
\r
312 line.WriteLine(slider_videoQuality.Value.ToString());
\r
313 line.WriteLine(check_2PassEncode.CheckState.ToString());
\r
314 line.WriteLine(drp_deInterlace_option.Text);
\r
315 line.WriteLine(check_grayscale.CheckState.ToString());
\r
316 line.WriteLine(drp_videoFramerate.Text);
\r
317 line.WriteLine(Check_ChapterMarkers.CheckState.ToString());
\r
318 line.WriteLine(CheckPixelRatio.CheckState.ToString());
\r
319 line.WriteLine(check_turbo.CheckState.ToString());
\r
320 line.WriteLine(check_largeFile.CheckState.ToString());
\r
321 //Audio Settings Tab
\r
322 line.WriteLine(drp_audioBitrate.Text);
\r
323 line.WriteLine(drp_audioSampleRate.Text);
\r
324 line.WriteLine(drp_audioChannels.Text);
\r
325 line.WriteLine(drp_audioMixDown.Text);
\r
327 line.WriteLine(CheckCRF.CheckState.ToString());
\r
328 line.WriteLine(rtf_h264advanced.Text);
\r
329 // close the stream
\r
331 MessageBox.Show("Your profile has been sucessfully saved.", "Status", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
\r
335 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
341 private void mnu_update_Click(object sender, EventArgs e)
\r
343 Form Update = new frmUpdate();
\r
344 Update.ShowDialog();
\r
347 private void mnu_exit_Click(object sender, EventArgs e)
\r
356 private void mnu_encode_Click(object sender, EventArgs e)
\r
362 private void mnu_viewDVDdata_Click(object sender, EventArgs e)
\r
366 dvdInfoWindow.Show();
\r
373 // BUG *******************************************************
\r
374 // Cross-thread operation not valid: Control 'rtf_dvdInfo' accessed from a thread other than the thread it was created on.
\r
375 // This happens when the DVD is scanned and this item is then selected.
\r
376 // 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
377 // NOTE: Try/catch added to prevent final build crashing.
\r
378 // NOTE2: Included a quick fix in frmMain(). Simply show and hide the window when starting the app.
\r
379 // Note3: Suspect the problem lies with line 30.
\r
380 // ***********************************************************
\r
384 private void mnu_options_Click(object sender, EventArgs e)
\r
386 Form Options = new frmOptions();
\r
387 Options.ShowDialog();
\r
392 #region Presets Menu
\r
394 private void mnu_preset_ipod133_Click(object sender, EventArgs e)
\r
396 CheckPixelRatio.CheckState = CheckState.Unchecked;
\r
397 text_width.Text = "640";
\r
398 text_height.Text = "480";
\r
399 drp_videoEncoder.Text = "H.264 (iPod)";
\r
400 text_bitrate.Text = "1000";
\r
401 text_filesize.Text = "";
\r
402 slider_videoQuality.Value = 0;
\r
403 SliderValue.Text = "0%";
\r
404 drp_audioBitrate.Text = "160";
\r
405 rtf_h264advanced.Text = "";
\r
406 drp_crop.Text = "No Crop";
\r
409 private void mnu_preset_ipod178_Click(object sender, EventArgs e)
\r
411 CheckPixelRatio.CheckState = CheckState.Unchecked;
\r
412 text_width.Text = "640";
\r
413 text_height.Text = "352";
\r
414 drp_videoEncoder.Text = "H.264 (iPod)";
\r
415 text_bitrate.Text = "1000";
\r
416 text_filesize.Text = "";
\r
417 slider_videoQuality.Value = 0;
\r
418 SliderValue.Text = "0%";
\r
419 drp_audioBitrate.Text = "160";
\r
420 rtf_h264advanced.Text = "";
\r
421 drp_crop.Text = "No Crop";
\r
424 private void mnu_preset_ipod235_Click(object sender, EventArgs e)
\r
426 CheckPixelRatio.CheckState = CheckState.Unchecked;
\r
427 text_width.Text = "640";
\r
428 text_height.Text = "272";
\r
429 drp_videoEncoder.Text = "H.264 (iPod)";
\r
430 text_bitrate.Text = "1000";
\r
431 text_filesize.Text = "";
\r
432 slider_videoQuality.Value = 0;
\r
433 SliderValue.Text = "0%";
\r
434 drp_audioBitrate.Text = "160";
\r
435 rtf_h264advanced.Text = "";
\r
436 drp_crop.Text = "No Crop";
\r
439 private void mnu_appleTv_Click(object sender, EventArgs e)
\r
441 text_width.Text = "";
\r
442 text_height.Text = "";
\r
443 drp_videoEncoder.Text = "H.264";
\r
444 text_bitrate.Text = "3000";
\r
445 text_filesize.Text = "";
\r
446 slider_videoQuality.Value = 0;
\r
447 SliderValue.Text = "0%";
\r
448 drp_audioBitrate.Text = "160";
\r
449 CheckPixelRatio.CheckState = CheckState.Checked;
\r
450 drp_audioSampleRate.Text = "48";
\r
451 rtf_h264advanced.Text = "bframes=3:ref=1:subme=5:me=umh:no-fast-pskip=1:no-dct-decimate=1:trellis=2";
\r
452 drp_crop.Text = "No Crop";
\r
456 private void mnu_presetPS3_Click(object sender, EventArgs e)
\r
458 CheckPixelRatio.CheckState = CheckState.Unchecked;
\r
459 text_width.Text = "";
\r
460 text_height.Text = "";
\r
461 drp_videoEncoder.Text = "H.264";
\r
462 text_bitrate.Text = "3000";
\r
463 text_filesize.Text = "";
\r
464 slider_videoQuality.Value = 0;
\r
465 SliderValue.Text = "0%";
\r
466 drp_audioBitrate.Text = "160";
\r
467 CheckPixelRatio.CheckState = CheckState.Checked;
\r
468 drp_audioSampleRate.Text = "48";
\r
469 rtf_h264advanced.Text = "level=41";
\r
470 drp_crop.Text = "No Crop";
\r
473 private void mnu_ProgramDefaultOptions_Click(object sender, EventArgs e)
\r
476 Properties.Settings.Default.DVDSource = text_source.Text;
\r
477 Properties.Settings.Default.DVDTitle = drp_dvdtitle.Text;
\r
478 Properties.Settings.Default.ChapterStart = drop_chapterStart.Text;
\r
479 Properties.Settings.Default.ChapterFinish = drop_chapterFinish.Text;
\r
481 Properties.Settings.Default.VideoDest = text_destination.Text;
\r
482 Properties.Settings.Default.VideoEncoder = drp_videoEncoder.Text;
\r
483 Properties.Settings.Default.AudioEncoder = drp_audioCodec.Text;
\r
484 Properties.Settings.Default.Width = text_width.Text;
\r
485 Properties.Settings.Default.Height = text_height.Text;
\r
486 //Picture Settings Tab
\r
487 Properties.Settings.Default.CroppingOption = drp_crop.Text;
\r
488 Properties.Settings.Default.CropTop = text_top.Text;
\r
489 Properties.Settings.Default.CropBottom = text_bottom.Text;
\r
490 Properties.Settings.Default.CropLeft = text_left.Text;
\r
491 Properties.Settings.Default.CropRight = text_right.Text;
\r
492 Properties.Settings.Default.Subtitles = drp_subtitle.Text;
\r
493 //Video Settings Tab
\r
494 Properties.Settings.Default.VideoBitrate = text_bitrate.Text;
\r
495 Properties.Settings.Default.VideoFilesize = text_filesize.Text;
\r
496 Properties.Settings.Default.VideoQuality = slider_videoQuality.Value;
\r
497 Properties.Settings.Default.TwoPass = check_2PassEncode.CheckState.ToString();
\r
498 Properties.Settings.Default.DeInterlace = drp_deInterlace_option.Text;
\r
499 Properties.Settings.Default.Grayscale = check_grayscale.CheckState.ToString();
\r
500 Properties.Settings.Default.Framerate = drp_videoFramerate.Text;
\r
501 Properties.Settings.Default.PixelRatio = CheckPixelRatio.CheckState.ToString();
\r
502 Properties.Settings.Default.turboFirstPass = check_turbo.CheckState.ToString();
\r
503 Properties.Settings.Default.largeFile = check_largeFile.CheckState.ToString();
\r
504 Properties.Settings.Default.detelecine = check_detelecine.CheckState.ToString();
\r
505 Properties.Settings.Default.denoise = drp_deNoise.Text;
\r
506 Properties.Settings.Default.deblock = check_deblock.CheckState.ToString();
\r
507 //Audio Settings Tab
\r
508 Properties.Settings.Default.AudioBitrate = drp_audioBitrate.Text;
\r
509 Properties.Settings.Default.AudioSampleRate = drp_audioSampleRate.Text;
\r
510 Properties.Settings.Default.AudioChannels = drp_audioChannels.Text;
\r
512 Properties.Settings.Default.CRF = CheckCRF.CheckState.ToString();
\r
513 Properties.Settings.Default.H264 = rtf_h264advanced.Text;
\r
514 Properties.Settings.Default.Save();
\r
521 private void mnu_wiki_Click(object sender, EventArgs e)
\r
523 Process.Start("http://handbrake.m0k.org/trac");
\r
526 private void mnu_onlineDocs_Click(object sender, EventArgs e)
\r
528 Process.Start("http://handbrake.m0k.org/?page_id=11");
\r
531 private void mnu_faq_Click(object sender, EventArgs e)
\r
533 Process.Start("http://handbrake.m0k.org/trac/wiki/WindowsGuiFaq");
\r
536 private void mnu_homepage_Click(object sender, EventArgs e)
\r
538 Process.Start("http://handbrake.m0k.org");
\r
541 private void mnu_forum_Click(object sender, EventArgs e)
\r
543 Process.Start("http://handbrake.m0k.org/forum");
\r
546 private void mnu_about_Click(object sender, EventArgs e)
\r
548 Form About = new frmAbout();
\r
549 About.ShowDialog();
\r
554 // --------------------------------------------------------------
\r
555 // Buttons on the main Window
\r
556 // --------------------------------------------------------------
\r
557 private void btn_Browse_Click(object sender, EventArgs e)
\r
560 String filename ="";
\r
561 text_source.Text = "";
\r
563 //int scanTwice = 0;
\r
565 if (RadioDVD.Checked)
\r
567 DVD_Open.ShowDialog();
\r
568 filename = DVD_Open.SelectedPath;
\r
569 if (filename != "")
\r
571 Form frmRD = new frmReadDVD(filename, this, dvdInfoWindow);
\r
572 text_source.Text = filename;
\r
573 frmRD.ShowDialog();
\r
578 ISO_Open.ShowDialog();
\r
579 filename = ISO_Open.FileName;
\r
580 if (filename != "")
\r
582 Form frmRD = new frmReadDVD(filename, this, dvdInfoWindow);
\r
583 text_source.Text = filename;
\r
584 frmRD.ShowDialog();
\r
588 // Check if there was titles in the dvd title dropdown
\r
589 // If there isn't any, rescan the DVD. hbcli occasionally fails (see bug in encode) with standard error.
\r
590 if (filename != "")
\r
592 // Disbaled the 2nd pass for the time being.
\r
593 /* if (drp_dvdtitle.Items.Count == 0)
\r
595 if (scanTwice == 0)
\r
597 MessageBox.Show("Scan Failed. Waiting 5 Seconds before attempting to re-scan the source a 2nd time.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
\r
598 Thread.Sleep(3000);
\r
599 Form frmRD = new frmReadDVD(filename, this, dvdInfoWindow);
\r
600 frmRD.ShowDialog();
\r
607 text_source.Text = "Click 'Browse' to continue";
\r
610 if (drp_dvdtitle.Items.Count == 0)
\r
612 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
617 private void btn_destBrowse_Click(object sender, EventArgs e)
\r
619 // TODO: Need to write some code to check if there is a reasonable amount of disk space left.
\r
621 DVD_Save.ShowDialog();
\r
622 text_destination.Text = DVD_Save.FileName;
\r
624 if (Check_ChapterMarkers.Checked)
\r
626 string destination = text_destination.Text;
\r
627 destination = destination.Replace(".mp4", ".m4v");
\r
628 text_destination.Text = destination;
\r
632 private void btn_h264Clear_Click(object sender, EventArgs e)
\r
634 rtf_h264advanced.Text = "";
\r
637 private void GenerateQuery_Click(object sender, EventArgs e)
\r
639 String query = GenerateTheQuery();
\r
640 QueryEditorText.Text = query;
\r
643 private void btn_ClearQuery_Click(object sender, EventArgs e)
\r
645 QueryEditorText.Text = "";
\r
648 private void btn_queue_Click(object sender, EventArgs e)
\r
650 if (text_destination.Text != "" && text_source.Text != "")
\r
653 if (QueryEditorText.Text == "")
\r
655 query = GenerateTheQuery();
\r
659 query = QueryEditorText.Text;
\r
661 queueWindow.list_queue.Items.Add(query);
\r
662 queueWindow.Show();
\r
666 MessageBox.Show("No Source OR destination selected.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
\r
670 private void showQueue()
\r
672 queueWindow.Show();
\r
679 //---------------------------------------------------
\r
680 // Encode / Cancel Buttons
\r
681 // Encode Progress Text Handler
\r
682 //---------------------------------------------------
\r
684 Functions.CLI process = new Functions.CLI();
\r
686 private void btn_encode_Click(object sender, EventArgs e)
\r
688 btn_eCancel.Enabled = true;
\r
690 lbl_encode.Visible = false;
\r
692 if (QueryEditorText.Text == "")
\r
694 query = GenerateTheQuery();
\r
698 query = QueryEditorText.Text;
\r
701 ThreadPool.QueueUserWorkItem(procMonitor, query);
\r
702 lbl_encode.Text = "Encoding Started";
\r
705 private void btn_eCancel_Click(object sender, EventArgs e)
\r
709 lbl_encode.Text = "Encoding Canceled";
\r
712 private void procMonitor(object state)
\r
714 // Make sure we are not already encoding and if we are then display an error.
\r
715 if (hbProc != null)
\r
717 MessageBox.Show("Handbrake is already encoding a video!", "Status", MessageBoxButtons.OK, MessageBoxIcon.Warning);
\r
721 hbProc = process.runCli(this, (string)state, false, false, false, false);
\r
722 MessageBox.Show("The encode process has now started.", "Status", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
\r
723 hbProc.WaitForExit();
\r
728 //*****************************************************************************************
\r
730 // When the below code is used and standard error is set to true, hbcli is outputing a
\r
731 // video stream which has mild corruption issues every few seconds.
\r
732 // Maybe an issue with the Parser cauing the CLI to hickup/pause?
\r
733 //*****************************************************************************************
\r
736 /*Parsing.Parser encode = new Parsing.Parser(hbProc.StandardError.BaseStream);
\r
737 encode.OnEncodeProgress += encode_OnEncodeProgress;
\r
738 while (!encode.EndOfStream)
\r
743 hbProc.WaitForExit();
\r
744 process.closeCLI();
\r
752 MessageBox.Show("The encode process has now ended.", "Status", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
\r
757 private void encode_OnEncodeProgress(object Sender, int CurrentTask, int TaskCount, float PercentComplete, float CurrentFps, float AverageFps, TimeSpan TimeRemaining)
\r
759 if (this.InvokeRequired)
\r
761 this.BeginInvoke(new Parsing.EncodeProgressEventHandler(encode_OnEncodeProgress),
\r
762 new object[] { Sender, CurrentTask, TaskCount, PercentComplete, CurrentFps, AverageFps, TimeRemaining });
\r
765 lbl_encode.Text = string.Format("Encode Progress: {0}%, FPS: {1}, Avg FPS: {2}, Time Remaining: {3} ", PercentComplete, CurrentFps, AverageFps, TimeRemaining);
\r
768 //---------------------------------------------------
\r
769 // Items that require actions on frmMain
\r
770 //---------------------------------------------------
\r
772 private void drop_chapterStart_SelectedIndexChanged(object sender, EventArgs e)
\r
774 lbl_chptWarn.Visible = false;
\r
775 QueryEditorText.Text = "";
\r
776 if ((drop_chapterFinish.Text != "Auto") && (drop_chapterStart.Text != "Auto"))
\r
780 int chapterFinish = int.Parse(drop_chapterFinish.Text);
\r
781 int chapterStart = int.Parse(drop_chapterStart.Text);
\r
783 if (chapterFinish < chapterStart)
\r
785 lbl_chptWarn.Visible = true;
\r
786 lbl_chptWarn.Text = "Invalid Chapter Range!";
\r
791 lbl_chptWarn.Visible = true;
\r
792 lbl_chptWarn.Text = "Invalid Chapter Range!";
\r
799 private void drop_chapterFinish_SelectedIndexChanged(object sender, EventArgs e)
\r
801 lbl_chptWarn.Visible = false;
\r
802 QueryEditorText.Text = "";
\r
803 if ((drop_chapterFinish.Text != "Auto") && (drop_chapterStart.Text != "Auto"))
\r
807 int chapterFinish = int.Parse(drop_chapterFinish.Text);
\r
808 int chapterStart = int.Parse(drop_chapterStart.Text);
\r
810 if (chapterFinish < chapterStart)
\r
812 lbl_chptWarn.Visible = true;
\r
813 lbl_chptWarn.Text = "Invalid Chapter Range!";
\r
818 lbl_chptWarn.Visible = true;
\r
819 lbl_chptWarn.Text = "Invalid Chapter Range!";
\r
824 private void text_bitrate_TextChanged(object sender, EventArgs e)
\r
826 text_filesize.Text = "";
\r
827 slider_videoQuality.Value = 0;
\r
828 SliderValue.Text = "0%";
\r
829 CheckCRF.CheckState = CheckState.Unchecked;
\r
830 CheckCRF.Enabled = false;
\r
833 private void text_filesize_TextChanged(object sender, EventArgs e)
\r
835 text_bitrate.Text = "";
\r
836 slider_videoQuality.Value = 0;
\r
837 SliderValue.Text = "0%";
\r
838 CheckCRF.CheckState = CheckState.Unchecked;
\r
839 CheckCRF.Enabled = false;
\r
842 private void slider_videoQuality_Scroll(object sender, EventArgs e)
\r
844 SliderValue.Text = slider_videoQuality.Value.ToString() + "%";
\r
845 text_bitrate.Text = "";
\r
846 text_filesize.Text = "";
\r
847 CheckCRF.Enabled = true;
\r
850 private void label_h264_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
\r
852 Process.Start("http://handbrake.m0k.org/trac/wiki/x264Options");
\r
855 private void text_width_TextChanged(object sender, EventArgs e)
\r
860 if (CheckPixelRatio.Checked)
\r
862 text_width.Text = "";
\r
863 text_width.BackColor = Color.White;
\r
867 if ((int.Parse(text_width.Text) % 16) != 0)
\r
869 text_width.BackColor = Color.LightCoral;
\r
873 text_width.BackColor = Color.LightGreen;
\r
877 if (lbl_Aspect.Text != "Select a Title")
\r
879 double height = int.Parse(text_width.Text) / double.Parse(lbl_Aspect.Text);
\r
880 double mod16 = height % 16;
\r
881 height = height - mod16;
\r
883 if (text_width.Text == "")
\r
885 text_height.Text = "";
\r
886 text_width.BackColor = Color.White;
\r
890 text_height.Text = height.ToString();
\r
896 // No need to throw an error here.
\r
902 private void text_height_TextChanged(object sender, EventArgs e)
\r
906 if (CheckPixelRatio.Checked)
\r
908 text_height.Text = "";
\r
909 text_width.BackColor = Color.White;
\r
913 if ((int.Parse(text_height.Text) % 16) != 0)
\r
915 text_height.BackColor = Color.LightCoral;
\r
919 text_height.BackColor = Color.LightGreen;
\r
922 } catch(Exception){
\r
923 // No need to alert the user.
\r
927 private void drp_crop_SelectedIndexChanged(object sender, EventArgs e)
\r
929 if ((string)drp_crop.SelectedItem == "Manual")
\r
931 text_left.Enabled = true;
\r
932 text_right.Enabled = true;
\r
933 text_top.Enabled = true;
\r
934 text_bottom.Enabled = true;
\r
937 if ((string)drp_crop.SelectedItem == "Auto Crop")
\r
939 text_left.Enabled = false;
\r
940 text_right.Enabled = false;
\r
941 text_top.Enabled = false;
\r
942 text_bottom.Enabled = false;
\r
943 text_left.Text = "";
\r
944 text_right.Text = "";
\r
945 text_top.Text = "";
\r
946 text_bottom.Text = "";
\r
948 if (lbl_RecomendedCrop.Text != "Select a Title")
\r
950 string[] temp = new string[4];
\r
951 temp = lbl_RecomendedCrop.Text.Split('/');
\r
952 text_left.Text = temp[2];
\r
953 text_right.Text = temp[3];
\r
954 text_top.Text = temp[0];
\r
955 text_bottom.Text = temp[1];
\r
959 if ((string)drp_crop.SelectedItem == "No Crop")
\r
961 text_left.Enabled = false;
\r
962 text_right.Enabled = false;
\r
963 text_top.Enabled = false;
\r
964 text_bottom.Enabled = false;
\r
965 text_left.Text = "0";
\r
966 text_right.Text = "0";
\r
967 text_top.Text = "0";
\r
968 text_bottom.Text = "0";
\r
973 private void CheckPixelRatio_CheckedChanged(object sender, EventArgs e)
\r
975 text_width.Text = "";
\r
976 text_height.Text = "";
\r
977 text_width.BackColor = Color.White;
\r
978 text_height.BackColor = Color.White;
\r
981 private void drp_dvdtitle_Click(object sender, EventArgs e)
\r
983 if (drp_dvdtitle.Items.Count == 1)
\r
985 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
989 private void drp_audioCodec_SelectedIndexChanged(object sender, EventArgs e)
\r
992 //CLI Audio mixdown Names: mono stereo dpl1 dpl2 6ch
\r
994 drp_audioMixDown.Items.Clear();
\r
996 if (drp_audioCodec.Text == "AAC")
\r
998 drp_audioMixDown.Items.Clear();
\r
999 drp_audioMixDown.Items.Add("Mono");
\r
1000 drp_audioMixDown.Items.Add("Stereo");
\r
1001 drp_audioMixDown.Items.Add("Dolby Surround");
\r
1002 drp_audioMixDown.Items.Add("Dolby Pro Logic II");
\r
1003 drp_audioMixDown.Items.Add("6 Channel Discrete");
\r
1005 drp_audioBitrate.Items.Clear();
\r
1006 drp_audioBitrate.Items.Add("32");
\r
1007 drp_audioBitrate.Items.Add("40");
\r
1008 drp_audioBitrate.Items.Add("48");
\r
1009 drp_audioBitrate.Items.Add("56");
\r
1010 drp_audioBitrate.Items.Add("64");
\r
1011 drp_audioBitrate.Items.Add("80");
\r
1012 drp_audioBitrate.Items.Add("86");
\r
1013 drp_audioBitrate.Items.Add("112");
\r
1014 drp_audioBitrate.Items.Add("128");
\r
1015 drp_audioBitrate.Items.Add("160");
\r
1020 drp_audioMixDown.Items.Clear();
\r
1021 drp_audioMixDown.Items.Add("Stereo");
\r
1022 drp_audioMixDown.Items.Add("Dolby Surround");
\r
1023 drp_audioMixDown.Items.Add("Dolby Pro Logic II");
\r
1025 drp_audioBitrate.Items.Clear();
\r
1026 drp_audioBitrate.Items.Add("32");
\r
1027 drp_audioBitrate.Items.Add("40");
\r
1028 drp_audioBitrate.Items.Add("48");
\r
1029 drp_audioBitrate.Items.Add("56");
\r
1030 drp_audioBitrate.Items.Add("64");
\r
1031 drp_audioBitrate.Items.Add("80");
\r
1032 drp_audioBitrate.Items.Add("86");
\r
1033 drp_audioBitrate.Items.Add("112");
\r
1034 drp_audioBitrate.Items.Add("128");
\r
1035 drp_audioBitrate.Items.Add("160");
\r
1036 drp_audioBitrate.Items.Add("192");
\r
1037 drp_audioBitrate.Items.Add("224");
\r
1038 drp_audioBitrate.Items.Add("256");
\r
1039 drp_audioBitrate.Items.Add("320");
\r
1040 drp_audioBitrate.Items.Add("384");
\r
1044 private void drp_audioMixDown_SelectedIndexChanged(object sender, EventArgs e)
\r
1046 if (drp_audioCodec.Text == "AAC")
\r
1048 if (drp_audioMixDown.Text == "6 Channel Discrete")
\r
1051 drp_audioBitrate.Items.Clear();
\r
1052 drp_audioBitrate.Items.Add("32");
\r
1053 drp_audioBitrate.Items.Add("40");
\r
1054 drp_audioBitrate.Items.Add("48");
\r
1055 drp_audioBitrate.Items.Add("56");
\r
1056 drp_audioBitrate.Items.Add("64");
\r
1057 drp_audioBitrate.Items.Add("80");
\r
1058 drp_audioBitrate.Items.Add("86");
\r
1059 drp_audioBitrate.Items.Add("112");
\r
1060 drp_audioBitrate.Items.Add("128");
\r
1061 drp_audioBitrate.Items.Add("160");
\r
1062 drp_audioBitrate.Items.Add("192");
\r
1063 drp_audioBitrate.Items.Add("224");
\r
1064 drp_audioBitrate.Items.Add("256");
\r
1065 drp_audioBitrate.Items.Add("320");
\r
1066 drp_audioBitrate.Items.Add("384");
\r
1071 private void Check_ChapterMarkers_CheckedChanged(object sender, EventArgs e)
\r
1073 if (Check_ChapterMarkers.Checked)
\r
1075 string destination = text_destination.Text;
\r
1076 destination = destination.Replace(".mp4", ".m4v");
\r
1077 text_destination.Text = destination;
\r
1081 private void check_largeFile_CheckedChanged(object sender, EventArgs e)
\r
1083 if (!text_destination.Text.Contains(".mp4"))
\r
1085 MessageBox.Show("This option is only compatible with the mp4 file container.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
\r
1086 check_largeFile.CheckState = CheckState.Unchecked;
\r
1090 private void drp_videoEncoder_SelectedIndexChanged(object sender, EventArgs e)
\r
1092 //Turn off some options which are H.264 only when the user selects a non h.264 encoder
\r
1093 if (!drp_videoEncoder.Text.Contains("H.264"))
\r
1095 check_turbo.CheckState = CheckState.Unchecked;
\r
1096 CheckCRF.CheckState = CheckState.Unchecked;
\r
1097 CheckCRF.Enabled = false;
\r
1098 check_turbo.Enabled = false;
\r
1099 h264Tab.Enabled = false;
\r
1103 CheckCRF.Enabled = true;
\r
1104 check_turbo.Enabled = true;
\r
1105 h264Tab.Enabled = true;
\r
1110 public void setStreamReader(Parsing.DVD dvd)
\r
1112 this.thisDVD = dvd;
\r
1115 private void drp_dvdtitle_SelectedIndexChanged(object sender, EventArgs e)
\r
1117 // Reset some values on the form
\r
1118 lbl_Aspect.Text = "Select a Title";
\r
1119 lbl_RecomendedCrop.Text = "Select a Title";
\r
1120 drop_chapterStart.Items.Clear();
\r
1121 drop_chapterFinish.Items.Clear();
\r
1122 QueryEditorText.Text = "";
\r
1124 // If the dropdown is set to automatic nothing else needs to be done.
\r
1125 // Otheriwse if its not, title data has to be loased from parsing.
\r
1126 if (drp_dvdtitle.Text != "Automatic")
\r
1128 Parsing.Title selectedTitle = drp_dvdtitle.SelectedItem as Parsing.Title;
\r
1130 // Set the Aspect Ratio
\r
1131 lbl_Aspect.Text = selectedTitle.AspectRatio.ToString();
\r
1133 // Set the Recommended Cropping values
\r
1134 lbl_RecomendedCrop.Text = string.Format("{0}/{1}/{2}/{3}", selectedTitle.AutoCropDimensions[0], selectedTitle.AutoCropDimensions[1], selectedTitle.AutoCropDimensions[2], selectedTitle.AutoCropDimensions[3]);
\r
1136 // Populate the Start chapter Dropdown
\r
1137 drop_chapterStart.Items.Clear();
\r
1138 drop_chapterStart.Items.AddRange(selectedTitle.Chapters.ToArray());
\r
1139 if (drop_chapterStart.Items.Count > 0)
\r
1141 drop_chapterStart.Text = drop_chapterStart.Items[0].ToString();
\r
1144 // Populate the Final Chapter Dropdown
\r
1145 drop_chapterFinish.Items.Clear();
\r
1146 drop_chapterFinish.Items.AddRange(selectedTitle.Chapters.ToArray());
\r
1147 if (drop_chapterFinish.Items.Count > 0)
\r
1149 drop_chapterFinish.Text = drop_chapterFinish.Items[drop_chapterFinish.Items.Count - 1].ToString();
\r
1152 // Populate the Audio Channels Dropdown
\r
1153 drp_audioChannels.Items.Clear();
\r
1154 drp_audioChannels.Items.Add("Automatic");
\r
1155 drp_audioChannels.Items.AddRange(selectedTitle.AudioTracks.ToArray());
\r
1156 if (drp_audioChannels.Items.Count > 0)
\r
1158 drp_audioChannels.Text = drp_audioChannels.Items[0].ToString();
\r
1161 // Populate the Subtitles dropdown
\r
1162 drp_subtitle.Items.Clear();
\r
1163 drp_subtitle.Items.Add("None");
\r
1164 drp_subtitle.Items.AddRange(selectedTitle.Subtitles.ToArray());
\r
1165 if (drp_subtitle.Items.Count > 0)
\r
1167 drp_subtitle.Text = drp_subtitle.Items[0].ToString();
\r
1177 * ---------------------------------------------------
\r
1179 * The query Generation function.
\r
1181 * ---------------------------------------------------
\r
1184 public string GenerateTheQuery()
\r
1186 string source = text_source.Text;
\r
1187 string dvdTitle = drp_dvdtitle.Text;
\r
1188 string chapterStart = drop_chapterStart.Text;
\r
1189 string chapterFinish = drop_chapterFinish.Text;
\r
1190 int totalChapters = drop_chapterFinish.Items.Count - 1;
\r
1191 string dvdChapter = "";
\r
1194 MessageBox.Show("No Source has been selected.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
\r
1197 source = " -i " + '"' + source+ '"'; //'"'+
\r
1200 if (dvdTitle == "Automatic")
\r
1204 string[] titleInfo = dvdTitle.Split(' ');
\r
1205 dvdTitle = " -t "+ titleInfo[0];
\r
1208 if (chapterFinish.Equals("Auto") && chapterStart.Equals("Auto"))
\r
1210 else if (chapterFinish == chapterStart)
\r
1211 dvdChapter = " -c " + chapterStart;
\r
1213 dvdChapter = " -c " + chapterStart + "-" + chapterFinish;
\r
1215 string querySource = source+ dvdTitle+ dvdChapter;
\r
1216 // ----------------------------------------------------------------------
\r
1220 string destination = text_destination.Text;
\r
1221 string videoEncoder = drp_videoEncoder.Text;
\r
1222 string audioEncoder = drp_audioCodec.Text;
\r
1223 string width = text_width.Text;
\r
1224 string height = text_height.Text;
\r
1226 if (destination == "")
\r
1227 MessageBox.Show("No destination has been selected.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
\r
1229 destination = " -o " + '"' + destination + '"'; //'"'+
\r
1232 switch (videoEncoder)
\r
1235 videoEncoder = " -e ffmpeg";
\r
1238 videoEncoder = " -e xvid";
\r
1241 videoEncoder = " -e x264";
\r
1243 case "H.264 Baseline 1.3":
\r
1244 videoEncoder = " -e x264b13";
\r
1246 case "H.264 (iPod)":
\r
1247 videoEncoder = " -e x264b30";
\r
1250 videoEncoder = " -e x264";
\r
1254 switch (audioEncoder)
\r
1257 audioEncoder = " -E faac";
\r
1260 audioEncoder = " -E lame";
\r
1263 audioEncoder = " -E vorbis";
\r
1266 audioEncoder = " -E ac3";
\r
1269 audioEncoder = " -E faac";
\r
1274 width = " -w "+ width;
\r
1278 height = " -l "+ height;
\r
1281 string queryDestination = destination+ videoEncoder+ audioEncoder+ width+ height;
\r
1282 // ----------------------------------------------------------------------
\r
1284 // Picture Settings Tab
\r
1286 string cropSetting = drp_crop.Text;
\r
1287 string cropTop = text_top.Text;
\r
1288 string cropBottom = text_bottom.Text;
\r
1289 string cropLeft = text_left.Text;
\r
1290 string cropRight = text_right.Text;
\r
1291 string subtitles = drp_subtitle.Text;
\r
1292 string cropOut = "";
\r
1293 string deInterlace_Option = drp_deInterlace_option.Text;
\r
1294 string deinterlace = "";
\r
1295 string grayscale = "";
\r
1296 string pixelRatio = "";
\r
1297 string ChapterMarkers = "";
\r
1298 // Returns Crop Query
\r
1300 if (cropSetting == "Auto Crop")
\r
1302 else if (cropSetting == "No Crop")
\r
1303 cropOut = " --crop 0:0:0:0 ";
\r
1305 cropOut = " --crop " + cropTop + ":" + cropBottom + ":" + cropLeft + ":" + cropRight;
\r
1307 if (subtitles == "None")
\r
1309 else if (subtitles == "")
\r
1314 tempSub = subtitles.Split(' ');
\r
1315 subtitles = " -s "+ tempSub[0];
\r
1318 switch (deInterlace_Option)
\r
1323 case "Origional (Fast)":
\r
1324 deinterlace = " --deinterlace";
\r
1326 case "yadif (Slow)":
\r
1327 deinterlace = " --deinterlace=" + '"' + "1" + '"';
\r
1329 case "yadif + mcdeint (Slower)":
\r
1330 deinterlace = " --deinterlace=" + '"' + "1:-1:1" + '"';
\r
1332 case "yadif + mcdeint (Slowest)":
\r
1333 deinterlace = " --deinterlace=" + '"' + "3:-1:2" + '"';
\r
1336 deinterlace = " --deinterlace=";
\r
1340 if (check_grayscale.Checked)
\r
1341 grayscale = " -g ";
\r
1343 if (CheckPixelRatio.Checked)
\r
1344 pixelRatio = " -p ";
\r
1346 if (Check_ChapterMarkers.Checked)
\r
1347 ChapterMarkers = " -m ";
\r
1349 string queryPictureSettings = cropOut + subtitles + deinterlace + grayscale + pixelRatio + ChapterMarkers;
\r
1350 // ----------------------------------------------------------------------
\r
1352 // Video Settings Tab
\r
1354 string videoBitrate = text_bitrate.Text;
\r
1355 string videoFilesize = text_filesize.Text;
\r
1356 int videoQuality = slider_videoQuality.Value;
\r
1357 string vidQSetting = "";
\r
1358 string twoPassEncoding = "";
\r
1359 string videoFramerate = drp_videoFramerate.Text;
\r
1360 string turboH264 = "";
\r
1361 string largeFile = "";
\r
1362 string deblock = "";
\r
1363 string detelecine = "";
\r
1364 string denoise = "";
\r
1366 if (videoBitrate != "")
\r
1367 videoBitrate = " -b "+ videoBitrate;
\r
1369 if (videoFilesize != "")
\r
1370 videoFilesize = " -S "+ videoFilesize;
\r
1372 // Video Quality Setting
\r
1374 if ((videoQuality == 0))
\r
1378 videoQuality = videoQuality/ 100;
\r
1379 if (videoQuality == 1)
\r
1381 vidQSetting = "1.0";
\r
1384 vidQSetting = " -q " + videoQuality.ToString();
\r
1387 if (check_2PassEncode.Checked)
\r
1388 twoPassEncoding = " -2 ";
\r
1390 if (videoFramerate == "Automatic")
\r
1391 videoFramerate = "";
\r
1393 videoFramerate = " -r "+ videoFramerate;
\r
1395 if (check_turbo.Checked)
\r
1396 turboH264 = " -T ";
\r
1398 if (check_largeFile.Checked)
\r
1399 largeFile = " -4 ";
\r
1401 if (check_deblock.Checked)
\r
1402 deblock = " --deblock";
\r
1404 if (check_detelecine.Checked)
\r
1405 detelecine = " --detelecine";
\r
1407 switch (drp_deNoise.Text)
\r
1413 denoise = " --denoise=3:2:3:3";
\r
1416 denoise = " --denoise=7:7:5:5";
\r
1423 string queryVideoSettings = videoBitrate + videoFilesize + vidQSetting + twoPassEncoding + videoFramerate + turboH264 + largeFile + deblock + detelecine + denoise;
\r
1424 // ----------------------------------------------------------------------
\r
1426 // Audio Settings Tab
\r
1428 string audioBitrate = drp_audioBitrate.Text;
\r
1429 string audioSampleRate = drp_audioSampleRate.Text;
\r
1430 string audioChannels = drp_audioChannels.Text;
\r
1431 string Mixdown = drp_audioMixDown.Text;
\r
1432 string SixChannelAudio = "";
\r
1434 if (audioBitrate != "")
\r
1435 audioBitrate = " -B "+ audioBitrate;
\r
1437 if (audioSampleRate != "")
\r
1438 audioSampleRate = " -R "+ audioSampleRate;
\r
1440 if (audioChannels == "Automatic")
\r
1441 audioChannels = "";
\r
1442 else if (audioChannels == "")
\r
1443 audioChannels = "";
\r
1447 tempSub = audioChannels.Split(' ');
\r
1448 audioChannels = " -a "+ tempSub[0];
\r
1460 Mixdown = "stereo";
\r
1462 case "Dolby Surround":
\r
1465 case "Dolby Pro Logic II":
\r
1468 case "6 Channel Discrete":
\r
1472 Mixdown = "stero";
\r
1476 if (Mixdown != "")
\r
1477 SixChannelAudio = " -6 "+ Mixdown;
\r
1479 SixChannelAudio = "";
\r
1481 string queryAudioSettings = audioBitrate+ audioSampleRate+ audioChannels+ SixChannelAudio;
\r
1482 // ----------------------------------------------------------------------
\r
1486 string CRF = CheckCRF.CheckState.ToString();
\r
1487 string h264Advanced = rtf_h264advanced.Text;
\r
1493 if ((h264Advanced == ""))
\r
1494 h264Advanced = "";
\r
1496 h264Advanced = " -x "+ h264Advanced;
\r
1499 string h264Settings = CRF+ h264Advanced;
\r
1500 // ----------------------------------------------------------------------
\r
1502 // Processors (Program Settings)
\r
1504 string processors = Properties.Settings.Default.Processors;
\r
1505 // Number of Processors Handler
\r
1507 if (processors == "Automatic")
\r
1510 processors = " -C "+ processors+ " ";
\r
1513 string queryAdvancedSettings = processors;
\r
1514 // ----------------------------------------------------------------------
\r
1516 // Verbose option (Program Settings)
\r
1518 string verbose = "";
\r
1519 if (Properties.Settings.Default.verbose == "Checked")
\r
1522 // ----------------------------------------------------------------------
\r
1524 return querySource+ queryDestination+ queryPictureSettings+ queryVideoSettings+ h264Settings+ queryAudioSettings+ queryAdvancedSettings+ verbose;
\r
1527 // This is the END of the road ------------------------------------------------------------------------------
\r