OSDN Git Service

WinGui:
authorsr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sat, 25 Aug 2007 20:34:42 +0000 (20:34 +0000)
committersr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sat, 25 Aug 2007 20:34:42 +0000 (20:34 +0000)
- PSP Preset Fix
- Cleaned up Exception handling a bit.

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

win/C#/HandBrakeCS.csproj
win/C#/Parsing/DVD.cs
win/C#/Parsing/Parser.cs
win/C#/Parsing/Title.cs
win/C#/Properties/AssemblyInfo.cs
win/C#/frmMain.cs
win/C#/frmReadDVD.cs

index 1c5a64b..33ad098 100644 (file)
     <AssemblyName>Handbrake</AssemblyName>\r
     <ApplicationIcon>handbrakepineapple.ico</ApplicationIcon>\r
     <StartupObject>Handbrake.Program</StartupObject>\r
+    <TargetZone>LocalIntranet</TargetZone>\r
+    <GenerateManifests>false</GenerateManifests>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
-    <Optimize>false</Optimize>\r
+    <Optimize>true</Optimize>\r
     <OutputPath>bin\Debug\</OutputPath>\r
     <DefineConstants>DEBUG;TRACE</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
+    <LangVersion>default</LangVersion>\r
+    <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>\r
+    <NoStdLib>false</NoStdLib>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
     <DebugType>pdbonly</DebugType>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <Content Include="handbrakepineapple.ico" />\r
+    <BaseApplicationManifest Include="Properties\app.manifest" />\r
     <None Include="Resources\Remove.png" />\r
     <None Include="Resources\Movies.png" />\r
     <None Include="Resources\info.png" />\r
index d2d2115..62a40d8 100644 (file)
@@ -42,18 +42,24 @@ namespace Handbrake.Parsing
         public static DVD Parse(StreamReader output)\r
         {\r
             DVD thisDVD = new DVD();\r
-            while (!output.EndOfStream)\r
+            try\r
             {\r
-                if ((char)output.Peek() == '+')\r
+                while (!output.EndOfStream)\r
                 {\r
-                    string testb = output.ReadToEnd();\r
-                    thisDVD.m_titles.AddRange(Title.ParseList(testb));\r
-                }\r
-                else\r
-                {\r
-                    output.ReadLine();\r
+                    if ((char)output.Peek() == '+')\r
+                    {\r
+                        thisDVD.m_titles.AddRange(Title.ParseList(output.ReadToEnd()));\r
+                    }\r
+                    else\r
+                    {\r
+                        output.ReadLine();\r
+                    }\r
                 }\r
             }\r
+            catch (Exception exc)\r
+            {\r
+                MessageBox.Show("DVD.CS - Parse" + exc.ToString());\r
+            }\r
             return thisDVD;\r
         }\r
     }\r
index f56999a..ea2ae57 100644 (file)
@@ -3,6 +3,7 @@ using System.Collections.Generic;
 using System.Text;\r
 using System.IO;\r
 using System.Text.RegularExpressions;\r
+using System.Windows.Forms;\r
 \r
 namespace Handbrake.Parsing\r
 {\r
@@ -79,30 +80,38 @@ namespace Handbrake.Parsing
         public override string ReadLine()\r
         {\r
             string tmp = base.ReadLine();\r
-            this.m_buffer += tmp;\r
-            Match m = Regex.Match(tmp, "^Scanning title ([0-9]*) of ([0-9]*)");\r
-            if (OnReadLine != null)\r
+            try\r
             {\r
-                OnReadLine(this, tmp);\r
-            }\r
-            if (m.Success && OnScanProgress != null)\r
-            {\r
-                OnScanProgress(this, int.Parse(m.Groups[1].Value), int.Parse(m.Groups[2].Value));\r
-            }\r
-            m = Regex.Match(tmp, @"^Encoding: task ([0-9]*) of ([0-9]*), ([0-9]*\.[0-9]*) %( \(([0-9]*\.[0-9]*) fps, avg ([0-9]*\.[0-9]*) fps, ETA ([0-9]{2})h([0-9]{2})m([0-9]{2})s\))?");\r
-            if (m.Success && OnEncodeProgress != null)\r
-            {\r
-                int currentTask = int.Parse(m.Groups[1].Value);\r
-                int totalTasks = int.Parse(m.Groups[2].Value);\r
-                float percent = float.Parse(m.Groups[3].Value);\r
-                float currentFps = m.Groups[5].Value == string.Empty ? 0.0F : float.Parse(m.Groups[5].Value);\r
-                float avgFps = m.Groups[6].Value == string.Empty ? 0.0F : float.Parse(m.Groups[6].Value);\r
-                TimeSpan remaining = TimeSpan.Zero;\r
-                if (m.Groups[7].Value != string.Empty)\r
+                \r
+                this.m_buffer += tmp;\r
+                Match m = Regex.Match(tmp, "^Scanning title ([0-9]*) of ([0-9]*)");\r
+                if (OnReadLine != null)\r
+                {\r
+                    OnReadLine(this, tmp);\r
+                }\r
+                if (m.Success && OnScanProgress != null)\r
+                {\r
+                    OnScanProgress(this, int.Parse(m.Groups[1].Value), int.Parse(m.Groups[2].Value));\r
+                }\r
+                m = Regex.Match(tmp, @"^Encoding: task ([0-9]*) of ([0-9]*), ([0-9]*\.[0-9]*) %( \(([0-9]*\.[0-9]*) fps, avg ([0-9]*\.[0-9]*) fps, ETA ([0-9]{2})h([0-9]{2})m([0-9]{2})s\))?");\r
+                if (m.Success && OnEncodeProgress != null)\r
                 {\r
-                    remaining = TimeSpan.Parse(m.Groups[7].Value + ":" + m.Groups[8].Value + ":" + m.Groups[9].Value);\r
+                    int currentTask = int.Parse(m.Groups[1].Value);\r
+                    int totalTasks = int.Parse(m.Groups[2].Value);\r
+                    float percent = float.Parse(m.Groups[3].Value);\r
+                    float currentFps = m.Groups[5].Value == string.Empty ? 0.0F : float.Parse(m.Groups[5].Value);\r
+                    float avgFps = m.Groups[6].Value == string.Empty ? 0.0F : float.Parse(m.Groups[6].Value);\r
+                    TimeSpan remaining = TimeSpan.Zero;\r
+                    if (m.Groups[7].Value != string.Empty)\r
+                    {\r
+                        remaining = TimeSpan.Parse(m.Groups[7].Value + ":" + m.Groups[8].Value + ":" + m.Groups[9].Value);\r
+                    }\r
+                    OnEncodeProgress(this, currentTask, totalTasks, percent, currentFps, avgFps, remaining);\r
                 }\r
-                OnEncodeProgress(this, currentTask, totalTasks, percent, currentFps, avgFps, remaining);\r
+            }\r
+            catch (Exception exc)\r
+            {\r
+                MessageBox.Show("Parser.cs - ReadLine " + exc.ToString());\r
             }\r
             return tmp;\r
         }\r
@@ -110,10 +119,18 @@ namespace Handbrake.Parsing
         public override string ReadToEnd()\r
         {\r
             string tmp = base.ReadToEnd();\r
-            this.m_buffer += tmp;\r
-            if (OnReadToEnd != null)\r
+            try\r
+            {\r
+                \r
+                this.m_buffer += tmp;\r
+                if (OnReadToEnd != null)\r
+                {\r
+                    OnReadToEnd(this, tmp);\r
+                }\r
+            }\r
+            catch (Exception exc)\r
             {\r
-                OnReadToEnd(this, tmp);\r
+                MessageBox.Show("Parser.cs - ReadToEnd " + exc.ToString());\r
             }\r
             return tmp;\r
         }\r
index a78fef7..3c3aaca 100644 (file)
@@ -137,11 +137,9 @@ namespace Handbrake.Parsing
         public static Title Parse(StringReader output)\r
         {\r
             Title thisTitle = new Title();\r
-\r
-            // Match track number for this title\r
             try\r
             {\r
-\r
+                // Match track number for this title\r
                 Match m = Regex.Match(output.ReadLine(), @"^\+ title ([0-9]*):");\r
                 if (m.Success)\r
                 {\r
@@ -150,20 +148,21 @@ namespace Handbrake.Parsing
                 output.ReadLine();\r
 \r
                 // Get duration for this title\r
+\r
                 m = Regex.Match(output.ReadLine(), @"^  \+ duration: ([0-9]{2}:[0-9]{2}:[0-9]{2})");\r
                 if (m.Success)\r
                 {\r
                     thisTitle.m_duration = TimeSpan.Parse(m.Groups[1].Value);\r
                 }\r
 \r
+\r
                 // Get resolution, aspect ratio and FPS for this title\r
                 m = Regex.Match(output.ReadLine(), @"^  \+ size: ([0-9]*)x([0-9]*), aspect: ([0-9]*\.[0-9]*), ([0-9]*\.[0-9]*) fps");\r
                 if (m.Success)\r
                 {\r
                     thisTitle.m_resolution = new Size(int.Parse(m.Groups[1].Value), int.Parse(m.Groups[2].Value));\r
-                    thisTitle.m_aspectRatio = m.Groups[3].ToString(); // Converted to a String for French Lanuage based systems. Some weird exception thrown\r
-                                                                      // when trying to parse it as a float\r
-                    // we don't need FPS right now\r
+                    thisTitle.m_aspectRatio = m.Groups[3].ToString(); // Converted to a String from float. Caused issue on french systems\r
+                                                                      // French system floats are 1,78 not 1.78 and the CLI always outputs a . \r
                 }\r
 \r
                 // Get autocrop region for this title\r
@@ -179,18 +178,27 @@ namespace Handbrake.Parsing
             }\r
             catch (Exception exc)\r
             {\r
-                MessageBox.Show(exc.ToString());\r
+                MessageBox.Show("Title.cs - Parse " + exc.ToString());\r
             }\r
+     \r
+        \r
             return thisTitle;\r
         }\r
 \r
         public static Title[] ParseList(string output)\r
         {\r
             List<Title> titles = new List<Title>();\r
-            StringReader sr = new StringReader(output);\r
-            while ((char)sr.Peek() == '+')\r
+            try\r
+            {\r
+                StringReader sr = new StringReader(output);\r
+                while ((char)sr.Peek() == '+')\r
+                {\r
+                    titles.Add(Title.Parse(sr));\r
+                }\r
+            }\r
+            catch (Exception exc)\r
             {\r
-                titles.Add(Title.Parse(sr));\r
+                MessageBox.Show("Title.cs - ParseList " + exc.ToString());\r
             }\r
             return titles.ToArray();\r
         }\r
index a375c64..6af0e19 100644 (file)
@@ -1,14 +1,15 @@
 using System.Reflection;\r
 using System.Runtime.CompilerServices;\r
 using System.Runtime.InteropServices;\r
+using System.Resources;\r
 \r
 // General Information about an assembly is controlled through the following \r
 // set of attributes. Change these attribute values to modify the information\r
 // associated with an assembly.\r
 [assembly: AssemblyTitle("Handbrake")]\r
-[assembly: AssemblyDescription("")]\r
+[assembly: AssemblyDescription("DVD to MPEG-4 converter")]\r
 [assembly: AssemblyConfiguration("")]\r
-[assembly: AssemblyCompany("")]\r
+[assembly: AssemblyCompany("Handbrake")]\r
 [assembly: AssemblyProduct("Handbrake")]\r
 [assembly: AssemblyCopyright("Copyright ©  2007")]\r
 [assembly: AssemblyTrademark("")]\r
@@ -29,5 +30,6 @@ using System.Runtime.InteropServices;
 //      Build Number\r
 //      Revision\r
 //\r
-[assembly: AssemblyVersion("2.4.0.0")]\r
-[assembly: AssemblyFileVersion("20.4.0.0")]\r
+[assembly: AssemblyVersion("2.4.0.1")]\r
+[assembly: AssemblyFileVersion("2.4.0.1")]\r
+[assembly: NeutralResourcesLanguageAttribute("en-GB")]\r
index 30360a6..e84ccc6 100644 (file)
@@ -752,7 +752,7 @@ namespace Handbrake
             CheckPixelRatio.CheckState = CheckState.Unchecked;\r
             text_width.Text = "368";\r
             text_height.Text = "208";\r
-            drp_videoEncoder.Text = "H.264";\r
+            drp_videoEncoder.Text = "Mpeg 4";\r
             text_bitrate.Text = "1024";\r
             text_filesize.Text = "";\r
             slider_videoQuality.Value = 0;\r
index caef654..526e9bd 100644 (file)
@@ -46,7 +46,7 @@ namespace Handbrake
             }\r
             catch(Exception exc)\r
             {\r
-                MessageBox.Show(exc.ToString());\r
+                MessageBox.Show("frmReadDVD.cs - btn_ok_Click " + exc.ToString());\r
             }\r
         }\r
      \r
@@ -69,7 +69,7 @@ namespace Handbrake
             }\r
             catch(Exception exc)\r
             {\r
-                MessageBox.Show(exc.ToString());\r
+                MessageBox.Show("frmReadDVD.cs - updateUIElements " + exc.ToString());\r
             }\r
         }\r
 \r
@@ -103,7 +103,7 @@ namespace Handbrake
             }\r
             catch (Exception exc)\r
             {\r
-                MessageBox.Show(exc.ToString());\r
+                MessageBox.Show("frmReadDVD.cs - startProc " + exc.ToString());\r
             }\r
 \r
         }\r