]> granicus.if.org Git - handbrake/commitdiff
WinGui:
authorsr55 <sr55.hb@outlook.com>
Thu, 26 Jul 2007 19:15:56 +0000 (19:15 +0000)
committersr55 <sr55.hb@outlook.com>
Thu, 26 Jul 2007 19:15:56 +0000 (19:15 +0000)
- Disabled Encode progress on GUI Window. CLI now allowed to appear and standard error is no longer re-directed. (BUG: Standard error causing video distortions when used)
- If scanning a Source fails, the GUI will now attempt to scan the title a 2nd time automatically. Same issue, Standard error causing hbcli to randomly fail.

git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@743 b64f7644-9d1e-0410-96f1-a4d463321fa5

win/C#/frmMain.Designer.cs
win/C#/frmMain.cs

index 30b8af7a0dd43153a1a739b631e2ca1d5ac47464..58c76717586a6228aa7b3c3d3486fd30966edbc7 100644 (file)
@@ -1638,9 +1638,9 @@ namespace Handbrake
             this.btn_queue.FlatStyle = System.Windows.Forms.FlatStyle.Flat;\r
             this.btn_queue.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
             this.btn_queue.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));\r
-            this.btn_queue.Location = new System.Drawing.Point(335, 589);\r
+            this.btn_queue.Location = new System.Drawing.Point(415, 589);\r
             this.btn_queue.Name = "btn_queue";\r
-            this.btn_queue.Size = new System.Drawing.Size(124, 22);\r
+            this.btn_queue.Size = new System.Drawing.Size(115, 22);\r
             this.btn_queue.TabIndex = 416;\r
             this.btn_queue.TabStop = false;\r
             this.btn_queue.Text = "Add to Queue";\r
@@ -1692,13 +1692,14 @@ namespace Handbrake
             this.btn_eCancel.FlatStyle = System.Windows.Forms.FlatStyle.Flat;\r
             this.btn_eCancel.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
             this.btn_eCancel.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));\r
-            this.btn_eCancel.Location = new System.Drawing.Point(465, 589);\r
+            this.btn_eCancel.Location = new System.Drawing.Point(344, 589);\r
             this.btn_eCancel.Name = "btn_eCancel";\r
             this.btn_eCancel.Size = new System.Drawing.Size(65, 22);\r
             this.btn_eCancel.TabIndex = 419;\r
             this.btn_eCancel.TabStop = false;\r
             this.btn_eCancel.Text = "Cancel";\r
             this.btn_eCancel.UseVisualStyleBackColor = false;\r
+            this.btn_eCancel.Visible = false;\r
             this.btn_eCancel.Click += new System.EventHandler(this.btn_eCancel_Click);\r
             // \r
             // frmMain\r
index f2471baad63f736d113892537ed2b14f2b10afec..ddb94b184a300c18a195ee43fa3711aa50da6395 100644 (file)
@@ -548,6 +548,8 @@ namespace Handbrake
             \r
             String filename ="";\r
             text_source.Text = "";\r
+            \r
+            int scanTwice = 0;\r
 \r
             if (RadioDVD.Checked)\r
             {\r
@@ -555,9 +557,9 @@ namespace Handbrake
                 filename = DVD_Open.SelectedPath;\r
                 if (filename != "")\r
                 {\r
+                    Form frmRD = new frmReadDVD(filename, this, dvdInfoWindow);\r
                     text_source.Text = filename;\r
-                    Form frmReadDVD = new frmReadDVD(filename, this, dvdInfoWindow);\r
-                    frmReadDVD.ShowDialog();\r
+                    frmRD.ShowDialog();\r
                 }\r
             }\r
             else\r
@@ -566,18 +568,26 @@ namespace Handbrake
                 filename = ISO_Open.FileName;\r
                 if (filename != "")\r
                 {\r
+                    Form frmRD = new frmReadDVD(filename, this, dvdInfoWindow);\r
                     text_source.Text = filename;\r
-                    Form frmReadDVD = new frmReadDVD(filename, this, dvdInfoWindow);\r
-                    frmReadDVD.ShowDialog();\r
+                    frmRD.ShowDialog();\r
                 }\r
             }  \r
 \r
-            // Quick check to make sure some titles were found.\r
+            // Check if there was titles in the dvd title dropdown\r
+            // If there isn't any, rescan the DVD. hbcli occasionally fails (see bug in encode) with standard error.\r
             if (filename != "")\r
             {\r
-                if (drp_dvdtitle.Items.Count == 0)\r
+                if (drp_dvdtitle.Items.Count == 0) \r
                 {\r
-                    MessageBox.Show("No Title(s) found. Please make sure you have selected a valid, non-copy protected source. Please refer to the FAQ for details..", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);\r
+                    MessageBox.Show(scanTwice.ToString());\r
+                    if (scanTwice == 0)\r
+                    {\r
+                        MessageBox.Show("Scan Failed. Will attempt to scan the source 1 more time.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);\r
+                        Form frmRD = new frmReadDVD(filename, this, dvdInfoWindow);\r
+                        frmRD.ShowDialog();\r
+                        scanTwice = 1;\r
+                    }\r
                 }\r
             }\r
             else\r
@@ -585,6 +595,11 @@ namespace Handbrake
                 text_source.Text = "Click 'Browse' to continue";\r
             }\r
 \r
+            if (drp_dvdtitle.Items.Count == 0)\r
+            {\r
+                MessageBox.Show("No Title(s) found. Please make sure you have selected a valid, non-copy protected source. Please refer to the FAQ for details.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);\r
+           }\r
+\r
         }\r
 \r
         private void btn_destBrowse_Click(object sender, EventArgs e)\r
@@ -665,6 +680,7 @@ namespace Handbrake
             }\r
 \r
             ThreadPool.QueueUserWorkItem(procMonitor, query);\r
+            lbl_encode.Text = "Encoding Started";\r
         }\r
 \r
         private void btn_eCancel_Click(object sender, EventArgs e)\r
@@ -683,22 +699,30 @@ namespace Handbrake
             }\r
             else\r
             {\r
-                hbProc = process.runCli(this, (string)state, true, true, false, true);\r
+                hbProc = process.runCli(this, (string)state, false, false, false, false);\r
 \r
                 MessageBox.Show("The encode process has now started.", "Status", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);\r
 \r
                 try\r
                 {\r
-                    Parsing.Parser encode = new Parsing.Parser(hbProc.StandardError.BaseStream);\r
-                    encode.OnEncodeProgress += encode_OnEncodeProgress;\r
-                    while (!encode.EndOfStream)\r
-                    {\r
-                        encode.ReadLine();\r
-                    }\r
+\r
+                    //*****************************************************************************************\r
+                    // BUG!\r
+                    // When the below code is used and standard error is set to true, hbcli is outputing a\r
+                    // video stream which has mild corruption issues every few seconds.\r
+                    // Maybe an issue with the Parser cauing the CLI to hickup/pause?\r
+                    //*****************************************************************************************\r
+\r
+                    //Parsing.Parser encode = new Parsing.Parser(hbProc.StandardError.BaseStream);\r
+                    //encode.OnEncodeProgress += encode_OnEncodeProgress;\r
+                    //while (!encode.EndOfStream)\r
+                    //{\r
+                    //    encode.ReadLine();\r
+                    //}\r
 \r
                     hbProc.WaitForExit();\r
                     process.closeCLI();\r
-                    hbProc = null;\r
+                    \r
                 }\r
                 catch (Exception)\r
                 {\r
@@ -706,6 +730,7 @@ namespace Handbrake
                 }\r
 \r
                 MessageBox.Show("The encode process has now ended.", "Status", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);\r
+                hbProc = null;\r
             }\r
         }\r
 \r