OSDN Git Service

WinGui:
authorsr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Mon, 30 Jul 2007 17:46:01 +0000 (17:46 +0000)
committersr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Mon, 30 Jul 2007 17:46:01 +0000 (17:46 +0000)
- Initial tempory workaround for the hbcli issue with the parser.

git-svn-id: svn://localhost/HandBrake/trunk@762 b64f7644-9d1e-0410-96f1-a4d463321fa5

win/C#/HandBrakeCS.csproj
win/C#/Properties/Resources.resx
win/C#/Resources/splash.jpg [new file with mode: 0644]
win/C#/frmDvdInfo.cs
win/C#/frmMain.cs
win/C#/frmReadDVD.cs

index 50121cb..b4da2a3 100644 (file)
   <ItemGroup>\r
     <Content Include="handbrakepineapple.ico" />\r
     <None Include="Resources\tempSplash.jpg" />\r
-    <None Include="splash.jpg" />\r
+    <None Include="Resources\splash.jpg" />\r
   </ItemGroup>\r
   <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />\r
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
index 98a6225..e079a0a 100644 (file)
   </resheader>\r
   <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />\r
   <data name="splash" type="System.Resources.ResXFileRef, System.Windows.Forms">\r
-    <value>..\splash.jpg;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>\r
+    <value>..\Resources\splash.jpg;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>\r
   </data>\r
   <data name="tempSplash" type="System.Resources.ResXFileRef, System.Windows.Forms">\r
     <value>..\Resources\tempSplash.jpg;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>\r
diff --git a/win/C#/Resources/splash.jpg b/win/C#/Resources/splash.jpg
new file mode 100644 (file)
index 0000000..b930b77
Binary files /dev/null and b/win/C#/Resources/splash.jpg differ
index 06ca599..9e798ea 100644 (file)
@@ -40,5 +40,6 @@ namespace Handbrake
             this.Hide();\r
             base.OnClosing(e);\r
         }\r
+\r
     }\r
 }
\ No newline at end of file
index bcd0ef9..39d29ca 100644 (file)
@@ -549,7 +549,7 @@ namespace Handbrake
             String filename ="";\r
             text_source.Text = "";\r
             \r
-            int scanTwice = 0;\r
+            //int scanTwice = 0;\r
 \r
             if (RadioDVD.Checked)\r
             {\r
@@ -578,7 +578,8 @@ namespace Handbrake
             // 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
+               // Disbaled the 2nd pass for the time being.\r
+               /* if (drp_dvdtitle.Items.Count == 0) \r
                 {\r
                     if (scanTwice == 0)\r
                     {\r
@@ -588,7 +589,7 @@ namespace Handbrake
                         frmRD.ShowDialog();\r
                         scanTwice = 1;\r
                     }\r
-                }\r
+                }*/\r
             }\r
             else\r
             {\r
@@ -597,7 +598,7 @@ namespace Handbrake
 \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("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
            }\r
 \r
         }\r
@@ -699,7 +700,7 @@ namespace Handbrake
             }\r
             else\r
             {\r
-                hbProc = process.runCli(this, (string)state, false, false, false, false);\r
+                hbProc = process.runCli(this, (string)state, true, true, false, false);\r
 \r
                 MessageBox.Show("The encode process has now started.", "Status", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);\r
 \r
@@ -713,17 +714,17 @@ namespace Handbrake
                     // Maybe an issue with the Parser cauing the CLI to hickup/pause?\r
                     //*****************************************************************************************\r
 \r
-                    /*\r
-                    Parsing.Parser encode = new Parsing.Parser(hbProc.StandardError.BaseStream);\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
                     hbProc.WaitForExit();\r
                     process.closeCLI();\r
-                    \r
+                    */\r
                 }\r
                 catch (Exception)\r
                 {\r
index 0a71088..92c3a47 100644 (file)
@@ -61,18 +61,40 @@ namespace Handbrake
         Functions.CLI process = new Functions.CLI();\r
         private void startProc(object state)\r
         {\r
-            string query = "-i " + '"' + inputFile + '"' + " -t0";\r
-          \r
-            \r
-            hbProc = process.runCli(this, query, true, true, false, true);\r
+            //string query = "-i " + '"' + inputFile + '"' + " -t0";\r
+            // hbProc = process.runCli(this, query, true, true, false, true);\r
+\r
+            //*********************************************************************************************************************************************\r
+            /*\r
+             * Quick and Dirty hack to get around the stderr crashes of hbcli. Lets try feeding brians parser text straight from a text file.\r
+             */\r
+            string appPath = Application.StartupPath.ToString();\r
+            appPath = appPath + "\\";\r
+            string strCmdLine = "cmd /c " + '"' + '"' + appPath + "\\hbcli.exe" + '"' +  " -i" + '"' + inputFile + '"' + " -t0 >" + '"'+ appPath + "\\dvdinfo.dat" + '"' + " 2>&1" + '"';\r
+            Process hbproc = Process.Start("CMD.exe", strCmdLine);\r
+            hbproc.WaitForExit();\r
+\r
+\r
+            StreamReader sr = new StreamReader(appPath + "dvdinfo.dat");\r
+    \r
+            thisDvd = Parsing.DVD.Parse(sr);\r
 \r
+            sr.Close();\r
+            Console.ReadLine();\r
+            updateUIElements();\r
+            //*********************************************************************************************************************************************\r
+\r
+            /*\r
+             * This has been temporily disabled due to the stderr issue\r
+             * \r
+             * \r
             Parsing.Parser readData = new Parsing.Parser(hbProc.StandardError.BaseStream);\r
             readData.OnScanProgress += Parser_OnScanProgress;\r
             readData.OnReadLine += dvdInfo.HandleParsedData;\r
             readData.OnReadToEnd += dvdInfo.HandleParsedData;\r
 \r
             // Setup the parser\r
-            thisDvd = Parsing.DVD.Parse(readData);\r
+            \r
 \r
             if (cancel != 1)\r
             {\r
@@ -80,6 +102,7 @@ namespace Handbrake
                 process.killCLI();\r
                 process.closeCLI();\r
             }\r
+            */\r
         }\r
 \r
         private void Parser_OnScanProgress(object Sender, int CurrentTitle, int TitleCount)\r
@@ -99,10 +122,9 @@ namespace Handbrake
 \r
         private void btn_skip_Click(object sender, EventArgs e)\r
         {\r
-            process.killCLI();\r
+            //process.killCLI();\r
             this.Close();\r
-            cancel = 1;\r
-            \r
+            cancel = 1;  \r
         }\r
 \r
     }\r